VMware Cloud Community
ashxos
Contributor
Contributor
Jump to solution

Virtual CPU Fundamentals

Dear All,

Can any one share the fundamentals of the Virtual CPU & its Architechure?

We want to know, which CPUs will get accessed by each Virtual Machine in below case:

Case 1 :

Physical Server : 2 CPU (6 Cores)

Virtual Machines : Total 3 Nos

CPU Case.jpg

Case 2 :

Physical Server : 4 CPU (6 Cores)

Virtual Machines : Total 3 Nos

Case2.jpg

.::[ashX]::.

.::[ashX]::.
Reply
0 Kudos
1 Solution

Accepted Solutions
rickardnobel
Champion
Champion
Jump to solution

anjalis wrote:

As per the discussion, Can I conclude that 1 core= 1 vCPU?

And if yes, please give me the documentation regarding this .

FYI- Hyper V is statingthat the capacity planning guideline is 8 vCPU per CPU Core.

No, there is not really a direct relation with 1 core = vCPU, in the case that you "bind" one core to one vCPU. Many VMs could use the same core, just not the same millisecond.

Let use say you only have one physical CPU with only 1 core, you can still have 2 VMs with one vCPU each. Or 4 VMs or 16 VM or any other number. Depending on the Guest operating system need for CPU, the VMkernel will switch the access between the vCPUs for time at the physical Core.

My VMware blog: www.rickardnobel.se

View solution in original post

Reply
0 Kudos
10 Replies
rickardnobel
Champion
Champion
Jump to solution

Ashish wrote:

We want to know, which CPUs will get accessed by each Virtual Machine in below case:

The answer is that you can not know in advance. Depending on the total load the Vmkernel CPU Scheduler will place your Virtual Machine vCPUs on the physical CPU cores that are most suitable at the moment.

This could change anytime, i.e. a vCPU could at the next moment be scheduled at some other physical core.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
ashxos
Contributor
Contributor
Jump to solution

You mean to say, If i am assigning 4 vCPU to Virtual Machine, processing can happen on All Physical Cores Present in the ESX Server.

Is it right?

If yes then, why we are restricting the Virtual Machine with Number of CPUs, when it is going to use all CPU cores as required?

.::[ashX]::.
Reply
0 Kudos
rickardnobel
Champion
Champion
Jump to solution

Ashish wrote:

You mean to say, If i am assigning 4 vCPU to Virtual Machine, processing can happen on All Physical Cores Present in the ESX Server.

Is it right?

Yes, that is correct. Your 4 vCPUs could execute code on all physical cores in the ESX/ESXi, but only at 4 at the time.

Ashish wrote:

If yes then, why we are restricting the Virtual Machine with Number of CPUs, when it is going to use all CPU cores as required?

That is your choise how you want to share the physical cores among the VMs. Since a single vCPU can only execute on one core, all other cores are free for the ESXi to assign to other VMs. If you give all your VMs to many vCPU will make the job of VMkernel harder to find free cores when switching between the VMs.

Just like a ordinary operating systems multitasks the normal processes by switching them in and out of processor time, the VMkernel "multitasks" the VMs vCPUs.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
anjalis
Contributor
Contributor
Jump to solution

Hi Ricnob,

As per the discussion, Can I conclude that 1 core= 1 vCPU?

And if yes, please give me the documentation regarding this .

FYI- Hyper V is statingthat the capacity planning guideline is 8 vCPU per CPU Core.

i.e, One CPU (dual core) = 2 Cores     x8 = 16 virtual CPUs.

16 vCPUs / 4 vCPU per VM = 4 VMs

16 vCPUs / 2 vCPU per VM = 8 VMs

16 vCPUs / 1 vCPU pre VM = 16 VMs

Please clear our confusion.

Reply
0 Kudos
ashxos
Contributor
Contributor
Jump to solution

Hi ricnob,

Is  is right that the Virtual Machine having 4 vCPUs can access 2 Cores  from One Physical CPU and another 2 from Other Physical CPU  simulteneously.

It will be better if you can share any Technical Document for the same.

.::[ashX]::.

.::[ashX]::.
Reply
0 Kudos
rickardnobel
Champion
Champion
Jump to solution

anjalis wrote:

As per the discussion, Can I conclude that 1 core= 1 vCPU?

And if yes, please give me the documentation regarding this .

FYI- Hyper V is statingthat the capacity planning guideline is 8 vCPU per CPU Core.

No, there is not really a direct relation with 1 core = vCPU, in the case that you "bind" one core to one vCPU. Many VMs could use the same core, just not the same millisecond.

Let use say you only have one physical CPU with only 1 core, you can still have 2 VMs with one vCPU each. Or 4 VMs or 16 VM or any other number. Depending on the Guest operating system need for CPU, the VMkernel will switch the access between the vCPUs for time at the physical Core.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
rickardnobel
Champion
Champion
Jump to solution

Ashish wrote:

Is  is right that the Virtual Machine having 4 vCPUs can access 2 Cores  from One Physical CPU and another 2 from Other Physical CPU  simulteneously.

Yes, that is correct. The vCPUs for a single VM could be scheduled at different physical CPUs, however if your hardware has NUMA support the Vmkernel will try to keep them together for better RAM access performance.

Here is a technical whitepaper on the VMware CPU Scheduler: http://www.vmware.com/files/pdf/techpaper/VMW_vSphere41_cpu_schedule_ESX.pdf

My VMware blog: www.rickardnobel.se
ashxos
Contributor
Contributor
Jump to solution

What about ESX 4.0? Does VMW_vSphere41_cpu_schedule_ESX.pdf document applicable to ESX 4.0?

.::[ashX]::.
Reply
0 Kudos
rickardnobel
Champion
Champion
Jump to solution

To most part they are the same, but here is the 4.0 version:

http://www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf

My VMware blog: www.rickardnobel.se
ashxos
Contributor
Contributor
Jump to solution

Thank you very much for clearing the concept...

.::[ashX]::.

.::[ashX]::.
Reply
0 Kudos