Mike Kiev - Fotolia
Affinity and anti-affinity rules guide VM-host and VM-VM behaviors. Affinity rules force VM members of a Distributed...
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
Eliciting performance requirements from business end users necessitates a clearly defined scope and the right set of questions. Expert Mary Gorman ... Continue Reading
Requirements fall into three categories: business, user and software. See examples of each one, as well as what constitutes functional and ... Continue Reading
Navigating data center malfunctions when hardware is off premises can be tricky. Organizations must have strong SLAs with their colo provider to ... Continue Reading