DRS Host Affinity rules

Share on:

One of the new features in vSphere 4.1 is the ability to configure Host affinity rules for DRS. These enable you to split your vSphere cluster in several groups of hosts and assign assign a subset of your VMs to one of these groups.

There are plenty of use cases for this:

  • Netapp Metrocluster

  • Applications licensed based on CPUs

  • performance sensitive applications

In my case the cluster is spread over 2 sites, one production site and a failover site. The failover site is used to run test & dev servers. Only in case of serious problems on the production site the VMs should be moved to the failover site.

Open the cluster settings and create a “Virtual Machines DRS Group”

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/100818screenshotevcclustersettings001_ver001_thumb.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/100818screenshotevcclustersettings001_ver001_thumb.png

Using Page Bundles: false

I create a group called FailoverSiteVMs which contains the test & dev servers.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/100818screenshoteditdrsgroup001_thumb.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/100818screenshoteditdrsgroup001_thumb.png

Using Page Bundles: false

A second group is called ProductionSiteVMs which contains the production virtual machines.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/image_thumb2.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/image_thumb2.png

Using Page Bundles: false

Now we need to create 2 “Hosts DRS Groups. One for the FailoverSite.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/image_thumb3.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/image_thumb3.png

Using Page Bundles: false

And another one for the Production site.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/100818screenshoteditdrsgroup004_thumb.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/100818screenshoteditdrsgroup004_thumb.png

Using Page Bundles: false

An overview of the configured groups

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/image_thumb4.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/image_thumb4.png

Using Page Bundles: false

Once all the groups are created you can start creating DRS rules. Select the “Virtual Machines to Hosts” as type, the Cluster Vms Group and the Cluster Hosts Groups.

There are 2 main types of DRS rules:

  • Should run on hosts in group
  • Must run on hosts in group

When the “Must run on hosts in group” type is used HA won’t violate the DRS rules and the VMs won’t be restarted on the failover hosts.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/100818screenshotrule001_thumb.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/100818screenshotrule001_thumb.png

Using Page Bundles: false

Once the rules are configured the rules dialog looks like this.

Image not found

Web path: http://k0v3.files.wordpress.com/2010/08/image_thumb5.png

Disk path: /static/http://k0v3.files.wordpress.com/2010/08/image_thumb5.png

Using Page Bundles: false