Last week I received a very strange customer inquiry in which they would like to limit the number of physical CPU sockets seen by ESXi. As you can imagine, my interest was piqued as this is usually not the type of request you hear from customers looking to actively reduce the overall computing power of their underlying hardware, especially if they have paid for it. After digging into the details a bit more, it turns out this is related to licensing.

The customer is running an application on a VM which is licensed by the total number of underlying physical CPU sockets of the server, regardless if they are actively being used by the application or not. The vendor shall be left nameless but I am sure some of you can make some educated guesses 🙂 The customer was in the process of performing a hardware refresh where they would be moving from a 4 socket CPU to an 8 socket CPU and they would be negatively impacted by this change from a licensing standpoint. I can understand their concerns, they have now just doubled their application licensing cost without actually benefiting from the actual hardware update.

Luckily, because the customer is running vSphere ESXi, there is a neat little capability that may not be that well know which allows you to actually limit the number of physical CPUs seen by ESXi. This capability is exposed as an ESXi Advanced Setting called VMkernel.Boot.maxPCPUS and by default, this is set to unlimited as you would expect. You can change this setting using a variety of methods including the vSphere Web Client, vSphere C# Client, ESXi Embedded Host Client, vSphere API which includes ESXCLI & PowerCLI. Here is a great example in which you can actually save money by running vSphere in addition to all the other benefits 😀

Using the customer example, if I have a server that has 8 physical CPUs and I want to change that to 4 physical CPUs, then I just need to adjust the value to 4. Once you have made the change, you will need to reboot the ESXi host for the changes to go into effect and when you login to the ESXi host, you will see that the number of physical CPUs have now been reduced and no longer visible to ESXi. Another option which I have seen some postings online about which is the ability to turn off specific CPUs for certain hardware platforms using the system BIOs, having said that, I have not actually seen any real confirmation that this is in fact possible.

Note: There is no way to limit the specific number of cores on a physical CPU socket other than disabling Hyperthreading from system BIOs.

Below are screenshots using the vSphere C# & ESXi Embedded Host.


If you prefer to to use the CLI either locally or remotely, you can run the following ESXCLI commands:

List the current configurations

esxcli system settings kernel list -o maxPCPUS

Set a new configuration

esxcli system settings kernel list -s maxPCPUS -v 4


10 thoughts on “How to limit the number physical CPU sockets in ESXi?

  1. Let me guess. The licensing trouble starts with Ora and ends with Cle. I’d say if you ask them this, they will say using that parameter is not a valid approach to reduce the number of licensed CPUs. (Unless their own virtualization platform is used, in which case using a parameter like this would be no problem, of course.)

  2. Interesting, although the one company that I’ve had core count issues with would do a CPU ID and charge you based upon the number of cores associated with the CPU ID showed.

    Also, on most of the tier one systems in the server bios there’s a way to disable cores (All, X, … 8,6,4,2,1).

    • Gabe,

      I can’t comment on what would be considered support from a licensing perspective for other vendors. Ultimately, what is accepted in the license agreement is going to be between the customer and the vendor to agree upon.

  3. I don’t know why but in my environment it limits Logical Porcessor not physical one. I have 2 PCPUs, 14 core each. 56 logical processors. When I set VMkernel.Boot.maxPCPUS 1 it boots with: 1PCPU, 1 core, 1 logical. When I set it up to 28 than the host boots with: 2 PCPUs, 7 cores and 28 logical…

    • Yes, I’m getting the same behavior. The setting seems to be for logical processors and not physical.

  4. So they updated their hardware from 4 to 8 CPU but limit it to 4.
    Could you explain the value added of doing so?
    Thank you

  5. The title of this page is somewhat deceiving. In my testing on a DL360 G8 2 socket/8 core/32 logical proc server, it appears that the variable VMkernel.Boot.maxPCPUS controls logical cpus, not physical sockets. If the value is changed to 1, then you will end up with 1 socket and only 1 core & 1 logical proc. If you change the value to 2, you will then have 1 socket, 1 core, 2 logical procs. Change to value 4 and results are 2 sockets / 1 core and 4 logical. VMware licensing looks at the number of processor sockets. The ultimate goal here would be to limit the host to 1 socket / 8 core / 16 logical without physically pulling the second CPU. If this is possible, please chime in with the details. Thanks!!

Thanks for the comment!