I have been trying to demonstrate a feature of failover clustering that is described in an article on WindowsITPro.com which discusses a property of cluster services called "AntiAffinityClassNames". According to the blog postand an MSDN article, you should be able to set the value of this property on two or more cluster groups (the virtual machines in this case) to the same value, and that should cause the services (virtual machines) to make a best effort to avoid running on the same host. I have created two test vm's and defined this property but have not had any sucess in exhibiting anti-affinity. Does anyone use this or have some tips on making this work? Did I miss a step somewhere?
What I have done:
- I already have a Win2008R2SP1 Hyper-V Cluster (HVCluster1) with three nodes (HVHost1, HVHost2, HVHost3)
- Created two virtual machines using SCVMM (AntiAffinity1 and AntiAffinity2) and placed them on HVHost1
- Defined the "AntiAffinityClassNames" property using the following commands
cluster /cluster:HVCluster1 group "SCVMM AntiAffinity1 Resources" /prop AntiAffinityClassNames="AntiTestGrp"
cluster /cluster:HVCluster1 group "SCVMM AntiAffinity2 Resources" /prop AntiAffinityClassNames="AntiTestGrp" - Validated that the property was set on each virtual machine (ie: group)
- Used SCVMM to Live Migrate AntiAffinity1 to HVHost2 and then also migrate AntiAffinity2 to HVHost2. AntiAffinity1 did not leave HVHost2.
- Used Failover Manager to Live Migrate AntiAffinity1 to HVHost3 and then also migrate AntiAffinity2 to HVHost3. AntiAffinity1 did not leave HVHost3.
- Used SCVMM to set HVHost3 in Maintainance Mode to cause Live Migration of running VMs. AntiAffinity1 and AntiAffinity2 both moved to HVHost1.
I did not set preferred owners of these services (vm's) so I am confused on how this property is supposed to work (if at all). I can somewhat understand the results I found in steps 5 and 6 becuase I am telling the cluster where to place the virtual machines so it's not running any failover logic to select the best palce for it, but I didn't expect the result in step 7.
MrShannon | TechNuggets Blog |Concurrency Blogs