Understanding the functionality of the DRS rule to separate virtual machines
search cancel

Understanding the functionality of the DRS rule to separate virtual machines

book

Article ID: 394815

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • This KB outlines the behavior of HA and DRS in the below two scenarios where DRS rules to "Separate Virtual Machines" have been configured
  • This is VM-VM anti-affinity and means the virtual machines must be run on different hosts within a cluster.
  • A "Separate Virtual Machines" rule is useful when you have multiple resource intensive or busy VMs.
  • You can use Separate Virtual Machines rules to ensure that these VMs are always running on different hosts in the cluster to avoid resource contention

Scenario 1

  • There are 10 hosts and anti affinity for VMs by hosts is set to 9 of the VMs.
  • What would be the behavior if 2 hosts fail or crash
  • There are 10 hosts and anti affinity for VMs by hosts is set to 10 of the VMs.
  •  What would be the behavior if 1 or more hosts fail or crash

Scenario 2

  • There are 10 hosts and anti affinity for VMs by hosts is set to 10 of the VMs
  • What would be the behavior if 1 host is put in maintenance mode

Environment

  • VMware vCenter Server
  • VMware vSphere ESXi

Resolution

For Scenario 1 where 1 or more ESXI hosts crash:

  1. The VMs will be restarted by HA on other ESXi hosts
  2. If for whatever reason vSphere HA cannot respect the rule it will restart the VMs (violating the rule) on any host as these are non-mandatory rules and it chooses availability over compliance in this situation

For Scenario 2 where 1 ESXi host is put in maintenance mode:

  1. The default behavior of DRS is to respect the rule and therefore vMotion will fail
  2. The task to enter maintenance mode will be stuck as migration will not succeed because of the rule
  3. The workaround is to disable the rule and then put the host in maintenance mode

Additional Information

Using Virtual Machine Affinity Rules