Thursday, May 10, 2012

Setting VM to Host Affinity

Due to some requirements, I am asked to make sure some virtual machines always stay on a particular host.  There are two clusters where I need to make such setup. 

The first cluster contains two ESXi 4.1 hosts and setting up VM to Host Affinity is really easy with the use of DRS Groups Manager.  Create a Virtual Machines DRS Group and a Hosts DRS Group to include all the virtual machines and hosts to be affiliated.  Then create a Virtual Machines to Hosts rule type to link the Virtual Machines DRS Group and Hosts DRS Group.

The second cluster contains two ESX 3.5 hosts and there is no DRS Groups Manager.  In order to achieve the same result, I need to do two things. First is to disable DRS for those virtual machines to be affiliated from the VMware DRS –> Virtual Machine Option of the cluster settings.  This only prevents automatic migrating of virtual machines but not manual migration.  To prevent someone from manually migrating the virtual machines, I need to set processor affinity for those virtual machines.  Virtual machine needs to be shutdown in order to set processor affinity.

CPU Affinity

After setting the processor affinity, I tried to vMotion the virtual machine manually and I got the following message.

Cannot vMotion due to CPU Affinity

This might not be the most ideal way and I am planning to upgrade all of them ESXi 5.0.  For the time being, this will be the workaround.

No comments: