Q
Get started Bring yourself up to speed with our introductory content.

How do you apply VM-host and VM-VM affinity rules in DRS?

Affinity and anti-affinity rules improve application performance and resilience. Select the desired clusters in vSphere Web Client, and add rules to apply affinity rules to DRS.

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.

Next Steps

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

This was last published in September 2017

Dig Deeper on DRS and DPM

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

How do you use affinity rules in a DRS group?
Cancel

-ADS BY GOOGLE

SearchServerVirtualization

SearchVirtualDesktop

SearchDataCenter

SearchCloudComputing

Close