Affinity and anti-affinity rules guide VM-host and VM-VM behaviors. Affinity rules force VM members of a Distributed...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Resource Scheduler group to run on either a host group or with a VM group; anti-affinity rules block the VM members of a DRS group from running on a particular host group or with a VM group. Proper use of these rules can enhance performance and strengthen resilience.
The two primary approaches to affinity and anti-affinity rules are to create VM-host rules or to create VM-VM rules.
In the first method, an administrator can create VM-host affinity or anti-affinity rules to specify whether or not the VMs a DRS group includes can be placed on the nodes involved in a specified host DRS group. The administrator must create the VM and host groups to which VM-host rules will apply.
To create VM-host rules, select the desired cluster in the vSphere Web Client, then click Manage > Settings > DRS Rules > Add. Enter a meaningful name for the new rule in the Create DRS Rule dialog box. Select Virtual Machines to Hosts from the Type drop-down menu. Now, select the VM DRS group to apply the new rule. Finally, choose an affinity type, such as Must run on hosts in group or Should run on hosts in group, or select an anti-affinity type, such as Must not run on hosts in group or Should not run on hosts in group. Click OK to save changes and implement the rule.
In the second method, an administrator can create VM-VM affinity or anti-affinity rules to specify whether specific VMs should run together on the same host or be separated onto different hosts. Just remember that using the High Availability (HA) Specify Failover Hosts feature in vSphere will ignore VM-VM rules because it's possible to specify multiple failover hosts.
The process to create VM-VM rules is very similar to that used for VM-host rules. Select the desired cluster in the vSphere Web Client, then click Manage > Settings > DRS Rules > Add. Enter a descriptive name for the new rule in the Create DRS Rule dialog box. Locate the Type drop-down menu, and choose Keep Virtual Machines Together (affinity) or Separate Virtual Machines (anti-affinity). Click Add, and select two or more VMs to apply the rule. Click OK to save changes and implement the rule.
Make removing a single point of failure affordable
Set up automatic failover to maintain availability
Take advantage of DRS and HA rules for consistent uptime
Dig Deeper on DRS and DPM
Related Q&A from Stephen J. Bigelow
VMware VIC security features, like isolation and user authentication, can improve enterprise container security so long as proper configuration and ...continue reading
VSphere Integrated Containers uses a combination of VIC engine, Project Harbor, Project Admiral and Photon OS to handle container provisioning, ...continue reading
OpenStack scheduled numerous hypervisors for deprecation in 2014's OpenStack Icehouse, but no others are scheduled for future releases, up to and ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.