A VM-VM anti-affinity policy describes a relationship among a category of VMs.
A VM-VM anti-affinity policy discourages placement of virtual machines in the same category on the same host. This kind of policy can be useful when you want to place virtual machines running critical workloads on separate hosts, so that the failure of one host does not affect other VMs in the category. After the policy is created, the placement engine in your SDDC attempts to deploy VMs in the category on separate hosts. You can use existing tags and categories or create new ones specific to your needs. See vSphere Tags and Attributes for more about creating and using tags.
Enforcement of a VM-VM anti-affinity policy can be affected in several ways:
If the policy applies to more VMs that there are hosts in the SDDC, or if it's not possible to place a VM on a host that satisfies the policy, DRS attempts to place the VM on any suitable host.
If a provisioning operation specifies a destination host, that specification is always honored even if it violates the policy. DRS will try to move the VM to a compliant host in a subsequent remediation cycle.
This operation is restricted to users who have the CloudAdmin role.
- Create a category and tag for each group of VMs that you want to include in a VM-VM anti-affinity policy.
- Tag the VMs that you want to include in each group.
- Create a VM-VM anti-affinity policy.
- In your SDDC, click OPEN VCENTER.
- From the vSphere Client Home, click .
- Click Add to open the New Compute Policy Wizard.
- Fill in the policy Name and Description, then use the VM tag drop-down control to choose the VM category to which the policy applies.
The policy Name must be unique within your SDDC. Unless you have multiple VM tags associated with a category, the wizard fills in the VM tag after you select the tag category.
- Click Create to create the policy.
- (Optional) To delete a compute policy, open the vSphere Web Client, click to show each policy as a card. Click DELETE to delete a policy.