dsccommunity / dsccommunity/SqlServerDsc

SqlDatabase: RecoveryModel should accept wildcard * ?

Open
#1,289 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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'm installing Sharepoint 2016 with DSC, and have to put the databases into SQL Always On.
For this, I have to use SqlDatabaseRecoveryModel to change the recovery mode to Full prior to use SQLAgDatabase.

The trick is that Sharepoint is creating databases with GUID in their names. So I can't know the database name before install Sharepoint, and I need it to use SqlDatabaseRecoveryModel.

Verbose logs showing the problem
Suggested solution to the issue

I suggest to be able to use Wildcard in the name property, as it is for SqlAgDatabase with the DatabaseName property.

With this, we should be able to do Always On on Sharepoint databases with only the first part of the database name knowed.

The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
SqlDatabaseRecoveryModel "ChangeRecoveryToFull_OperationsManagerDW" {
                        Name                 = 'SharepointAdminContent' #should be able to have * !!
                        RecoveryModel        = 'Full'
                        ServerName           = ( $AllNodes | Where-Object { $_.Role -eq 'PrimaryReplica' } ).NodeName
                        InstanceName         = ( $AllNodes | Where-Object { $_.Role -eq 'PrimaryReplica' } ).InstanceName
                        PsDscRunAsCredential = $SqlInstallCredential
                        DependsOn            = '[WaitForAll]InstallSP_Serveur1'
                    }
SQL Server edition and version the target node is running

SQL 2016

SQL Server PowerShell modules present on the target node

12.2.0.0

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Standard Evaluation
OsOperatingSystemSKU : 79
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.2791.amd64fre.rs1_release.190205-1511
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

PSVersion 5.1.14393.2791
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2791
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

12.2.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SqlDatabaseRecoveryModel resource and its Name property, then compare how SqlAgDatabase handles wildcard database names. Verify the behavior against the SharePoint-style database names described in the configuration; done means the resource accepts * and ? patterns while setting RecoveryModel to Full.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.