Enable Multi-Core Processors in VMWare ESXi

So, you have a VM that you want to run on one Multi-Core Processor, but it can only run on one physical processor socket (think single-socket license, for example). In VMWare, a virtual processor maps to a single core, not a single cpu. However, the OS sees it as a single-core processor. If you add two virtual processors, you are actually adding two cores, or half of the processing power of a quad-core socket. Yet, the OS now sees them as two single-core Processors. If you are still reading, the problem here is obvious. So, what is a guy to do?

Turns out there is a solution.
Let me begin with a disclaimer. This is a technical solution to what may be a technical, or a legal problem. I am not your lawyer, and am not going to speak for you if Microsoft or Oracle, or some other vendor comes calling. In fact, please read the disclaimer in the column to the right, as well… I don’t see why a vendor should have a problem with this, but just the same, make sure what you are doing is OK. You have been forewarned. That said, here it is…

First of all, you have to be using Virtual Machine Version 7. If you are running an older version of VMWare (3.x) you cannot do this. Upgrade your cluster!

Edit your VM properties as follows. If you don’t know how to edit the VM, please stop reading now. Yes, just stop. Please take a class before you proceed…

  1. Change the number of CPUs assigned to the VM to the number of cores you want it to see. For 4 cores, for this example, select 4 as the “Number of virtual processors”.
  2. Under the “Options” tab select “General”. You will find it as a sub-option under the “Advanced” category. On the right, a button will be revealed labeled “Configuration Parameters”. Click it!
  3. Now click the “Add Row” button on the bottom-right corner of the window, and add the following:
    Name: cpuid.coresPerSocket
    Value: 2 for dual-core, 4 for quadcore, etc
    The number of processors you set earlier should be a multiple of this. Common sense says you don’t set them to 4 and 3. Or 3.5. I suppose you could set this field to 1, but then, why bother? For a single quad-core CPU in this example, I’ll use 4
  4. Ok
  5. Ok

That is pretty much it. Boot your shiny new multi-core VM.

Here is a shot of the setting you add…

Add this row

Here is what your VM OS sees now that you have set this property…

Notice: 1 Proc, 4 Cores...

For more info, see VMWare KB article: 1010184

If you are interested in the simple WMI VB script to display these properties, here it is too!

On Error Resume Next

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colComps = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

For Each objComp in colComps
WScript.Echo "NumberOfProcessors: " & objComp.NumberOfProcessors _
& vbcr & "LogicalProcessors: " & objComp.NumberOfLogicalProcessors _
& vbcr & "PCSystemType: " & objComp.PCSystemType

Set colProcs = objWMIService.ExecQuery("Select * from Win32_Processor")

For Each objProc in colProcs
Wscript.Echo "Architecture: " & objProc.Architecture _
& vbcr & "Caption: " & objProc.Caption _
& vbcr & "DeviceID: " & objProc.DeviceID _
& vbcr & "ProcessorType: " & objProc.ProcessorType _
& vbcr & "SocketDesignation: " & objProc.SocketDesignation _
& vbcr & "NumberOfCores: " & objProc.NumberOfCores

~ by Jay P Morgan on April 25, 2011.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s