Get-DbaWsfcResourceGroup - Name the PartialOnline and Pending states of a resource group - #10673
Open
andreasjordan wants to merge 1 commit into
Open
Get-DbaWsfcResourceGroup - Name the PartialOnline and Pending states of a resource group#10673andreasjordan wants to merge 1 commit into
andreasjordan wants to merge 1 commit into
Conversation
…of a resource group Get-ResourceGroupState mapped -1/0/1/2 and returned the raw number for everything else, so a group with one resource offline showed State 3 and a group in transition State 4, although the help promised readable names. MSCluster_ResourceGroup documents 3 as PartialOnline and 4 as Pending. Get-DbaWsfcRole reports the same state through the same function. (do *Wsfc*)
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
Get-DbaWsfcResourceGroupandGet-DbaWsfcRolereportState = 3for a resource group that has one resource offline, and4for a group in transition. The documentation promises "Online, Offline, Failed, or Unknown", and both test files assert that every state is translated - which is how this surfaced in the lab: after a cluster resource restart both SQL Server groups sat atPartialOnlinefor a while (their CEIP service resources had stayed offline) and both files failed withExpected $null or empty, but got @('SQL Server (MSSQLSERVER)', 'SQL Server (SQL2022)').Mechanism
private/functions/Get-ResourceGroupState.ps1maps -1/0/1/2 and returns the raw number for everything else.MSCluster_ResourceGroup.Statehas two more documented values: 3 = PartialOnline, 4 = Pending.What changed
Get-ResourceGroupStatenames 3 asPartialOnlineand 4 asPending; anything else still comes back as the number, as before..OUTPUTS/.DESCRIPTIONof both commands list the two new names.Get-DbaWsfcResourceGroup.Tests.ps1that pins all six translations, run in module scope. Red on old:Expected 'PartialOnline', but got 3.Tests
PartialOnline), the old code fails the translation assertion and the new code passes it. CEIP brought back online afterwards.created by Claude and reviewed by Andreas Jordan
🤖 Generated with Claude Code