VMware Cloud Community
neo_italy
Contributor
Contributor
Jump to solution

Anti affinity rules

Hi guys,

if i've let's say three hosts, host A, B and C and three VMs: Vm1,Vm2 n Vm3, and if a i set three antiaffinity rules

1st: separate Vm1 from Vm2

2nd:separate Vm1 from Vm3

3rd: separate Vm2 form Vm3

To respect these rules Drs will put the three Vms on three different hosts. The question is what could happen if one of the host fail, the Vm on this host will be restarted on another host despite the antiaffintty rule or the Vm will remain powered off?

Many Thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

HA did ignore the rule and the vm was restarted successfully with a vm it had an anti-affinity rule.

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

Reply
0 Kudos
7 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

if you have a VM pinned to a specific host and an HA failure occurs that VM will be affected, so yes it will stay off.

Reply
0 Kudos
ctfoster
Expert
Expert
Jump to solution

It will stayed powered off. This has some interesting consequences when you come to place the host in maintenance mode.

http://communities.vmware.com/thread/71101;jsessionid=7119A4BEC586C1BAAF954C1D97CFE56D?tstart=0

Reply
0 Kudos
ac57846
Hot Shot
Hot Shot
Jump to solution

I have to disagree with the other two posters.

HA neither knows nor cares about DRS's rules. Ha will start up the VM's from the failed hosts on surviving hosts of it's own choice.

If HA starts a VM up on a host alonside a VM with which the new VM has an anti-affinity rule then the next time DRS make recommendations it will make a 5 star recommendation to migrate one of the VMs to another host.

Keep in mind that HA happens in the surviving ESX server's service console, recovery from an ESX server failure does not require or involve Virtual Centre. DRS is managed by the VC server and makes recommendations periodically, a fully automatic DRS cluster then impliments it's own recommendations.

Al.

Ken_Cline
Champion
Champion
Jump to solution

Read this whitepaper for a pretty good description of how HA works in conjunction with DRS.

Ken Cline

Technical Director, Virtualization

Wells Landers

VMware Communities User Moderator

Ken Cline VMware vExpert 2009 VMware Communities User Moderator Blogging at: http://KensVirtualReality.wordpress.com/
kjb007
Immortal
Immortal
Jump to solution

I think I will have to agree with Al before I can test this out later tonight. The white paper is good, and tells the ESX response for anti-affinity rules with DRS, but not when it is in conjunction with HA. I think as Al, that HA will allow the vm to restart, violating the anti-affinity rule, because that is it's primary purpose. While it uses DRS to decide which host is best-suited to run the vm it is trying to power on, ultimately, I believe it will restart on an existing host. I will try this out later, unless someone else has a chance to do it sooner.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
kjb007
Immortal
Immortal
Jump to solution

HA did ignore the rule and the vm was restarted successfully with a vm it had an anti-affinity rule.

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

Yes, I agree that is the case for a VM that was powered on when the HA event occured. But my understanding from the question the OP asked was if a VM is off, an affinity rule is present and an HA event occurs, will that VM be powered up on any of the remaining HOST servers. No, if an HA event occurs on a HOST that has powered of VM's, they will not power up on another host, the powered off VM's will remain on the failed host.

I could have read the thread incorrectly, but good research nonetheless.

Reply
0 Kudos