On the VMware Community Forums someone asked today if CPU Affinity and vSphere HA worked in conjunction and if it was supported. To be fair I never tested this scenario, but I was certain it was supported and would work… Never hurts to validate though before you answer a question like that. I connected to my lab and disabled a VM for DRS so I could enable CPU affinity. I pinned the CPUs down to core 0 and 1 as shown in the screenshot below:
After pinning the vCPUs to a set of logical CPUs I powered on the VM. The result was, as expected, a “Protected” virtual machine as shown in the screenshot below.
But would it get restarted if anything happened to the host? Yes it would, and I tested this of course. I switched the server off which was running this virtual machine and within a minute vSphere HA restarted the virtual machine on one of the other hosts in the cluster. So there you have it, CPU Affinity and vSphere HA work fine.
PS: Would I ever recommend using CPU Affinity? No I would not!
Fred Peterson says
What if you have a core count descrepancy in your hosts? So you set an affinity of lets say core 8 and 9 because they’re hex cores, but the other host is only quad? You don’t have a core 8 and 9.
Kulikov Nickolay says
From vSphere Resource Management (http://pubs.vmware.com/vsphere-51/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-51-resource-management-guide.pdf)
When you move a virtual machine from one host to another, affinity might no longer apply because the
new host might have a different number of processors.