VMware Cloud Community
ItsBob
Contributor
Contributor

DRS Cluster Affinity Rule Question

I have a 6 host DRS cluster configured. I want to create an affinity rule set for a group of VMs to run on 3 of the 6 hosts in the DRS cluster. If 1 of the 3 hosts in my affinity rule set fails, does the affinity rule set get nullified allowing the VMs to run on any of the 5 hosts left in the cluster or do the VMs restart on one of the 2 remaining hosts in the rule set? What happens in the case of 2 hosts in my affinity rule set failing? Do the VMs try to restart on the remaining host or do the rules get nullified allowing them to restart on any one of the 4 hosts in the cluster?

0 Kudos
5 Replies
ArjunDooti
Enthusiast
Enthusiast

Hi Bob,


On host failure,  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.

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

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=20031...

Thanks & Regards

Arjun Dooti

0 Kudos
SureshKumarMuth
Commander
Commander

Hi,

while setting the affinity rule, you will get two options "must run on host" and "should run on host"

In your example , the set of VMs been set to run on 3 ESXi hosts. In case if the host among three hosts fails the VMs will be powered on in the other two nodes , in case two hosts fails they will be powered on the one host which is alive among the three.

Now there is catch here, if you set the option "must run on these three hosts" -- the VMs will never go out of these three hosts and they can only run on any of these 3 hosts or the VMs wont start.

In case the option is set as "should run on host" --> this is bit relaxed on where the preferences are given to the 3 hosts as per rule, but in case if there are situation that these 3 hosts cannot accommodate the VMs  then the vms can also be started on other hosts in the cluster.

Regards,

Suresh

Regards,
Suresh
https://vconnectit.wordpress.com/
0 Kudos
ItsBob
Contributor
Contributor

Suresh,

Thank you for the response. Is there any documentation from VMware on the criteria for VMs starting on other hosts in the cluster for the "should" option?

Bob

0 Kudos
SureshKumarMuth
Commander
Commander

There are no criteria as such, its upto user requirement. However, explanation is given in the following links

VMware DRS Rules - Should VS Must

Should or Must VM-Host affinity rules? - frankdenneman.nl

vSphere 5.5 Documentation Center

Regards,
Suresh
https://vconnectit.wordpress.com/
0 Kudos
vGilroy
Contributor
Contributor

HA will take into account your DRS rules with the proper settings in 6.0 and 6.5.

Where's the HA enforce VM-Host and Affinity rules option in vSphere 6.5? - Yellow Bricks

0 Kudos