Overcommitting pCPUs on individual XenServer VMs

Overcommitting pCPUs on individual XenServer VMs

book

Article ID: CTX236977

calendar_today

Updated On:

Description

Citrix recommends that you do not run a VM with more virtual CPUs (vCPUs) than the number physical CPUs (pCPUs) available on the XenServer host.
The number of pCPUs available to XenServer can change even after the installation of VMs. For example, through actual hardware changes, changes in the BIOS setting, or other software configurations. VMs with vCPUs that cannot be matched to pCPUs may need to be adjusted in order to maintain stability.

XenServer previously allowed overcommitting vCPUs. However, this behavior is blocked as it can lead to undesirable effects when running a VM a vCPU that cannot be matched to a pCPU.
Running a VM with a vCPU that cannot be matched to a pCPU can cause a VM to fail to boot, and, in some cases, it can lead to a VM crash. You must pay attention to the number of physical CPUs available on the server and adjust the number of vCPUs of the affected VMs accordingly to maintain stability.

The following sections provide information to help you identify the number of pCPUs available on each server, determine the vCPUs assigned to each VM, and verify whether your systems are impacted by vCPU over commitment. In addition, this article also contains information on how to reduce the number of vCPUs to match the physical CPUs available, and has specific instructions to disable vCPU pinning.
 

Identify the number of physical CPUs on the server

You can use XenCenter or the xe CLI to identify the number of physical CPUs available on each server.

In XenCenter

  1. Select the server in the Resources pane.
  2. On the General tab of the server, click CPUs to see the number of pCPUs available on the server.

In the xe CLI
Run the following command to see the available pCPUs on the server.
xe host-cpu-info


Identify the number of vCPUs on each VM

In XenCenter

  1. Select the VM in the Resources pane.
  2. On the General tab of the VM, click Properties, and then CPU.
The CPU page displays the number of vCPUs assigned to the VM.
 

In the xe CLI

Run the following command:
xe vm-list params=uuid,name-label,VCPUs-max

This displays a list of all VMs running on the server. The 'VCPUs-max' parameter displays the number of virtual CPUs assigned to the VM.

 

Troubleshooting

When you attempt to start a VM with a vCPU that cannot be matched to a pCPU, you may get the following error message:

In XenCenter

This is a screenshot of the error generated in XenCenter when a user starts a VM associated with a vCPU cannot be matched to a pCPU

In the xe CLI

This is a screenshot of the error generated in the xe CLI when a user starts a VM associated with a vCPU cannot be matched to a pCPU
 

Reducing the vCPUs assigned to a VM

You can reduce the number of vCPUs assigned to the VMs using XenCenter or the xe CLI.

In XenCenter

  1. Select the VM in the Resources pane and on the General tab, click Properties.
  2. On the VM Properties dialog, click CPU.
  3. Select the number of vCPUs you would like to assign from the Number of vCPUs drop-down list.
  4. Click OK to confirm.

In the xe CLI

Run the following command and ensure the VCPUs-max value does not exceed the number of pCPUs available on the server.
xe vm-param-set uuid=<vm-UUID> VCPUs-max=<8>
 

Disabling the Overcommitment Protection

You can disable the overcommitment protection and start a VM with more vCPUs than pCPUs available. Run the following command on a per-VM basis to disable the overcommitment protection:

Warning: Running the following command may lead to undesirable effects as discussed in the previous sections.
xe vm-param-set uuid=<uuid> platform:vcpu-unrestricted=true


vCPU Pinning

If you are using vCPU pinning, ensure that you do not pin to pCPUs that do not exist on the server.

Run the following command to remove vCPU pinning:
xe vm-param-remove uuid=<uuid> param-name=VCPUs-params param-key=mask

Issue/Introduction

Citrix recommends that you do not run a VM with more virtual CPUs (vCPUs) than the number physical CPUs (pCPUs) available on the XenServer host. This article contains information on how to reduce the number of vCPUs to match the physical CPUs available and has instructions to disable vCPU pinning.

Additional Information

For more information about XenServer, see XenServer Documentation.