Affinity and anti-affinity rules allow you to spread a group of virtual machines across different ESXi hosts or keep a group of virtual machines on a particular ESXi host.
An affinity rule places a group of virtual machines on a specific host so that you can easily audit the usage of those virtual machines. An anti-affinity rule places a group of virtual machines across different hosts, which prevents all virtual machines from failing at once in the event that a single host fails.
If the affinity or anti-affinity rules cannot be satisfied, this prevents the virtual machines added to the rule from powering on.
View VM Affinity and Anti-Affinity Rules in the VMware Cloud Director Tenant Portal
You can view existing affinity and anti-affinity rules and their properties, such as the virtual machines affected by the rules and whether the rules are enabled.
Procedure
- On the Virtual Data Center dashboard screen, click the card of the VDC you want to explore, and from the secondary left panel, select Affinity Rules.
- (Optional) Click the Grid editor icon () and select what details about the rules you want to be displayed.
Results
You see the list of the existing affinity and anti-affinity rules, virtual machines, and enabled status of each rule.
Create a VM Affinity Rule in the VMware Cloud Director Tenant Portal
Create an affinity rule to place a specific group of virtual machines on a single host so that you can audit the usage of those virtual machines.
Procedure
Results
VMware Cloud Director places the virtual machines associated with the affinity rule on a single host.
Create a VM Anti-Affinity Rule in the VMware Cloud Director Tenant Portal
Create an anti-affinity rule to place a specific group of virtual machines across multiple hosts to prevent simultaneous failure of those virtual machines in the event that a single host fails.
Procedure
Results
VMware Cloud Director places the virtual machines associated with the anti-affinity rule across multiple hosts.
Edit a VM Affinity or Anti-Affinity Rule in the VMware Cloud Director Tenant Portal
You can edit an affinity or anti-affinity rule to activate or deactivate the rule, add or remove virtual machines, change the rule name or the rule preference.
Prerequisites
Verify that you have the Organization vDC: VM-VM Affinity Edit right. This right is included in the predefined Catalog Author, vApp Author, and Organization Administrator roles.
Procedure
- On the Virtual Data Center dashboard screen, click the card of the VDC you want to explore, and from the secondary left panel, select Affinity Rules.
- Click the radio button next to the name of the rule that you want to edit and click Edit.
- Edit the rule properties.
- Change the name of the rule as necessary.
- Select whether to activate or deactivate the rule.
- Leave the Required check box selected.
- Add more virtual machines or remove virtual machines.
- Click Save.
Delete an Affinity or Anti-Affinity Rule in the VMware Cloud Director Tenant Portal
If you no longer want to use an affinity or anti affinity rule, you can delete it.
Procedure
- On the Virtual Data Center dashboard screen, click the card of the VDC you want to explore, and from the secondary left panel, select Affinity Rules.
- Click the radio button next to the name of the rule that you want to delete and click Delete.
- To confirm that you want to delete the rule, click OK.
Results
VMware Cloud Director deletes the affinity or anti-affinity rule.