-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xSQLServerAlwaysOnAvailabilityGroup: Fails when assigning FQDN to parameter SQLServer #468
Comments
I think I see what the problem is here. I need to think through how to resolve this one since the availability group replica can be created with either the FQDN or the NETBIOS names, and this should support both. |
You mean SQL Server should accept FQDN here? It felt like SQL Server responded with that it did not recognized FQDN server name when the cmdlet I worked around it for the time being. :) xSQLServerAlwaysOnAvailabilityGroup $resourceConfigName
{
Ensure = 'Present'
Name = $Node.AvailabilityGroupName
SQLInstanceName = $Node."$($currentSqlInstance)InstanceName"
# This must be the Netbios name (bug issue #468)
SQLServer = ($Node.NodeName -split '.', 2, 'simplematch' | Select-Object -First 1)
} |
Yeah, connecting to SQL with the FQDN isn't the problem. When the replica is added to the availability group, it has to either be the FQDN or the NETBIOS name. At the moment, I'm detecting the name of the name of the replica from the NetName(?) of the server object, therefore it is always the NETBIOS name. I need to add some logic to translate between NETBIOS and FQDN so using the FQDN to connect to the instance doesn't break the resource. |
EndpointHostName is set to This fails xSQLServerAlwaysOnAvailabilityGroup $resourceConfigName
{
Ensure = 'Present'
Name = $Node.AvailabilityGroupName
SQLInstanceName = $Node."$($currentSqlInstance)InstanceName"
SQLServer = 'sqltest.company.local'
EndpointHostName = 'sqltest'
PsDscRunAsCredential = $SqlAdministratorCredential
} This fails also xSQLServerAlwaysOnAvailabilityGroup $resourceConfigName
{
Ensure = 'Present'
Name = $Node.AvailabilityGroupName
SQLInstanceName = $Node."$($currentSqlInstance)InstanceName"
SQLServer = 'sqltest.company.local'
EndpointHostName = 'sqltest.company.local'
PsDscRunAsCredential = $SqlAdministratorCredential
} But this do work xSQLServerAlwaysOnAvailabilityGroup $resourceConfigName
{
Ensure = 'Present'
Name = $Node.AvailabilityGroupName
SQLInstanceName = $Node."$($currentSqlInstance)InstanceName"
SQLServer = 'sqltest'
EndpointHostName = 'sqltest.company.local'
PsDscRunAsCredential = $SqlAdministratorCredential
} So I think it is line 334 that is the issue. When SQLServer is set to 'sqltest.company.local' (FQDN) Maybe |
Starting on this one. |
@randomnote1 Great! Labeled it as in progress. |
Notes for myself: Test the following scenarios for the supplied SQLServer parameter, availability group replica names, and database mirroring endpoints.
|
- Changes to xSQLServerAlwaysOnAvailabilityGroup - Refactored the unit tests to allow them to be more user friendly and to test additional SQLServer variations. - Each test will utilize the Import-SQLModuleStub to ensure the correct module is loaded (issue #784). - Fixed an issue when setting the SQLServer parameter to a Fully Qualified Domain Name (FQDN) (issue #468). - Fixed the logic so that if a parameter is not supplied to the resource, the resource will not attempt to apply the defaults on subsequent checks (issue #517). - Added the CommonTestHelper.psm1 to store common testing functions. - Added the Import-SQLModuleStub function to ensure the correct version of the module stubs are loaded (issue #784).
Details of the scenario you try and problem that is occurring:
When assigning FQDN to the SQLServer parameter, for example 'sqltest.company.local', then the resource fails.
Workaround is to change SQLServer to NETBIOS name, for example 'SQLTEST'.
The DSC configuration that is using the resource (as detailed as possible):
Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2012 R2, SQL Server 2016 and WMF 5.0
Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev
The text was updated successfully, but these errors were encountered: