anti affinity hyper-v 2019

matteu31 452 Reputation points
2022-04-19T16:42:27.587+00:00

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

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,062 questions
0 comments No comments
{count} votes