Powering on virtual machines fails with the error: MAX VCPUs limit is reached
search cancel

Powering on virtual machines fails with the error: MAX VCPUs limit is reached

book

Article ID: 310436

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction




Symptoms:
  • Powering on virtual machines fails
  • When trying to power on a virtual machine, you see the error:

Failed to power on VM
Could not power on VM : Number of running VCPUs limit exceeded.
Max VCPUs limit reached: 200 (4096 worlds)



Environment

VMware ESX 4.1.x
VMware ESXi 4.1.x Installable
VMware vSphere ESXi 5.1
VMware ESXi 4.1.x Embedded
VMware vSphere ESXi 5.0

Resolution

vSphere 4.1 and vSphere 5.x have an algorithm that dynamically calculates the number of recommended vCPUs on a given host depending on the resources available. This prevents over-committing of resources.
Caution: ESX and ESXi 4.1 allow a maximum of 512 vCPUs and 320 virtual machines per host. In ESXi 5.x, this number was increased to 4096 vCPUs and 512 virtual machines per host. Modifying these values above the limit is unsupported and can lead to host crashing.

Increasing the MAXvCPU count using the vSphere CLI

Run this command to see the maximum number of vCPUs that are allowed:

# esxcfg-advcfg -j maxvCPUs
The output looks similar to:
# esxcfg-advcfg -j maxvCPUs
maxvCPUs = number_of_VCPUs

To increase the maximum number of vCPUs to 512, run the command:

# esxcfg-advcfg -k 512 maxvCPUs

If you rerun # esxcfg-advcfg -j maxvCPUs, the output appears similar to:

# esxcfg-advcfg -j maxvCPUs
maxvCPUs = 512

Increasing the MAXvCPU count using the vSphere Client

To increase the maximum number of vCPUs to 512:
  1. Launch the vSphere Client.
  2. Click the host.
  3. Click the Configuration tab, then go to Advanced Settings.
  4. Go to Vmkernel > Boot > maxVCPUS.
  5. Modify the parameter to 512.
Note: For ESXi 5.x, the steps to adjusting the maximum number of vCPUs have changed.

To show the current value for maximum vCPUs allowed per core:
  1. Connect to the ESXi host with an SSH session.
  2. Run the following command:

    esxcli system settings kernel list -o maxVCPUsPerCore

To set a new configured value for maximum vCPUs allowed per core:

  1. To determine the number of vCPUs per core, take your maximum number of desired cores, divide by the number of physical cores on the host . Then round up to the nearest whole integer. Then set the per-core vCPU parameter.

    For example, you want a maximum of 450 vCPUs and have 12 physical cores in the ESXi host. 450 / 12 = 37.5 rounded to 38. Your maximum vCPUs per core should be 38.

  2. To set the new maximum vCPUs per core parameter, run the following command:

    esxcli system settings kernel set -s maxVCPUsPerCore -v yourMaxPerCore

    Where yourMaxPerCore is the number determined in Step 1.

  3. Reboot the ESXi host and check the parameter using this command:

    esxcli system settings kernel list -o maxVCPUsPerCore