How to separate Hyper-V virtual machines using anti-affinity

Sometimes you do not want to have two virtual machines running on the same Hyper-v host. For example when those two VM’s offer some sort of redundancy, like domain controllers. If case both DC’s run on the same host, and if you have only two DC’s in the domain, failure of the Hyper-V host will result in lose of the domain.

Fortunately when Hyper-V host are part of a fail-over cluster anti-affinity rules can be created. Not as easy as using the GUI in vCenter, but using a tool on the command line.

To separate your virtual machines called DC1 and DC1 , use the command below.

  • cluster group “dc1” /prop AntiAffinityClassNames=”domaincontrollers”
  • cluster group “dc2” /prop AntiAffinityClassNames=”domaincontrollers”

You can later view which AntiAffinityClassName you’ve assigned a virtual machine by looking at its cluster group properties:

  • cluster group “dc1” /prop

More info here http://support.microsoft.com/kb/296799

Taken from: http://www.windowsitpro.com/blogs/VirtualizationProTips/tabid/2246/entryid/12803/Default.aspx

Advertisements

About Marcel van den Berg
I am a technical consultant with a strong focus on server virtualization, desktop virtualization, cloud computing and business continuity/disaster recovery.

One Response to How to separate Hyper-V virtual machines using anti-affinity

  1. Pingback: Hyper-V R2 best practises and tips « UP2V

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: