Understanding the functionality of the DRS anti-affinity rule to separate virtual machines by host
search cancel

Understanding the functionality of the DRS anti-affinity rule to separate virtual machines by host

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 anti-affinity rules to separate VMs by hosts have been configured

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) as these are non-mandatory rules 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