VMware Cloud Community
StephenMoll
Expert
Expert
Jump to solution

HA with Anti-Affinity Rules Scenario

If I have 4 hosts in a cluster with HA protecting. For this scenario assume vSphere 6.5U2.

I also have 4 VMs, which are all listed in an anti-affinity rule.

So whilst all is running OK, each VM is running on a separate host.

Now supposing one of the hosts goes bang!

Does the VM that was running on that host get restarted on one of the three remaining hosts, contravening the anti-affinity rule, or is the VM left in a powered-off state?

If HA does actually restart the lost VM, how is the host chosen?

0 Kudos
1 Solution

Accepted Solutions
depping
Leadership
Leadership
Jump to solution

Re-reading my post and some internal documentation, HA will not violate the rule indeed. The documentation is correct, it seems I misunderstood development. thanks for pointing that out.

EDIT: I also now realize where the confusion is. The VM-Host rules HA will try to adhere to and is seen as a should rule. The anti-affinity is a must rule.

View solution in original post

0 Kudos
4 Replies
depping
Leadership
Leadership
Jump to solution

Starting vSphere 6.5 will aim to respect the rule, but will violate it if it cannot. If that behavior is undesired you can disable the restart through an advanced setting. I described that here:

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

0 Kudos
StephenMoll
Expert
Expert
Jump to solution

Thanks Duncan.

That seems to be at odds with the words in "VMware Docs - vSphere HA Advanced Options"

The wording is the same for 6.5 and 6.7:

das.respectvmvmantiaffinityrules

Determines if vSphere HA enforces VM-VM anti-affinity rules. The default value is "true" and rules are enforced even if vSphere DRS is not enabled. In this case, vSphere HA does not fail over a virtual machine if doing so violates a rule, but it issues an event reporting there are insufficient resources to perform the failover. This option can also be set to "false", whereby the rules are not enforced.

This suggests that HA will not failover a VM if a rule would be broken.

Is your YellowBricks article effectively a correction to the VMware documentation?

If so, is there a way to achieve the behaviour described in the VMware documentation (as above)?

0 Kudos
depping
Leadership
Leadership
Jump to solution

Re-reading my post and some internal documentation, HA will not violate the rule indeed. The documentation is correct, it seems I misunderstood development. thanks for pointing that out.

EDIT: I also now realize where the confusion is. The VM-Host rules HA will try to adhere to and is seen as a should rule. The anti-affinity is a must rule.

0 Kudos
StephenMoll
Expert
Expert
Jump to solution

That's good news and really helps with the scenario we are developing for.

The host affinity one I'll have to think about. I take it that this has no options available to make it a hard rule?

0 Kudos