VMWare and physical cores?

Hi,

I'm using VMware V9 with a CPU that has 4 physical cores.

Let's say that I have 3 VM's, and I specify that each VM gets 2 processors. If I fire up all 3 VM's, they are obviously going to claim more cores than I have. How does VMware reconcile this? Does it throttle access to the cores or something like that?

I also noticed that there is a field for "Number of cores per processor". Does that refer to HyperThreading?

What's the best practice when distributing resources to the VM's?

Thanks in advance.
Go-BruinsAsked:
Who is Participating?
 
Andrew Hancock (VMware vExpert / EE MVE^2)Connect With a Mentor VMware and Virtualization ConsultantCommented:
Always allocate "sockets" not cores.

(simplified!)

1 vCPU (socket) = approx 1 physical core on the physical CPU, but not for all of the time, the hypervisor could scheduled that timeslice on any core in the host.

The Hypervisor, has something called a CPU Scheduler, and it robs CPU time, from all the physical cores in your Host, and offers them to the VMs.

Do *NOT* overallocate processors in the VMs, start with a single processor (socket), 1 vCPU and increase if you require additional performance.

Very few VMs need more than 1 or 2 vCPUs!

here's a nice article with screenshots, which makes it a little easier to understand

http://www.virtuallycloud9.com/index.php/2013/08/virtual-processor-scheduling-how-vmware-and-microsoft-hypervisors-work-at-the-cpu-level/
0
 
Go-BruinsAuthor Commented:
Thank you. So when you use the term "vCPU (socket)", that's analogous "Number of processors:" in VMware, correct?

Snapshot
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Correct, it's displayed a little different in VMware Workstation to vSphere.

But yes virtual processors = sockets = vCPU.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Go-BruinsAuthor Commented:
And the "Number of cores per processor" refers to HyperThreading, correct? If so, how should those be deployed?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Cores is a reference to cores on the physical processor.

if hyperthreading is enable on your processor, you will usually have double the cores.

I would only recommend using cores, if you have a license requirement based on cores, whether you select processors (sockets) or cores, the performance is going to be the same, it's there to maintain license conditions, where it states, licensed for 2 cores.
0
 
Dawid FusekConnect With a Mentor Virtualization Expert, Sr B&R, Storage SpecialistCommented:
"I also noticed that there is a field for "Number of cores per processor". Does that refer to HyperThreading?

What's the best practice when distributing resources to the VM's?"


There are different best practices for different purpose, workloads and vendors but in most cases real world for CPU/cores/HT and vCPU it looks like this (data for vMware ESXi v5.x hypervisor, info for VMware Workstation below):
- CPU is a physical socket, core men CPU physical core in CPU, and vCPU mean Virtual Cores or Virtual CPU in the VM (it's as Andy described quite the same only for SW licensing purpose, probably specially for MS and ORACLE)
- if buying server for VMware ESXi hypervisor bought CPU (or CPUs) with as much cores as possible for your budget and with HT (but better more cores than HT)
- HT doubles a threads which is really good for VI, so in ESXi hypervisor U see doubled "logical processors", but this not mean that it doubles number of cores, if U calculate U may think a HT is a 1/4 of 1 core, so 4 cores with HT U may use to calculation like 5 cores - that's my own opinion from my practice and knowledge
- ESXi host BIOS - Enable all cores and HT
- ESXi hypervisor console - enable HT if disabled (ESXi host/configuration/hardware/processor/properties)
- use vCPU to core (physical) ratio up to 4-5:1 for all runing VM's (in truly if U don't have a lot of memory it's hard to achive it running 2 vCPU VMs), if U have old server slow CPU or low ammount of cores and no HT use lower ratio maybe 2-3:1, faster/newer CPU per core U have = bigger ratio vCPU to core U may try to achive
- use 1-2 vCPU for most VM's if evidently there is no real need for more, 2 vCPU is best option in my opinion (VM's are more responsible), I have 450 VMs on my lab/soho environment, with active 100-150 VM's and 90% of them have 2 vCPU, 8% have 1 vCPU and only 2% have 4 vCPU, sure if someone have huge DB (virtualized what is not ideal options but happens) or a huge web server (what is still not ideal candidate for virtualization in my opinion) one may use up to 32 vCPU if the server have such ammount of cores

