Use anti-affinity in Failover Clustering

How to properly configure anti-affinity in a Failover Cluster.

John Savill

October 14, 2015

1 Min Read
Use anti-affinity in Failover Clustering

Q. How do I configure anti-affinity in my Failover Cluster?

A. Anti-affinity enables a collection to be created which contains VMs that the cluster will attempt to keep on separate nodes. This is important when you have multiple instances of a service running in a cluster and want to ensure they are distributed over multiple nodes to ensure service availability even if a node fails. In the example below I add 3 VMs to an anti-affinity group which will then ensure where possible they will each run on different nodes in the cluster.

Get-ClusterGroup | Select AntiAffinityClassNames$ATAAntiAffinity = New-Object System.Collections.Specialized.StringCollection$ATAAntiAffinity.Add("ATA Gateway")(Get-ClusterGroup -Name infra-atagw1).AntiAffinityClassNames = $ATAAntiAffinity(Get-ClusterGroup -Name infra-atagw2).AntiAffinityClassNames = $ATAAntiAffinity(Get-ClusterGroup -Name infra-atagw3).AntiAffinityClassNames = $ATAAntiAffinity

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like