dsccommunity / dsccommunity/SqlServerDsc
SqlDatabaseFileGroup: New resource suggestion
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 385
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
Details of the scenario you tried and the problem that is occurring:
I suggest we add a resource named SqlDatabaseFileGroup to be able to create and remove filegroups, which in turn can be used by the suggested resource SqlDatabaseFile (issue #57).
The properties to be set for a file group can be seen in this article ALTER DATABASE (Transact-SQL) File and Filegroup Options.
Suggested schema for discussion below.
[ClassVersion("1.0.0.0"), FriendlyName("SqlDatabaseFileGroup")]
class MSFT_SqlDatabaseFileGroup : OMI_BaseResource
{
[Key, Description("The name of the database to be configured.")] String DatabaseName;
[Key, Description("The host name of the SQL Server to be configured.")] String SQLServer;
[Key, Description("The name of the SQL instance to be configured.")] String SQLInstanceName;
[Key, Description("The name of the filegroup.")] String Name;
[Write, Description("An enumerated value that describes if the filegroup should be added ('Present') or removed ('Absent'). Default value is 'Present'."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Set to $true if the filegroup should be the default filegroup. Only one filegroup in the database can be the default filegroup. Defaults to $false.")] Boolean Default;
[Write, Description("If set to $true specifies that the filegroup stores FILESTREAM binary large objects (BLOBs) in the file system. Defaults to $false.")] Boolean FileStream;
[Write, Description("If set to $true specifies that the filegroup stores memory optimized data in the file system. Defaults to $false.")] Boolean MemoryOptimizedData;
[Write, Description("Sets what happens when a filegroup reaches the autogrow threshold. If set to 'Single' means when a file in the filegroup meets the autogrow threshold, only that file grows. If set to 'All' means when a file in the filegroup meets the autogrow threshold, all files in the filegroup grow. Default is 'Single'."), ValueMap{"Single","All"}, Values{"Single","All"}] String AutoGrow;
};
The DSC configuration that is using the resource (as detailed as possible):
n/a
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
n/a
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
n/a
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the proposed schema and the linked ALTER DATABASE (Transact-SQL) File and Filegroup Options article, then compare the existing SqlServerDsc resource conventions. Issue #57 provides related context for SqlDatabaseFile. Done means the module supports a SqlDatabaseFileGroup resource that can create and remove filegroups with the proposed properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100