Skip to content

Update Get-SdnClusterType to improve failover cluster detection#438

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-437
Closed

Update Get-SdnClusterType to improve failover cluster detection#438
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-437

Conversation

Copilot AI commented May 21, 2025

Copy link
Copy Markdown
Contributor

Issue

Get-SdnClusterType was 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-SdnClusterType to:

  1. First check if 'ClusSvc' service exists. If not, classify as ServiceFabric.
  2. If 'ClusSvc' exists, check for the existence of the 'ApiService' cluster group using Get-ClusterGroup. If such group exists, classify as FailoverCluster, otherwise as ServiceFabric.

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-SdnInfrastructureInfo on 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-SdnInfrastructureInfo to 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.

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
Copilot AI requested a review from luyaof May 21, 2025 03:57
Copilot finished work on behalf of luyaof May 21, 2025 03:57
@luyaof luyaof marked this pull request as ready for review May 22, 2025 03:52
@luyaof luyaof requested a review from a team as a code owner May 22, 2025 03:52
@luyaof

luyaof commented May 22, 2025

Copy link
Copy Markdown
Contributor

Validated in local lab. The Get-SdnInfrastructureInfo now works.

@luyaof luyaof enabled auto-merge May 22, 2025 05:51
$service = Get-Service -Name 'SDNApiService' -ErrorAction Ignore
if ($service) {
# 1. First check if ClusSvc service exists
$clusService = Get-Service -Name 'ClusSvc' -ErrorAction Ignore

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@luyaof luyaof closed this May 23, 2025
auto-merge was automatically disabled May 23, 2025 14:11

Pull request was closed

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.

Get-SdnClusterType not able to detect failover cluster type on NC FC deployment

3 participants