for example on my main 2 servers with 2x 6 core CPU with HT I have 12 cores per host and 24 logical processors per host, and I easly and smoothly running 80 vCPU per host and sometimes it happens up to 100 vCores per host, it still working but performance is degradated, so 80 is ok for my CPUs (2.2GHz) so in my calculation vCPU to core (physical +1/4 HT=core) it's 5.3:1 and riching 6:1 I can see performance degradation.

In VMware Workstation situation is similar but in this scenario I will use lower vCPU to core ratio like up to 2:1, and as I described above it also depends of CPU speed and.

regards
NTShad0w
0
 
Go-BruinsAuthor Commented:
Thank you. I'm beginning to get a grasp on sockets, cores, and VM's.

This is just a testbed for me to learn VMware, so allow me to pose another theory based question:

Let's say I'm running VMware on am AMD 8350, This CPU has 8 cores and not HT (I think). Let's say a single socket MB with 32GB of RAM. I'd like to test run maybe Server 2012, and three Win 7 x64 machines.

What values should I put into the two fields?

thanks.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Start with 1 Processor, 1 Core, if you require, more performance, add another processor, to 2 Processors.
0
 
Go-BruinsAuthor Commented:
Great, Thank you.

1. Sum can never exceed 8, correct? Or is it 7, as the host machine uses one? and each machine gets same, regardless of OS?
1. What if I had an Intel cpu - 4 cores with HT?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
1. Correct (it will not let you exceed what physical cores you have in the host!)

2. Same as 1.
0
 
Go-BruinsAuthor Commented:
Thank you so much.

Andrew, I read one of your articles about converting physical and virtual machines to the Microsoft Hyper-V format.

Do you prefer the Microsoft offering over VMware?
0
 
Dawid FusekVirtualization Expert, Sr B&R, Storage SpecialistCommented:
Go-Bruins,

"1. Sum can never exceed 8, correct? Or is it 7, as the host machine uses one? and each machine gets same, regardless of OS?
1. What if I had an Intel cpu - 4 cores with HT?"


1. sum on single VM can never exeed sum of logical cores that physical CPU have (so if U have your AMD with 8 physical cores without HT, AMD don't have HT same like Intel, it have something called HT but it's something else), then on single VM U may use up to 8 vCPU ("Number of processors" or "number of cores per processor" in VMware Workstation)

2. if U have intel CPU with 4 cores and HT, U will have 8 logicar cores so in single VM U have also a limit up to 8 vCPU  ("Number of processors" or "number of cores per processor" in VMware Workstation)

But as we inform U sooner:
- it's not recommend and needed in most cases to exeed 2 vCPU  ("Number of processors" or "number of cores per processor" in VMware Workstation) per single VM
- U can exeed your logical cores/logical processors with for example sum of 9 VM's, and as I type U before for VMware workstation I will use a ratio up to 1:2, so for example for 8 cores CPU/4 cores CPU with HT and 9 VMs, U may use summary 16 vCPU  ("Number of processors" or "number of cores per processor" in VMware Workstation) so 7 may have 2 vCPU and 2 should have 1 vCPU (sum will be 16 vCPU)
- vCPU are shared so they will not eat your physical core and for example in vmware workstation can't have anything for Windows host system, no, they are shared so working as an appliaction (U may run much more applications at once than physical or logical core your CPU have)
- if starting with Virtualization, build your workstation with 32GB of ram and instal here ESXi hypervisor (it's boot from USB, like a linux) and then it's managed very easy and flexible from VMware vSphere Client from your Windows laptop, You can download ESXi hypervisor and Your Free license here (U need to register):
https://my.vmware.com/web/vmware/evalcenter?p=free-esxi5&lp=default

Then U will discover new world of virtualization,  when U can run ten's of system at once or just save them as a VM and run when U want, Virtual Appliances from different software and hardware vendors, unlimited possibilities to test, evaluate,show, share and use in production, and everything on single PC (or server) :P.

have fun mate

regards
NTShad0w
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.