We help IT Professionals succeed at work.

CPU assignment for VM host

AXISHK asked
From an article,
"if each virtual machine you create has a 500MHz reservation and your host has 6000MHz of CPU capacity, you can deploy no more than 12 virtual machine (500MHz x 12 = 6000MHz) even if all of them are idle. However each virtual machine is not limited to 500MHz and ESX/ESXi host will schedule more clock cycles to VM if needed."

Suppose my VM host has 2 CPU 2.1GHz with 6 cores, ie 12 cores.  Can I say each VM guest can only asssign with CPU of 2 and cores per socket of 6 ? Should I set the CPU Limit (say, 500MHz) to ensure a single core can be shared by several few VMs ?

Watch Question

CPU reservations are guarantees to the guest machine that it will have that much CPU available. Usually you would only make these guarantees in situations where your virtual host is overcommitted and certain VMs need to be prioritized to get more than their normal fair share.

As for assigning CPUs to VMs, when you assign to the VMs the entire CPU resources of the host, as you've suggested, you're making a different sort of guarantee to the VM - that it will have that degree of parallelism available. This makes the VMware scheduler allocate time slots to run this VM when no other VM can be running simultaneously. It's possible to run this way, but you should take advantage of the VMware monitoring data to see how much CPU the VM is really consuming -- you might be able to make the overall system more efficient if the guests can share the host while having fewer vCPUs assigned to them.

When you set "cores per socket" in the VM configuration, you should be doing it because of software licensing restrictions in the guest that limit how many sockets it is allowed to run on.
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
again the same applies.....

You ONLY need to set a CPU reservation IF YOU WANT TO RESERVE CPU, or GUARANTEE CPU for the VM.

So, do you have other VMs, on your host?

Are you short of CPU on the host?

If the answers are no, to the last question, there is no real benefit of providing a CPU reservation.

Leave the defaults for CPU and Memory Reservation, you are welcome to change, and guarantee if you like, but this is onl required if you are short of CPU or Memory.