5oadmin
Contributor
Contributor

How does vcenter distribute CPU and in particular cores to the vms?

Jump to solution

Hi, so we have about 50 vms on 4 clustered hosts.

Each vms got 1 vcpu assigned to them. Today I had a developer tell me how terrible it was because it meant once the cpu is pegged at 100%, no one else could do anything on the machine.

This raised an interesting question: how does vmware manage the underlying host cpus, and in particular cores?

If I assign 2 cpu to a machine, does it map to the underlying physical cpus, or is it underlying host cores?

And finally, if I assigned 2 cpus to each vmachine, will I see performance degration accross the cluster compare to just assigning one?

Cheers!

0 Kudos
1 Solution

Accepted Solutions
TomHowarth
Leadership
Leadership

Hi, so we have about 50 vms on 4 clustered hosts.

Each vms got 1 vcpu assigned to them. Today I had a developer tell me how terrible it was because it meant once the cpu is pegged at 100%, no one else could do anything on the machine.

This would be the case with a physical machine if a CPU is pegged at 100% it is at 100% no different between Physical and Virtual I'am afraid.

This raised an interesting question: how does vmware manage the underlying host cpus, and in particular cores?

Firstly it is not vCenter that handles CPU Scheduling it is the individual Host servers. read the following doc for a very good insight in to CPU Scheduling

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

If I assign 2 cpu to a machine, does it map to the underlying physical cpus, or is it underlying host cores?

If you have a 2vCPU guest it will utilise 2pCPU cores

And finally, if I assigned 2 cpus to each vmachine, will I see performance degration accross the cluster compare to just assigning one?

You mileage may vary, but it is not considered best practice to create vSMP guest without good reason, it will increase the presure on the CPU Scheduler on the Host servers.

Cheers!

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert

VMware Communities User Moderator

Blog: www.planetvm.net

Contributing author on "[VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment|http://www.amazon.co.uk/VMware-VSphere-Virtual-Infrastructure-Security/dp/0137158009/ref=sr_1_1?ie=UTF8&s=books&qid=1256146240&sr=1-1]”. Currently available on roughcuts

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410

View solution in original post

0 Kudos
2 Replies
TomHowarth
Leadership
Leadership

Hi, so we have about 50 vms on 4 clustered hosts.

Each vms got 1 vcpu assigned to them. Today I had a developer tell me how terrible it was because it meant once the cpu is pegged at 100%, no one else could do anything on the machine.

This would be the case with a physical machine if a CPU is pegged at 100% it is at 100% no different between Physical and Virtual I'am afraid.

This raised an interesting question: how does vmware manage the underlying host cpus, and in particular cores?

Firstly it is not vCenter that handles CPU Scheduling it is the individual Host servers. read the following doc for a very good insight in to CPU Scheduling

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

If I assign 2 cpu to a machine, does it map to the underlying physical cpus, or is it underlying host cores?

If you have a 2vCPU guest it will utilise 2pCPU cores

And finally, if I assigned 2 cpus to each vmachine, will I see performance degration accross the cluster compare to just assigning one?

You mileage may vary, but it is not considered best practice to create vSMP guest without good reason, it will increase the presure on the CPU Scheduler on the Host servers.

Cheers!

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert

VMware Communities User Moderator

Blog: www.planetvm.net

Contributing author on "[VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment|http://www.amazon.co.uk/VMware-VSphere-Virtual-Infrastructure-Security/dp/0137158009/ref=sr_1_1?ie=UTF8&s=books&qid=1256146240&sr=1-1]”. Currently available on roughcuts

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
0 Kudos
sketchy00
Hot Shot
Hot Shot

Funny you mention that it was a developer. My biggest obstacle's in deploying a virtualized environment were not budget requirements, or management team buy-in, but rather, Developers who insisted that it was flawed, would never be as fast, etc... I have to say I do take quite a bit of satisfaction of proving them wrong along the way.

Look at Vcenter to get some clarity. When you have a VM with 1vCPU assigned assigned to an ESX host that has say, 8 physical cores, you will see that whether the VM is running at 10% or 99% that it's only affecting 1 physical core. A VM will see the use of 1 core as a CPU socket. So if you had a VM of windows 2003, with two vCPU's assigned, it's only allowed to use two physical cores. However, from the perspective of the OS, it sees those cores as CPU sockets.

Tell the developer that many production environements are running 4 to 8 VM's per CORE, and that will really get him/her freaked out.

As for VM's with multiple vCPU's, the rules change a bit from ESX 3.5 to vSphere, so it's best to look into the technical documents, and see how the scheduling has changed.