I've received a request to add disaffinity/anti-affinity rules on a set of virtual machines in a VMware HA/DRS cluster running VMware vSphere 4.1.

The client has four hosts and wants to keep certain virtual machines from running on the same host in the event of a host failure.

Normally, this type of request is straightforward, where you can simply avoid running app01 and app02 on the same machine... There's an separate application load balancer upstream.

However, this request asks for app01, app02, app03, app04, app05 and app06 to run on different hosts.

Six VM's, four hosts. Our first-response team added app01-app06 into a single "Separate Virtual Machines" DRS rule. This does not seem right because the results could be unpredictable in a maintenance mode or Upgrade Manager remediation.

Something like: enter image description here

What is the impact of doing so with four hosts? Will this achieve the desired goal? Downsides?

  • 1
    You have 6 virtual machines, none of which can run on the same host as another. You have 4 hosts. I don't see how this is possible.
    – joeqwerty
    Jan 15, 2013 at 13:37
  • Right, so what will actually happen? I can't think that this would give a desired outcome.
    – ewwhite
    Jan 15, 2013 at 13:41
  • 2
    I believe it will start app01-04 and will give you an error for 05-06 stating they cannot be powered on due to resources. Jan 15, 2013 at 13:43

1 Answer 1


If the 6 VMs are already powered on, then DRS will try to separate them as much as it can. Then it will display a DRS fault that it couldn't fix an anti-affinity rule violation, but will not power any of them off:

enter image description here

If 4 of the 6 are on and running on different hosts, and you try to power on one of the remaining 2, the DRS rule will refuse to power it on and give you this error:

enter image description here

The obvious downside is you won't have all 6 running. It is conceivable that if you had them running before the rule was created then they would stay running, but it is pretty much inevitable that they will be powered off at some point eventually for some reason or another and not able to start up again due to the rule. According to the capture they are off so they wouldn't be able to power all 6 on (actually there are 8 in the rule in the capture so 4 that would remain off).

An alternative solution (untested) would allow all of the VMs to be powered on, but you would still have at least 2 VMs running on 2 of the hosts, not meeting the client's impossible need given the resources:

You could create 2 "Separate VMs" DRS rules putting VMs 1-4 in one and 5-6 in another. This would allow all 6 to be powered on, but losing or powering down a host for maintenance would also mean you could run 5 VMs max, which is still better than the 4 you could run in the original solution even with all hosts operational.

  • Nice job August including example pics +1
    – TheCleaner
    Jan 15, 2013 at 14:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .