6.5.1

Table Of Contents
Using CPU Affinity
By specifying a CPU anity seing for each virtual machine, you can restrict the assignment of virtual
machines to a subset of the available processors in multiprocessor systems. By using this feature, you can
assign each virtual machine to processors in the specied anity set.
CPU anity species virtual machine-to-processor placement constraints and is dierent from the
relationship created by a VM-VM or VM-Host anity rule, which species virtual machine-to-virtual
machine host placement constraints.
In this context, the term CPU refers to a logical processor on a hyperthreaded system and refers to a core on
a non-hyperthreaded system.
The CPU anity seing for a virtual machine applies to all of the virtual CPUs associated with the virtual
machine and to all other threads (also known as worlds) associated with the virtual machine. Such virtual
machine threads perform processing required for emulating mouse, keyboard, screen, CD-ROM, and
miscellaneous legacy devices.
In some cases, such as display-intensive workloads, signicant communication might occur between the
virtual CPUs and these other virtual machine threads. Performance might degrade if the virtual machine's
anity seing prevents these additional threads from being scheduled concurrently with the virtual
machine's virtual CPUs. Examples of this include a uniprocessor virtual machine with anity to a single
CPU or a two-way SMP virtual machine with anity to only two CPUs.
For the best performance, when you use manual anity seings, VMware recommends that you include at
least one additional physical CPU in the anity seing to allow at least one of the virtual machine's threads
to be scheduled at the same time as its virtual CPUs. Examples of this include a uniprocessor virtual
machine with anity to at least two CPUs or a two-way SMP virtual machine with anity to at least three
CPUs.
Assign a Virtual Machine to a Specific Processor
Using CPU anity, you can assign a virtual machine to a specic processor. This allows you to restrict the
assignment of virtual machines to a specic available processor in multiprocessor systems.
Procedure
1 Find the virtual machine in the vSphere Web Client inventory.
a To nd a virtual machine, select a data center, folder, cluster, resource pool, or host.
b Click the Related Objects tab and click Virtual Machines.
2 Right-click the virtual machine and click Edit .
3 Under Virtual Hardware, expand CPU.
4 Under Scheduling Anity, select physical processor anity for the virtual machine.
Use '-' for ranges and ',' to separate values.
For example, "0, 2, 4-7" would indicate processors 0, 2, 4, 5, 6 and 7.
5 Select the processors where you want the virtual machine to run and click OK.
vSphere Resource Management
22 VMware, Inc.