VMware Cloud Community
Baoth
Enthusiast
Enthusiast
Jump to solution

Are there advanced settings for VM-VM Affinity Rules?

Hi everyone

First time post, but I have found the forums extremely useful in search engine results so thought I should get involved as much as I can.

Anyway, I have been posed a question regarding Affinity Rules, and I have not been able to find the answer anywhere, so I was hoping someone might be able to point me in the right direction please.

My client gave me a list of VM's that are "pairs" - by that I mean they both act the same, but one is live and the other is only used if the live VM cannot be reached. There is nothing clever powering that, like clustering or HA within the OS's though.

I was asked to ensure that the pair of VM's could not be powered by the same ESXi host, so following the VMware documentation I set up a VM-VM Affinity DRS Rule. I was asked to test it out, and in fairness, it works a treat. However, the outcome is not desired. Unfortunately, I can't give out too much info due to policies, but I'll try my best to explain the set up and issue.

The Rule stops the two VM's from being hosted on the same ESXi host

VM1 is the live server, VM2 is the backup server

Both of the above are in the relevant Rule

There are 8 hosts in the cluster

HA and DRS are enabled on the cluster

ESXi version 4.1

If I manually start a vMotion of VM2, sending it to the host that is currently hosting VM1, the following seems to occur: VM2 vMotion gets to 78% >> DRS Rules are assessed >> VM1 is vMotion'd to a new host >> VM2 vMotion completes when VM1 is off the host

However, I'm told that the client would prefer that the vMotion of VM2 either fails, or the vMotion process automatically sends it elsewhere, rather than invoking a vMotion of VM1.

I'm not entirely sure what happens in case of a real HA event, as I'm sure I read that HA does not consider DRS Rules? Is the above only happening because it's a manual vMotion? Or, is there a better method I have overlooked?

Thanks

Paul

0 Kudos
1 Solution

Accepted Solutions
TomHowarth
Leadership
Leadership
Jump to solution

unfortunately as you are using vSphere4.1 you are out of look regarding DRS checking on a HA event, this is a feature of 5.x

If you do a manual vMotion then you are effectively negating your DRS affinity rules, until such a time as it physically check the rule during migration.  this is as good as it gets.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410

View solution in original post

0 Kudos
6 Replies
TomHowarth
Leadership
Leadership
Jump to solution

unfortunately as you are using vSphere4.1 you are out of look regarding DRS checking on a HA event, this is a feature of 5.x

If you do a manual vMotion then you are effectively negating your DRS affinity rules, until such a time as it physically check the rule during migration.  this is as good as it gets.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
Baoth
Enthusiast
Enthusiast
Jump to solution

Hi

vSphere is 4.1.0, build 491557

vCenter Server is at 4.1.0, build 345043

Cheers

0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

Sorry was editing my response As I reread your post

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
Baoth
Enthusiast
Enthusiast
Jump to solution

Would adding a VM-Host Affinity Rule help at all?

Perhaps adding a rule that allows VM1 to only be hosted on hosts 1 through 4 and VM2 on hosts 5 through 8? My thought on that being that if you manually, or in a HA event for example, try and move VM2 to one of the first 4 ESXi hosts, it would fail, and in turn not invoke a vMotion of VM1.

That might be over complicating the whole thing though. I've sure the client wouldn't notice a vMotion on the "live" server too.

0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

that would just be over complicating things, the important thing is that the two machines should never be running on the same host.  the rules as they are prevent that.

if you need greater granularity then get your client to upgrade to 5.x where HA events interrogate DRS before starting up to conform that they comply with DRS rules.

currently the situation is that if a vMotion event attempts to move a guest in contravention of a DRS rule vMotion will move the other machine to another host before completing the move.

as a machine is not fully moved from machine A to machine B until vMotion is complete this satisfies the DRS Rule.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Baoth
Enthusiast
Enthusiast
Jump to solution

Cheers Tom.

Thanks for the help today.

Regards, Paul

0 Kudos