Affinity or anti-affinity DRS rules are not applied during a virtual machine power-on
search cancel

Affinity or anti-affinity DRS rules are not applied during a virtual machine power-on

book

Article ID: 309866

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provides information on how to set up anti-affinity rules to keep two Microsoft Cluster virtual machines on separate hosts.

Symptoms:
  • Affinity DRS rules are not applied when powering on a virtual machine.
  • Affinity and anti-affinity DRS rules are not applied when powering on a virtual machine.


Environment

VMware vCenter Server 5.5.x
VMware vCenter Server 5.0.x
VMware vCenter Server 4.1.x
VMware vCenter Server 5.1.x

Cause

This issue occurs due to a High Availability event. High Availability does not consult DRS rules for affinity or anti-affinity when a virtual machine is powering on. A DRS can migrate virtual machines to satisfy affinity rules after the virtual machine is powered on. However, this is not an option when using Microsoft Clustering, or other virtual machines using RDMs. This may result in multiple virtual machines with anti-affinity rules stuck on the same ESX/ESXi host that requires a reboot to migrate.

Resolution

To set up anti-affinity rule to keep two Microsoft Cluster virtual machines on separate hosts, you must edit the DRS cluster.

To edit the DRS cluster using the vSphere Client:
  1. Navigate to Rules > Add.
  2. Click Add.
  3. Click the DRS Groups Manager tab.
  4. Click Add under Host DRS Groups to create a new Host DRS Group containing half of the ESX/ESXi hosts in the cluster. Create a second Host DRS Group containing the remaining hosts.
  5. Click Add under Virtual Machine DRS Groups to create a Virtual Machine DRS Group for each anti-affinity virtual machine.
  6. Click the Rule tab.
  7. Select Virtual Machines to Hosts from the Type dropdown.
  8. Navigate to Cluster Vm Group > Must run on hosts in group.
  9. Select the first virtual machine from Cluster VM Group.
  10. Select a host from the Cluster Host Group.
  11. Click Must run hosts in group.
  12. Select the second virtual machine from Cluster VM Group.
  13. Select the second host from the Cluster Host Group and click OK.
    To edit the DRS cluster using the vSphere Web Client:
    1. Click Host and Clusters.
    2. Select the Cluster to add the rule to.
    3. Click the Manage tab.
    4. Click Settings.
    5. Click DRS Groups.
    6. In the DRS Groups section, click Add.
    7. In the Create DRS Group, enter a name for the group.
    8. Select VM DRS Group from the Type dropdown and click Add.
    9. Select the virtual machine to add.

      Continue this process until all required virtual machines are added.

    10. Click OK.
    Note:
    • This requires at least four hosts to support a Microsoft Cluster of two virtual machines.
    • Hard and soft rules were added in vCenter Server 4.1 to allow HA to consider DRS during virtual machine boot.


    Additional Information