How to Setup Number of Cores Per CPU in a VMware ESX Virtual Machine

By | October 22, 2010

 

I was checking the details of CPU assignments in VMware virtual machine. In my previous post I have mentioned the method to increase the CPU support in the operating system.

VMware virtual machines consider one CPU core as a processor. Virtual CPUs (vCPU) in VMware virtual machines appear to the operating system as single core CPUs. By increasing additional CPU count in virtual machine means that we are assigning more CPU cores to the virtual machines.

Let’s consider a scenario, suppose if we have physical machine that is having Windows Standard operating system with 4 CPU motherboard sockets and each CPU sockets is occupied with Quad core processors.

ie: 4 (CPUs) x 4 (cores) = 16 processors

Windows Standard Edition only supports 4 CPUs. When we convert this physical machine to a virtual machine, even if we have increased the vCPUs count to 16 from the vSphere option, Windows Standard Edition will only use the 4 vCPUs. Rest of the 12 vCPUs processors will not be used by the operating system.

For solving this we need to edit the .VMX file.

4 (CPUs) and 4 (cores)

This benefits the Windows Standard Edition to use 4 CPUs having 4 cores.

To implement this feature:

  1. Power off the virtual machine.
  2. Right-click on the virtual machine and click Edit Settings.
  3. Click Hardware and select CPUs.
  4. Choose the number of virtual processors.
  5. Click the Options tab.
  6. Click General, in the Advanced options section.
  7. Click Configuration Parameters.
  8. Include cpuid.coresPerSocket in the Name column.
  9. Enter a value (try 2, 4, or 8) in the Value column.
    Note: Ensure that cpuid.coresPerSocket is divisible by the number of vCPUs in the virtual machine. That is, when you divide cpuid.coresPerSocket by the number of vCPUs in the virtual machine, it must return an integer value. For example, if your virtual machine is created with 8 vCPUs, coresPerSocket can only be 1, 2, 4, or 8.
    The virtual machine now appears to the operating system as having multi-core CPUs with the number of cores per CPU given by the value that you provided in step 9.
  10. Click OK.
  11. Power on the virtual machine.

From the above scenario we have increased the vCPUs count to 16 and edited .VMX value cpuid.coresPerSocket = 4.

As per the calculation vCPUs/core = value should be an integer

ie; 16 vCPUs / 4 Core = 4 Quad core processors

The Windows Server Standard Edition now has 4 CPUs with 4 cores.

 

                                                                                                  -  Melbin Mathew

Melbin Mathew

I am Melbin Mathew, Systems Engineer from Kerala, India. I live with my parents, daughter and my wonderful wife. I graduated in 2004 with a bachelor’s degree in Electronics and Hardware from Mahatma Gandhi University, Kottayam and completed certification in MCITP, RHCE, CCNA, VCP ...Read More
Category: Virtualization

About Melbin Mathew

I am Melbin Mathew, Systems Engineer from Kerala, India. I live with my parents, daughter and my wonderful wife. I graduated in 2004 with a bachelor’s degree in Electronics and Hardware from Mahatma Gandhi University, Kottayam and completed certification in MCITP, RHCE, CCNA, VCP ...Read More