Solved

VMWare and physical cores?

Posted on 2015-01-09
12
454 Views
Last Modified: 2015-01-10
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.
0
Comment
Question by:Go-Bruins
  • 5
  • 5
  • 2
12 Comments
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 350 total points
Comment Utility
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
 

Author Comment

by:Go-Bruins
Comment Utility
Thank you. So when you use the term "vCPU (socket)", that's analogous "Number of processors:" in VMware, correct?

Snapshot
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
Correct, it's displayed a little different in VMware Workstation to vSphere.

But yes virtual processors = sockets = vCPU.
0
 

Author Comment

by:Go-Bruins
Comment Utility
And the "Number of cores per processor" refers to HyperThreading, correct? If so, how should those be deployed?
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
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
 
LVL 5

Assisted Solution

by:Dawid Fusek
Dawid Fusek earned 150 total points
Comment Utility
"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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:Go-Bruins
Comment Utility
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
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
Start with 1 Processor, 1 Core, if you require, more performance, add another processor, to 2 Processors.
0
 

Author Comment

by:Go-Bruins
Comment Utility
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
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
1. Correct (it will not let you exceed what physical cores you have in the host!)

2. Same as 1.
0
 

Author Comment

by:Go-Bruins
Comment Utility
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
 
LVL 5

Expert Comment

by:Dawid Fusek
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now