VMware Cloud Community
ronnutter
Enthusiast
Enthusiast

Question on assigning CPU's to a VM

I am setting up a Cisco UCS chassis.  According to vSphere client, I have 16 CPU's, 2 Processor Sockets, 8 Cores per socket.  I am planning on deploying up to 6 VM's per blade.  Based on that, I can assign 2 cpu's per vm, leaving 4 left over to assign depending on VM need/requirement.  To assign 2 CPU's per VM, do I assign 1 socket and 2 cores per virtual or 2 socket and 1 virtual per virtual ?  I get the same number of cores with either option.  I havent found a good explanation in the online help.

Ron

0 Kudos
2 Replies
vmroyale
Immortal
Immortal

You can assign 2 vCPUs per VM, but they aren't statically bound in any way. The vCPU will be scheduled on the different cores, unless you get into things like CPU affinity.

You can use 2 sockets with 1 core or 2 cores with 1 socket - it still gets scheduled the same way.

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
jdptechnc
Expert
Expert

To answer your original question, there is no difference between 1 virtual CPU with 2 virtual cores, or 2 virutal CPUs with 1 virtual core.  One common use case of multiple core vCPU is guest OS licensing - there are limits to how many sockets certain Windows versions can use, but you can get around that by adding virtual cores to the vCPU.  From the perspective of ESXi, it is just another available core, either way.

I think you may have a misunderstanding on how virtual CPUs are allocated in vSphere.  Allocating a vCPU core to a VM does not bind that VM to a specific physical CPU core at all.  When a VM needs to execute an instruction, ESXi will schedule two available cores (assuming it's a 2-core VM) on which to execute the instruction.  It is valid to "overcommit" and allocate more vCPUs per host than physical cores.  If the nature of your processing activity is relative light, you will not notice a performance impact by doing this.

This whitepaper should provide more insight into how CPU scheduling works.

http://www.vmware.com/files/pdf/techpaper/VMware-vSphere-CPU-Sched-Perf.pdf

Please consider marking as "helpful", if you find this post useful. Thanks!... IT Guy since 12/2000... Virtual since 10/2006... VCAP-DCA #2222
0 Kudos