You can control the placement of virtual machines on hosts within a cluster by using affinity rules.

The following list describes the two types of affinity rules.

VM-Host affinity rules are used to specify affinity (or anti-affinity) between a group of virtual machines and a group of hosts. See VM-Host Affinity Rules for information about creating and using this type of rule.

VM-VM affinity rules are used to specify affinity (or anti-affinity) between individual virtual machines. See VM-VM Affinity Rules for information about creating and using this type of rule.

When you add or edit an affinity rule, and the cluster's current state is in violation of the rule, the system continues to operate and tries to correct the violation. For manual and partially automated DRS clusters, migration recommendations based on rule fulfillment and load balancing are presented for approval. You are not required to fulfill the rules, but the corresponding recommendations remain until the rules are fulfilled.

To check whether any enabled affinity rules are being violated and cannot be corrected by DRS, select the cluster's DRS tab and click Faults. Any rule currently being violated has a corresponding fault on this page. Read the fault to determine why DRS is not able to satisfy the particular rule. Rules violations also produce a log event.

Note

VM-VM and VM-Host affinity rules are different from an individual host’s CPU affinity rules.