Testing Get-DbaNetworkConfiguration - Certify the virtual name of a cluster instance - #10613
Open
andreasjordan wants to merge 1 commit into
Open
Testing Get-DbaNetworkConfiguration - Certify the virtual name of a cluster instance#10613andreasjordan wants to merge 1 commit into
andreasjordan wants to merge 1 commit into
Conversation
…luster instance On a failover cluster instance the suitability check correctly compares the certificate against the virtual server name, but the test issued its certificate with plain -ComputerName, which New-DbaComputerCertificate resolves to the node the instance currently runs on. The test now reads VSName first and passes it as -ClusterInstanceName, the documented way to certify a cluster instance. Stand-alone instances are unchanged. (do Get-DbaNetworkConfiguration)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a lab configuration whose
InstanceSingleis a failover cluster instance (FCI01, a clustered default instance), the test "Should return a suitable certificate thumbprint" fails:SuitableCertificatecomes back empty.The command is right and the test fixture is wrong.
Get-DbaNetworkConfigurationchecks candidate certificates against the instance''s virtual server name (VSNAME), per Microsoft''s certificate requirements for failover clusters. But the test created its certificate withNew-DbaComputerCertificate -ComputerName FCI01, and that command resolves the virtual name to the node the instance currently runs on — the certificate was issued asCN=SQL02.ordix.localwith only the node in its SAN. Diagnosed by evaluating each of the eight suitability conditions individually on the node: all pass except the DNS name match.What changed
Test only. The fixture now reads
VSNamefromGet-DbaNetworkConfiguration -OutputType Certificatefirst and, when it is set, passes it as-ClusterInstanceName— the documented way to certify a cluster instance (nodes in-ComputerName, virtual name in-ClusterInstanceName). On a stand-alone instanceVSNameis empty and the call is exactly what it was before.What deliberately did not change
New-DbaComputerCertificateitself. That a plain-ComputerName <cluster network name>silently issues a certificate for the node could be considered surprising, but-ClusterInstanceNameexists and is documented for this, so the command was left alone.Tests
Verified in the lab on both shapes: 4/4 against the setC configuration (FCI01 as InstanceSingle, previously failing) and 4/4 against the default configuration (stand-alone SQL 2019 instance).
This is the third test defect exposed by running the suite with a clustered default instance, after #10605 and #10606.
🤖 Generated with Claude Code