anthonypoh
Enthusiast
Enthusiast

VM-Host Affinity Rules

I have a question (or more of a chain of thought) which has been bugging me for sometime and because my demo environment is down I've not had time to rebuild and test it out...... so I thought I'd run it past the people on the community as I always find that there's someone out in the wide world who's already solved this problem.... Smiley Happy

I am aware that VM-Host affinity rules specifies a relationship between a group of VMs and a group of hosts and that there are 2 types of rule preferences, Must run/not run and Should run/not run.

I've no problems about doing simple rules (ie Prod_VM must run on Prod_hosts).... however, my recent chain of thought was whether you could have 2 rules which are not contradicting running at the same time (I'm aware that if rules contradict, the older will take precedence).

For example:

If I have 2 server rooms with a VMware stretched cluster between the two rooms with some sort of stretched storage (ie HP Lefthand), what I want to do is have a group of VMs run in Room A and a group of VMs run in Room B, but if either room fails then the VMs will be restarted in the remaining room.

What I don't want is for DRS to move VMs from A to B and vice-versa.....

I want to specifically tie a group of VMs to the hosts in Room A and only failover to the hosts in Room B if Room A goes up in smoke......

Will this be possible by creating 2 VM-Host affinity rules?

Room_A VM group will consist of VM_1, VM_2, VM_3, VM_4

Datacenter host group will consist of Host_1, Host_2, Host_3, Host_4

Host_A host group will consist of Host_1 and Host_2 (the other 2 reside in room B)

If I set a rule that says:

Room_A must run on Datacenter - then this should mean all VMs from Room_A should run across all hosts in Room_A and B

Room_A should run on Host_A - this should mean that all VMs from Room_A should 'ideally' run on just the hosts in Host_A

Will this work....... Or am I just over-thinking and confusing myself with regards to affinity rules, and actually would only require 1 rule that says Room_A must run on Host_A because HA is across the cluster and doesn't care about affinity rules so would failover VMs if Room A went down anyways.......? :smileyconfused:

Regards..... :smileygrin:

http://thevirtualunknown.co.uk/
0 Kudos
4 Replies
JimKnopf99
Commander
Commander

Hi,

that depends on what you wan´t.

You would like to point vm´s to a specific host´s?

Create a Host DRS Group entry and a VM Group entry.

Now you could create a rule for thees groups (rules.jpg)

In case of a Host isolation, the DRS rules have no impact. The vm´s will restart on the other host.

If you only wan´t to use one group, because you only need a rule to run vm´s on one or more hosts, only create one Group for host and one for vm.

Frank

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
anthonypoh
Enthusiast
Enthusiast

So basically if I had servers in 2 separate room but in the same HA cluster, I want to tie a group of VMs onto the hosts only in 1 room (so that DRS doesn't move VMs between rooms). However, in the case of losing one room, HA will failover the VMs to the other......

After reading around the subject all last night (with copious amounts of coffee) I think the only rule I would need is:

Room_A should run on hosts in group Host_A

This means that all the VMs in group Room_A should preferably run on the hosts in group Host_A, however the rule can be violated to allow the proper functioning of HA.

(I believe chosing "Must run" means that HA would never take any action that will violate the rule......)

Really need to get my test lab back up and running...... >_<"

http://thevirtualunknown.co.uk/
0 Kudos
JimKnopf99
Commander
Commander

You are right!

Frank

Am 30.08.2012 um 11:08 schrieb anthonypoh <communities-emailer@vmware.com<mailto:communities-emailer@vmware.com>>:

VMware Communities<http://communities.vmware.com/index.jspa>

VM-Host Affinity Rules

reply from anthonypoh<http://communities.vmware.com/people/anthonypoh> in Availability: HA & FT - View the full discussion<http://communities.vmware.com/message/2106738#2106738

If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
admin
Immortal
Immortal

HA does not currently try to respect "should run" affinity rules. So if only 1 host in room A fails (as opposed to the whole room), HA might failover its vms to a host in room B even if there are other available hosts in room A.

Elisha

0 Kudos