FailoverClusterDsc icon indicating copy to clipboard operation
FailoverClusterDsc copied to clipboard

Cluster: Fails if CNO and cluster name don't match

Open jrdbarnes opened this issue 4 years ago • 2 comments

If a cluster exists with a cluster name different to the name of the cluster computer object this resource will fail to correctly process the configuration. For example if the cluster name is longer than 15 characters then the computer object will be a shortened version of the name.

This line enumerates clusters in Active Directory, so looks for the Computer Object name, rather than connecting direct to the cluster.

https://github.com/dsccommunity/xFailOverCluster/blob/f4c289ae2e09d49c0a69bb081ab55f27c3cdd69e/source/DSCResources/MSFT_xCluster/MSFT_xCluster.psm1#L337

This line then tries to connect directly to the cluster to list the cluster nodes, but this requires the clusters full name, not the name of the computer object.

https://github.com/dsccommunity/xFailOverCluster/blob/f4c289ae2e09d49c0a69bb081ab55f27c3cdd69e/source/DSCResources/MSFT_xCluster/MSFT_xCluster.psm1#L347

I'm not sure what the best fix is here?

Line 337 makes sense, as we want to check that there isn't an existing object in active directory, but then we aren't checking the connection to the cluster prior to asking for the nodes.

jrdbarnes avatar Jun 24 '21 15:06 jrdbarnes

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

stale[bot] avatar Jul 24 '21 23:07 stale[bot]

Maybe line 347 should be changed to the following to make use of line 337 that already got the cluster?

$allNodes = $cluster | Get-ClusterNode

johlju avatar Jul 27 '21 15:07 johlju