dsccommunity / dsccommunity/SqlServerDsc
SqlAlwaysOnService: Loading wrong SQLPS when both SQL Server 2014 and SQL Server 2016 exists
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:
Enable AlwaysOn fails to configure SQL Server 2016 when both SQL Server 2014 and SQL Server 2016 is installed and having SQLPS module installed for both major version.
The reason is that sometimes the wrong SQLPS module is loaded (because it is the first in the $env:PATH list).
Could not obtain information about SQL Server Service 'MSSQL$DSCSQL2016'.
+ CategoryInfo : ResourceUnavailable: (MSSQL$DSCSQL2016:) [], CimException
+ FullyQualifiedErrorId : ServiceError,Microsoft.SqlServer.Management.PowerShell.Hadr.EnableSqlHADRServiceCommand
+ PSComputerName : localhost
The DSC configuration that is using the resource (as detailed as possible):
xSQLServerAlwaysOnService 'Integration_Test'
{
Ensure = 'Present'
SQLServer = $Node.ComputerName
SQLInstanceName = $Node.InstanceName
RestartTimeout = $Node.RestartTimeout
PsDscRunAsCredential = $SqlInstallCredential
}
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016, SQL Server 2014 and 2016, WMF 5.1
What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
SQLPS
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev
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 by reproducing xSQLServerAlwaysOnService with SQL Server 2014 and 2016, both exposing SQLPS, and inspect how the resource resolves the SQLPS module from the environment. Confirm completion by showing that Enable AlwaysOn targets the SQL Server 2016 instance and no longer raises the reported service information error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, sql
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100