Since vSphere 4.1 VMware supports Multicore Virtual CPU technology.
You may not only implement and assign how many vCPU per VM (up to 8 vCPU in entreprise plus, up to 4 vCPU for the others), but also you can define how many cores per vCPU that VM will have. This could be used to maximize the benefit of your VM running on 1 vCPU with for example 4 cores and still not paying more for an application which is licensed per socket (vCPU).
For example, If you did a P2V of a server which was originally running on a server with one processor socket, you now can assign to that VM more cores and still be fine with the licensing for your application. It means that you can for example have a VM which has One vCPU, so it uses One socket license with a configuration of 4 cores.
A CPUs (vCPU) in the VM appear to the operating system as single core CPUs. So for example if you if you create a virtual machine with 8 vCPUs (the maximum) the operating system sees 8 single core CPUs.
VMware multicore virtual CPU support lets you control the number of cores per virtual CPU in a virtual machine. This capability lets operating systems with socket restrictions use more of the host CPU's cores, which increases overall performance.
Some limitations: Only Hardware version 7 virtual machines support the multi-core vCPU feature.
Now to assign more cores to your VM folow those steps:
- Power off the virtual machine.
- Right-click on the virtual machine and click Edit Settings.
- Click Hardware and select CPUs.
- Choose the number of virtual processors.
- Click the Options tab.
- Click General, in the Advanced options section.
- Click Configuration Parameters.
- Include cpuid.coresPerSocket in the Name column.
- Enter a value (try 2, 4, or 8) in the Value column.
The value must be a power of 2 (like 2,4, or 8)…
Source: VMware KB Article: 1010184
vSphere Virtual Machine Administration Guide.
HERNAN says
From a performance point of view, what’s best? two vcpu to a virtual machine or 1 vcpu with two cores?
I have a server with a lot of spare cpu and I want to ‘boost’ a particular virtual machine
Vladan SEGET says
It depends. Is your vCPU struggles? 80-90% utilization?… If not, don’t change..
Alexandru says
I have the same question. What’s the difference between 1 vCPU with 2 cores vs. 2 vCPU. Yes, I understand from the article, that if I have a vCPU, I can add couple vCores, but is there any difference in the performance of 1 vCPU w/ 2 vCores vs. 2 vCPU w/ 1 vCore each?
Thanks.
Vladan SEGET says
Only assing 2 vCPU if the VM needs it, otherwise you’ll waste CPU cycles. Example: 5 VMs w/ 4vCPU and 10 VMs w/ 1 vCPU, you are giving the 5VMs w/ 4vCPUs the majority of CPU resources. So if you give your 1 vCPU VMs to wait longer for their computations (cpu cycle). It’s always a better to start with 1vCPU. For SQL and Exchange VMs too. If then, it shows 80-90% of the time 80-80% CPU utilization, then maybe change only… -:)
Tom says
Are you suggesting that if I have a 1-cpu VM and I increase it to 2 cores I can reduce cpu utilization?? I do have one VM struggling with 80-90% cpu utilization due to mediocre software installed upon it.
I have no special resource allocations except this one VM which I set to High for its cpu, does increasing cpu cores affect cpu availability to other VMs in any way??
Thank you, Tom
Vladan SEGET says
TOm: It depends, if the software you’re talking about can take advantage of hyperthreading.
Hernan: I return to your first question. It’s always better start with one vCPU and then, if the VM suffers, to go and put another vCPU.
If you have a VM with like 4 (or even 8 vCPU), then it’s like going to the restaurant with 7 of your friend and wanting to all of 8 of you sitting arount the same table…. It’s quite difficult to get place… so you’ll have to wait…….. And its the same for CPU cycles… Your VM will have to wait to get the CPU ressources…
Cheers.
Vladan
Skumar AB says
Hi, i have made the above changes as given above to one of VM running with win 2003 STD 32bit, but the vcpu is not changing, is there any thing need to be checked.