On twitter Mike Laverick asked a question around DRS Affinity Rules and if HA would respect these. In this particular instance the question was around VM-Host affinity rules and I noticed multiple tweeps responding and figured it would not hurt to repeat this.
There are two different types of VM-Host affinity rules:
- Must aka mandatory
- Should aka preferential
The difference between these two with regards to HA is that HA will always respect a must rule. These are mandatory, even if that results in downtime for the VM. The should rule is also known as the preferential rule. In others words it would be nice if this rule can be respected, but if it can’t… no harm.
How does HA know which VM belongs to which host with regards to DRS rules? Well that is fairly straight forward. HA keeps track of which VM is compatible with which hosts. This “VM to Host compatibility list” is used for portgroups and datastores but also for DRS rules. Check the screenshot below for a hint…
Please note, this is a very old article about HA, there are tons of new articles on this topic. Just do a search on my blog, or download my ebook freely available via Rubrik.
Cool. Just to contextualize this a little more. The question came up in the context a virtualized vCenter, running on top of a cluster that its managing.
A popular complaint is if the ESX host dies on top of which was a virtualized vCenter – “I can’t find my VC” (Erm, powerCLI?) but if we can limit the VC to failing over smaller number of hosts (not the entire cluster) folks will play less “hunt” the vCenter…
Regard
Mike
True true … Or just store the VM on local storage and disable DRS for it :p
Man I hope we can download vSphere 5 soon – I keep reading all the nice nuggets here on YB not being able to actually implement any of it .. Wished vmware would stop paper relases 🙁
Found your note useful and as a newbie to VMware I wanted to go one step back and find out what it is and where to use it. This helped http://www.petri.co.il/host-drs-affinity-rules-vsphere-4-1.htm
Mike – check this thread – it deals with your question
http://communities.vmware.com/message/1793895#1793895
Getting “Unauthorized” error when trying to view the link
Sorry Mike – I thought you had access to the RCbeta. Here is a snippit: Thanks Craig. My thought process was I always want to know where vCenter and or AD is running. I setup DRS Host groups to accomplish this. I actually never noticed the option of “should” verses “must”. Switching to “should” accomplished my goal. Now when a HA event occurs the AD server restarts on the other host and when the affected host recovers AD gets automatically moved back. This also helps with patching a host as well. Before with “must” I could not vMotion the VM to the other box. With “should” it works as I originally intended.
Thanks for pointing out the “should” option!
Tom Miller
I wish …being solution partner doesn’t seem be enough to be ‘allowed’ into the beta 🙂 Thanks Tom, much appreciated.
No Thanks needed. Your website is at the top of my RSS feeds. Your work on SRM is out of this world. When can we expect SRM5? I see the roughcut.
I think you think about the wrong Mike here – I have nothing to do
with SRM 🙂
Host Affinity rule has got a bug.
Under new rule of DRS comes with vsphere 4.1
VM to host.
I can create rule with same Cluster VM group and Cluster host group, with different affinity rule like but no conflict occurs, So which rule will get effective.
Must Run -Required.
should RUN -preferential.
must not run -Required.
should run Preferential.
This seems not trust wroth..
But with case of DRS rules like
Keep virtual machine together
seperate virtual machine together
DRS automatically disables the second rule.
Thanks in Advance for your answers..