dsccommunity / dsccommunity/SqlServerDsc
SqlSetup: FCI replication not detected after install
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
Installing a fail over cluster with replication initially succeeds but subsequent tests fail to detect replication despite successful install.
Verbose logs showing the problem
VERBOSE: [FCN01]: LCM: [ Start Test ] [[SqlSetup]MSSQL01::[SQLDB]SQLDB]
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Using path 'C:\Install\setup.exe'.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Detecting Database Engine feature.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Database Engine feature detected.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'MSSQL$MSSQL01','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Operation 'Query CimInstances' complete.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT * FROM Win32_Service WHERE Name = 'SQLAgent$MSSQL01','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Operation 'Query CimInstances' complete.
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Detecting replication feature (HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQL01\ConfigurationState).
VERBOSE: [FCN01]: [[SqlSetup]MSSQL01::[SQLDB]SQLDB] Replication feature not detected.
Registry excerpt:
Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQL01
Name Property
---- --------
Cluster ClusterName : FCN01
SharedDataPatchLevel : 14.0.3030.27
RunWithIPORDependency : 0
ClusterState SQL_Replication_Core_Inst : 1
MPT_AGENT_CORE_CNI : 1
SQL_Engine_Core_Inst : 1
SQL_FullText_Adv : 1
SQL_DQ_Full : 1
ConfigurationState SQL_Replication_Core_Inst : 2
MPT_AGENT_CORE_CNI : 2
SQL_Engine_Core_Inst : 2
SQL_FullText_Adv : 2
SQL_DQ_Full : 2
Replication DistributionDB :
WorkingDirectory : C:\MSSQL01\System\MSSQL14.MSSQL01\MSSQL\repldata
IsInstalled : 1
Suggested solution to the issue
The value for HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server$fullInstanceId\ConfigurationState\SQL_Replication_Core_Inst is 2 not 1 as per the current test.
in MSFT_SqlSetup.psm1, line 146
if ($isReplicationInstalled -eq 1)
change to
if ($isReplicationInstalled -in 1,2)
The DSC configuration that is used to reproduce the issue (as detailed as possible)
SqlSetup "MSSQL01" {
Action = "InstallFailoverCluster"
InstanceName = "MSSQL01"
Features = "SQLENGINE,REPLICATION,FULLTEXT,CONN"
FailoverClusterNetworkName = "FCNN01"
FailoverClusterGroupName = "FCNN01"
FailoverClusterIPAddress = "10.10.10.1"
SQLSysAdminAccounts = "DOMAIN\DBAs"
InstanceDir = "C:\Program Files\Microsoft SQL Server"
SourcePath = "C:\Install"
}
SQL Server edition and version the target node is running
SQL 2017 - 14.0.3030.27
SQL Server PowerShell modules present on the target node
SQLPS 14.0 C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\SQLPS\SQLPS.psd1
The operating system the target node is running
OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.2485.amd64fre.rs1_release.180827-1809
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
PSVersion 5.1.14393.2485
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2485
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)
SqlServerDsc 11.3.0.0 C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\11.3.0.0\SqlServerDsc.psd1
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
Start at MSFT_SqlSetup.psm1 line 146 and inspect how the ConfigurationState registry value is used to detect replication. Reproduce the InstallFailoverCluster scenario with the supplied SqlSetup configuration, then rerun the subsequent SqlSetup tests and confirm replication is detected when the registry reports the installed state shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- database, devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100