A SERVICE OF

logo

In some cases, such as display-intensive workloads, significant communication might occur between the virtual
CPUs and these other virtual machine threads. Performance might degrade if the virtual machine's affinity
setting prevents these additional threads from being scheduled concurrently with the virtual machine's virtual
CPUs (for example, a uniprocessor virtual machine with affinity to a single CPU, or a two-way SMP virtual
machine with affinity to only two CPUs).
For the best performance, when you use manual affinity settings, VMware recommends that you include at
least one additional physical CPU in the affinity setting to allow at least one of the virtual machine's threads
to be scheduled at the same time as its virtual CPUs (for example, a uniprocessor virtual machine with affinity
to at least two CPUs or a two-way SMP virtual machine with affinity to at least three CPUs).
NOTE CPU affinity specifies virtual machine-to-processor placement constraints and is different from the
affinity based on DRS rules, which specifies virtual machine-to-virtual machine host placement constraints.
Assign a Virtual Machine to a Specific Processor
Using CPU affinity, you can assign a virtual machine to a specific processor. This allows you to restrict the
assignment of virtual machines to a specific available processor in multiprocessor systems.
Procedure
1 In the vSphere Client inventory panel, select a virtual machine and select Edit Settings.
2 Select the Resources tab and select Advanced CPU.
3 Click the Run on processor(s) button.
4 Select the processors on which you want the virtual machine to run and click OK.
Potential Issues with CPU Affinity
Before you use CPU affinity, you might need to consider certain issues.
Potential issues with CPU affinity include:
n
For multiprocessor systems, ESX/ESXi systems perform automatic load balancing. Avoid manual
specification of virtual machine affinity to improve the scheduler’s ability to balance load across
processors.
n
Affinity can interfere with the ESX/ESXi host’s ability to meet the reservation and shares specified for a
virtual machine.
n
Because CPU admission control does not consider affinity, a virtual machine with manual affinity settings
might not always receive its full reservation.
Virtual machines that do not have manual affinity settings are not adversely affected by virtual machines
with manual affinity settings.
n
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.
n
The NUMA scheduler might not be able to manage a virtual machine that is already assigned to certain
processors using affinity.
n
Affinity can affect an ESX/ESXi host's ability to schedule virtual machines on multicore or hyperthreaded
processors to take full advantage of resources shared on such processors.
Chapter 2 Managing CPU Resources
VMware, Inc. 21