VMware Cloud Community
crb2
Contributor
Contributor

DRS Rules for keeping 2 VMs separate until only one server remains in cluster?

I have a 3-server cluster, with 2 VMs that have their own application-level failover capabilities.  I'd like them to always remain separate unless 2 servers in the cluster fail, in which case they should both run on the single remaining server. 

I cannot seem to configure DRS rules to achieve this, no matter what permutation I try.  Setting a "keep these VMs separate" rule means it cannot be violated if we end up with just one server left in the cluster-the 2nd VM will not migrate or start there.  I tried setting two sets of "should" rules, saying VM A *should* run on Server 1 and *should not* run on Server 2, and VM B *should* run on Server 2 and *should not* run on Server 1.  The thought was that this would put them on Servers 1 and 2 under normal operation, but upon losing one of those servers, push that VM to Server 3.  Instead, the VM seems to randomly end up on the server included in the relevant "should not" rule, violating it.  I can manually migrate it to Server 3 after that, but that defeats the point.

It basically seems like I need a "should remain separate" rule, but that doesn't exist.  Am I crazy?  Is there no way to do what I want?  Thank you all!

Reply
0 Kudos
1 Reply
depping
Leadership
Leadership

That doesn't exist in terms of rules. What you can do is allow vSphere HA to violate the rules:

das.respectvmvmantiaffinityrules = false

This way the VMs will at least be restarted when there's only 1 host left. And now you simply create an "anti-affinity" rule for the two VMs.