Update Get-SdnClusterType to improve failover cluster detection#438
Closed
Copilot wants to merge 2 commits into
Closed
Update Get-SdnClusterType to improve failover cluster detection#438Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: luyaof <50725564+luyaof@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Get-SdnClusterType not able to detect failover cluster type on NC FC deployment
Update Get-SdnClusterType to improve failover cluster detection
May 21, 2025
Contributor
|
Validated in local lab. The |
arudell
reviewed
May 22, 2025
| $service = Get-Service -Name 'SDNApiService' -ErrorAction Ignore | ||
| if ($service) { | ||
| # 1. First check if ClusSvc service exists | ||
| $clusService = Get-Service -Name 'ClusSvc' -ErrorAction Ignore |
Member
There was a problem hiding this comment.
@luyaof curious on this one. In my lab environments for testing and what I am seeing with validatgion testing, is the service 'SdnApiService' exists, it's just not running unless it's the primary owner node. Are you seeing something different in your environments?
Contributor
There was a problem hiding this comment.
I see the issue. My lab is running on an old OS build. There was a change of the service name with prefix "SDN" added. So my lab showing service name ApiService instead of SdnApiService so failed detect the cluster type.
auto-merge was automatically disabled
May 23, 2025 14:11
Pull request was closed
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.
Issue
Get-SdnClusterTypewas failing to detect FailoverCluster type when run on a node that is not the owner of the ApiService resource group. This was because the function was checking for the existence of a service called 'SDNApiService', which is only present on the node owning the ApiService resource group.Changes
Modified the detection logic in
Get-SdnClusterTypeto:This approach works correctly regardless of which node in the cluster is being queried, addressing the issue where detection failed when run on a node that was not the owner of the ApiService resource group.
Example
Before this change, running
Get-SdnInfrastructureInfoon a non-owner node in a Network Controller Failover Cluster deployment would fail to identify the correct cluster type.With this change, the cluster type is correctly detected as FailoverCluster on all nodes in the cluster, allowing
Get-SdnInfrastructureInfoto successfully retrieve SDN Infrastructure information.Fixes #437.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.