Got any luck with this? It's not working for me neither.
Regards
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I setup a new Hyper-v 2019 cluster 2 nodes and build anti affinity rules but it's not working. Is there any special requirements or limitations ?
VM stay on the same node.
I use microsoft documentation :
$AntiAffinity = New-Object System.Collections.Specialized.StringCollection
$AntiAffinity.Add("DC")
(Get-ClusterGroup -Name "DC1").AntiAffinityClassNames = $AntiAffinity
(Get-ClusterGroup -Name "DC2").AntiAffinityClassNames = $AntiAffinity
I can see both DC1 and DC2 with DC anti affinity group DC with the following command
Get-ClusterGroup | fl AntiAffinityClassNames
Got any luck with this? It's not working for me neither.
Regards
Anti-affinity doesn't automatically migrate VMs out. It tries to prevent them from migrating to the same node during failover. It's kind of a useless feature in a two node cluster.
For the record, since this seems like we're talking about domain controller VMs, I recommend storage migrating the first DC to local storage on the first node and the second DC to local storage on the second node, removing them both from the cluster, and setting them both to auto-start with a delay of 0. You don't need every DC online all the time and AD replication works perfectly. In addition to making the anti-affinity into a non-issue, this also gives you domain controller resiliency if something goes wrong with the cluster.