After you create a VM, you can change its CPU settings. You can change the resource allocation, cores per socket, and CPUID Mask. You can also enable hardware virtualization and performance counters.

Prerequisites

Additional Prerequisites depend on the type of change that you want to make.

Table 1. Prerequisites for CPU Changes

Change

Prerequisite

CPU Hot Plug

Verify that the virtual machine is running and is configured as follows.

  • Latest version of VMware Tools installed.

  • Guest operating system that supports CPU hot plug.

  • Virtual machine compatibility is ESX/ESXi 4.x or later.

  • Virtual machine is turned off.

CPUID Mask

Turn off the virtual machine.

Hardware virtualization

  • Verify that the virtual machine compatibility is ESXi 5.1 and later.

  • Verify that Intel VT-x or AMD-V is enabled in the BIOS so that hardware assisted virtualization is possible.

Performance Counters

  • Verify that the virtual machine compatibility is ESXi 5.1 and later.

  • Verify that the virtual machine is turned off.

  • Verify that Intel VT-x or AMD-V is enabled in the BIOS so that hardware-assisted virtualization is possible.

Procedure

  1. In the vSphere Client, right-click the VM and choose Edit Settings.
  2. Select Virtual Hardware and open CPU.
  3. (Optional) If you want to make changes to CPU while the virtual machine is running, select Enable CPU Hot Add.
  4. Make changes to the following settings and click OK.

    Option

    Description

    Cores per Socket

    Number of cores per socket

    CPU Hot Plug

    By default, you cannot add CPU resources to a virtual machine when the virtual machine is turned on. The CPU hot plug option lets you add CPU resources to a running virtual machine.

    • For best results, use virtual machines that are compatible with ESXi 5.0 or later.

    • Hot-adding multicore virtual CPUs is supported only with virtual machines that are compatible with ESXi 5.0 or later.

    • Not all guest operating systems support CPU hot add. You can disable these settings if the guest is not supported.

    • To use the CPU hot plug feature with virtual machines that are compatible with ESXi 4.x and later, set the Number of cores per socket to 1.

    • Adding CPU resources to a running virtual machine with CPU hot plug enabled disconnects and reconnects all USB passthrough devices that are connected to that virtual machine.

    Reservation, Limit, Shares

    A virtual machine has the following user-defined settings that affect its CPU resource allocation.

    • Limit:Upper limit for this VM's CPU allocation. Select Unlimited to specify no upper limit.

    • Reservation: Guaranteed CPU allocation for this VM

    • Shares:CPU shares for this VM in relation to the parent's total. Sibling virtual machines share resources according to their relative share values, bounded by the reservation and limit. Select Low, Normal, or High, which specify share values in a 1:2:4 ratio. Select Custom to give each VM a specific number of shares, which express a proportional weight.

    See the vSphere Resource Management documentation for details.

    CPUID Mask

    You cannot change the default in a VMware Cloud on AWS environment.

    Hardware virtualization

    Select Expose hardware-assisted virtualization to guest OS to expose full CPU virtualization to the guest operating system so that applications that require hardware virtualization can run on virtual machines without binary translation or paravirtualization.

    Performance Counters

    Select Enable virtualized CPU performance counters to use performance tuning tools in the guest operating system for software profiling. You can identify and improve processor performance problems. This capability is useful for software developers who optimize or debug software that runs in the virtual machine.

    Note:

    If a virtual machine resides on an ESXi host in an EVC cluster, CPU counters are not supported for virtual machine creation or editing. You must disable CPU performance counters.

    For a list of virtualized Model-Specific Registers (MSRs), see the VMware knowledge base article at http://kb.vmware.com/kb/2030221

    CPU/MM Virtualization

    ESXi can determine whether a virtual machine needs hardware support for virtualization. ESXi makes this determination based on the processor type and the virtual machine. Overriding the automatic selection can provide better performance for some use cases.

    You can use software MMU when your virtual machine runs heavy workloads, such as Translation Lookaside Buffers (TLBs) intensive workloads that have significant impact on the overall system performance. However, software MMU has a higher overhead memory requirement than hardware MMU. So, to support software MMU, the maximum overhead supported for virtual machine limit in the VMkernel needs to be increased. You can configure your virtual machine with up to 128 CPUs if your virtual machine host has ESXi 6.0 and later compatibility (hardware version 11).

    Note:

    To take advantage of all features that virtual hardware version 13 provides, use the default hardware MMU setting.