Affinity/Anti-Affinity for Hosts in Maint Mode | Nutanix Community
Skip to main content

I would like to apply Host-VM affinity/anti-affinity rules. Some of these referenced hosts are currently in maintenance mode.

Am I able to apply these rules while the hosts are in maint mode? 

If not, am I correct in thinking that once the hosts are taken out of maint mode, then I can apply the affinity rules, and the system will apply these rules (migrating VMs etc. where it needs to)?

I've never tried creating a rule with hosts in maintenance mode. I can't see why it wouldn't work unless it does a check for host/cluster health at the time of invocation. VM/VM anti/affinity I suspect would be more like to work as you wouldn't be worrying about a host specifically - Affinity Policies

VM/host however being a 'must' rule may cause problems if it cannot enforce it on a host. (Not recommended generally from the doc above but some exceptions apply I'm sure). I can test this out either way on a dev cluster on Monday if you like or please do let me know how it goes if you do it first :)


Hi @Kcmount really appreciate the response and the link. Would be great if you could test in a dev environment as I only have access to a Prod environment.


No worries I'll fire up a cluster to test.


Just tested it. You can’t set a affinity rule on a guest machine when the host (where the guest vm should run) is in maintenance. It will give an error. For the anti-affinity rules it doesnt make any sense. As anti-affinity is just that a group of guest vm's should not run on the same host. 


Haha, beat me to it 🙂 Good to know re maint mode - it does make sense of course being a ‘must’. Agree, the anti-affinity is what we use to keep app cluster members away from each other 😀


thank you @Kcmount and @JeroenTielen for confirming, much appreciated.