Skip to content

Test-DbaDiskAlignment - Reach a failover cluster instance through its virtual name - #10614

Open
andreasjordan wants to merge 1 commit into
developmentfrom
fix-testdbadiskalignment-fci
Open

Test-DbaDiskAlignment - Reach a failover cluster instance through its virtual name#10614
andreasjordan wants to merge 1 commit into
developmentfrom
fix-testdbadiskalignment-fci

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Problem

Against a cluster node, Test-DbaDiskAlignment took 366 seconds and returned nothing.

The command discovers instances from the node''s Win32_Service list and builds connection names as <node> / <node>\<instance>. A failover cluster instance only listens on its virtual server name, so on a node hosting FCIs every Connect-DbaInstance attempt burned the full connection timeout ("The system cannot find the file specified"), per instance and per disk — that is the six minutes. And because no connection ever succeeded, no disk qualified as a SQL disk, so the output was empty.

What changed

For each discovered SQL service the command now reads the ClusterName value from the instance hive''s Cluster registry key (SOFTWARE\Microsoft\Microsoft SQL Server\<hive>\Cluster) via StdRegProv over the CIM session it already holds — the key only exists for clustered instances. When present, the virtual server name is used as the connection name; otherwise the node name is used exactly as before. StdRegProv works over both WSMan and the DCOM fallback, so the command''s transport requirements are unchanged.

On the lab cluster node (hosting FCI01 as clustered default instance and FCI02\SQL2022): before, 366s and no output; after, 6 seconds and both cluster volumes correctly reported as SQL disks.

What deliberately did not change

  • Stand-alone instance discovery and connection naming.
  • The disk enumeration itself: cluster volumes owned by the node were always enumerated; the fix only makes the SQL-usage check able to see them.

Tests

The existing test file passes on both lab shapes: 3/3 against the default configuration (stand-alone SQL 2019) and 3/3 against the setC configuration (FCI01 as InstanceSingle, previously failing with an empty result). An FCI cannot be provisioned on any CI runner, so like the Get-DbaWsfc* family this path gets its real-boundary coverage from lab runs; the stand-alone path stays covered by CI.

Part of the setC findings (first full run with a clustered default instance), alongside #10605, #10606 and #10613.

🤖 Generated with Claude Code

… virtual name

The SQL check built instance names from the Win32_Service list of the
node, but a failover cluster instance only listens on its virtual
server name. Every connection attempt burned the full timeout and no
disk ever qualified as a SQL disk, so the command took six minutes to
return nothing. The virtual name is now read from the ClusterName
value of the instance hive over the existing CIM session; stand-alone
instances keep using the node name.

(do Test-DbaDiskAlignment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant