Using cpu affinity, Assign a virtual machine to a specific processor, Potential issues with cpu affinity – VMware vSphere vCenter Server 4.0 User Manual

Page 23

Advertising
background image

Using CPU Affinity

By specifying a CPU affinity setting 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 specified affinity set.
In this context, the term CPU refers to a logical processor on a hyperthreaded system, but refers to a core on a

non-hyperthreaded system.
The CPU affinity setting for a virtual machine applies not only to all of the virtual CPUs associated with the

virtual machine, but also 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, 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).

N

OTE

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.

Chapter 2 Managing CPU Resources

VMware, Inc.

23

Advertising
This manual is related to the following products: