VMware Cloud Community
marvinb
Enthusiast
Enthusiast
Jump to solution

VMWare rules: I want to run 4 vms on 4 differnt servers (need a should relationship, not must)

We recently upgraded from vSphere 5.5  to 6.5.  The migration changed some of our rules.

I have a cluster with 4 hosts.  I had 4 vms that I wanted, by default, to run on different hosts but could run on the same if needed.

There was a rule in 5.5 that enforced a should relationship, i.e, that each vm should run on different hosts when possible. 

When we upgraded, it became a must rule.  Is there an easy way to replicate the should rule easitly.

1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

MohamadAlhoussein​ I covered this earlier and this is not what OP is after. A VM-VM anti-affinity rule is a "must" or "hard" rule. OP was wondering if there is a "soft" rule which doesn't involve explicit VM-to-host rule definitions which the answer is "no" at this time.

vSphere HA is not aware of those rules, so it will ignore them completely in case of HA events. If a host fails, a VM will restart on an available host even if it contains the other VM from the 4 VMs selected above.

That's not true any longer. DRS rules will apply by default and be respected in an HA failover event. In vSphere 6.0, there was a portion of the Flex client that allowed you to specify whether you wanted this behavior. In 6.5, that option is no longer present because the rules are respected by default. If you wish for them *not* to be respected, you must set one of two advanced options on your cluster: das.respectVmVmAntiAffinityRules or das.respectVmHostSoftAffinityRules.

View solution in original post

10 Replies
daphnissov
Immortal
Immortal
Jump to solution

The option is already there.

pastedImage_0.png

marvinb
Enthusiast
Enthusiast
Jump to solution

I was hoping for a more efficient method.

I have to create a vm group with a single vm for each of the 4 vms.

I have to crate a host group with a single host for each of the 4 hosts.

Then I have to create this rule for each vm/host pair.

All so I can get 4 vms to run on different hosts most of the time.

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

Then you can use a VM-VM anti-affinity rule to keep each VM separate. With 4 VMs and 4 hosts, DRS will put one on each host.

0 Kudos
marvinb
Enthusiast
Enthusiast
Jump to solution

Unfortunately,  that is a must relationship.

The first probably comes closest to what I want.  I'm just now sure they took out the "should" relationship in the VM-VM rules.

0 Kudos
sjesse
Leadership
Leadership
Jump to solution

Pretty sure the "Should" part comes into play if you place the host in maintence mode, its the only time I've seen one move.

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

If you use VM-VM anti-affinity rules, it will prevent a host from entering maintenance mode. If you need a soft rule, you'll have to create VM-to-Host groupings.

MohamadAlhousse
Enthusiast
Enthusiast
Jump to solution

Hi marvinb

If I understand you well, What you are trying to  accomplish can be done with a simple MUST Anti-Affinity rule to keep the 4 VMs separated on the 4 hosts you have.

pastedImage_0.png

vSphere HA is not aware of those rules, so it will ignore them completely in case of HA events. If a host fails, a VM will restart on an available host even if it contains the other VM from the 4 VMs selected above.

This will save you from creating separate host group for each host and separate VM group for each VM and then creating 4 DRS rules with "SHOULD" relationship.

Please let me know if this fulfills your needs.

Regards,

Please consider marking this answer "correct" or "helpful" if you think your question have been answered correctly. Cheers, @vExpertConsult www.vexpertconsultancy.com VCIX-DCV 2018 | VCIX-NV 2019 | VCAP7-CMA Design | vSAN Specialist | vExpert ** | vExpert NSX | vExpert vSAN
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

MohamadAlhoussein​ I covered this earlier and this is not what OP is after. A VM-VM anti-affinity rule is a "must" or "hard" rule. OP was wondering if there is a "soft" rule which doesn't involve explicit VM-to-host rule definitions which the answer is "no" at this time.

vSphere HA is not aware of those rules, so it will ignore them completely in case of HA events. If a host fails, a VM will restart on an available host even if it contains the other VM from the 4 VMs selected above.

That's not true any longer. DRS rules will apply by default and be respected in an HA failover event. In vSphere 6.0, there was a portion of the Flex client that allowed you to specify whether you wanted this behavior. In 6.5, that option is no longer present because the rules are respected by default. If you wish for them *not* to be respected, you must set one of two advanced options on your cluster: das.respectVmVmAntiAffinityRules or das.respectVmHostSoftAffinityRules.

MohamadAlhousse
Enthusiast
Enthusiast
Jump to solution

Thanks daphnissov​ for the clarification.

Please consider marking this answer "correct" or "helpful" if you think your question have been answered correctly. Cheers, @vExpertConsult www.vexpertconsultancy.com VCIX-DCV 2018 | VCIX-NV 2019 | VCAP7-CMA Design | vSAN Specialist | vExpert ** | vExpert NSX | vExpert vSAN
0 Kudos
marvinb
Enthusiast
Enthusiast
Jump to solution

It appears that I will have to create a set of vm-host rules with preferential settings to get what I want.

I appreciate the input.

0 Kudos