Creating VM affinity or anti-affinity rules
VM affinity or anti-affinity rules go a level down from the group level affinity to a virtual machine level rule. The objective is to ensure that virtual machines are tied together or repel each other. This feature comes into play in situations where you may have two load balancer VMs that you want to keep apart, so that in the event of an underlying host failure the other instance is unaffected. Similarly, any clustering-based VMs would need to be kept separate to ensure both are not impacted by the same failures. In this recipe, we will walk through an example of ensuring that VMs run together.
Getting ready
These rules are created for VMs that are in a DRS-enabled ESXi cluster. Ensure you have access to a vCenter managing the cluster. Also be sure to have a list of VMs that have dependencies for which the rules ought to be created.
How to do it...
The following procedure will help you create an inter-VM affinity / anti-affinity rule:
- From the vCenter...