A VM-Host anti-affinity policy describes a relationship between a category of VMs and a category of hosts.
A VM-Host anti-affinity policy can be useful when you want to avoid placing virtual machines that have specific host requirements such as a GPU or other devices, or capabilities such as IOPS control, on hosts that can't support those requirements. After the policy is created, the placement engine in your SDDC avoids deploying VMs covered by the policy on hosts covered by the policy.
- A policy cannot prevent a host from entering maintenance mode.
- A policy cannot prevent a host configured for HA from executing a failover. VMs with an anti-affinity for the failed host can be migrated to any available host in the cluster.
- A policy cannot prevent a VM from powering-on. If a VM subject to a VM-Host anti-affinity policy specifies a resource reservation that no host can meet, it is powered on on any available host.
This operation is restricted to users who have the CloudAdmin role.
- Create a category and tag for VMs that you want to include in a VM-Host anti-affinity policy.
Pick a category name that describes common characteristics of VMs you plan to tag as members of that category.
- Create a category and tag for hosts that you want to include in a VM-Host anti-affinity policy.
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.
- Tag the VMs and hosts that you want to include in a VM-Host anti-affinity policy.
- Create a VM-Host anti-affinity policy.
- In your SDDC, click OPEN VCENTER.
- From the vSphere Client, click .
- Click Add to open the New Compute Policy Wizard.
- Fill in the policy Name and choose VM-Host anti-affinity from the Policy type drop-down control.
The policy Name must be unique within your SDDC.
- Provide a Description of the policy, then use the VM tag and Host Tag drop-down controls to choose a Category and Tag to which the policy applies.
Unless you have multiple tags associated with a VM or host in a given category, the wizard fills in the VM tag and Host tag after you select the tag Category.
- Click Create to create the policy.
- (Optional) To delete a compute policy, open the vSphere Client, click to show each policy as a card. Click DELETE to delete a policy.