Solved

ESXi Processor Allocation

Posted on 2010-09-07
10
1,702 Views
Last Modified: 2012-05-10
I'm just getting started with VMWare and am working on getting a new ESXi 4.1 host into my production environment. I'm in the process of creating some virtual machines, but really don't understand how processors are allocated. Unless I missed some documentation, I can't find anything that specifically tell me how this works.

Lets just say for example's sake that my host has one 4 core processor, giving me 4 logical processors that I can assign to hosts. Does this mean that if I assign 2 processors to one VM, that those two logical processors is dedicated to that guest and I have 2 left? What would happen if I assigned all 4 to one machine, then assigned 2 to another? I just don't understand how this is handled, and just need some insight on best practices.
0
Comment
Question by:jschweg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 5

Expert Comment

by:MrN1c3
ID: 33617892
By Default its all done time sharing on CPU cycles.  I will look for a a link now to better explain it.

As a general rule, you will get better performance overall if all of your VM's have the same amount of virtual processors.
0
 
LVL 5

Assisted Solution

by:MrN1c3
MrN1c3 earned 50 total points
ID: 33617941
0
 
LVL 2

Assisted Solution

by:tspreeth
tspreeth earned 50 total points
ID: 33618088
Hi ,
The number of Processors on the Base Machine will not limit your allocation for VMs.
In other words as you said if u allocate 2 Logical Processors to one VM  from ESXi physical machine which has 4 Procs , you can go ahead and create another 5 VMS with 2 cpus .
Here the allocation is the cpu cycle time .
Best practise is to allocate 1 cpu  for the VM and then increase the CPU reosurce allocation  and shares if the VM is more cpu intensive .
In case still if you need cpu then only allocate the second cpu.
 
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 4

Author Comment

by:jschweg
ID: 33619165
Okay, so basically leave it set for one processor and re-provision as needed. I assume that this is what the "Typical" VM setup does as it doesn't even give you the choice of allocating CPU's unless you choose custom.

I didn't think you could add CPU's to the VM after the OS was installed, you can do this? I only have experience with the VMWare Server product which it says it isn't recommended. This is my first experience with ESXi
0
 
LVL 16

Expert Comment

by:danm66
ID: 33619571
To change the number of vCPU's assigned to a VM, you power down the guest, right-click, edit settings and there you can change the number of processors.  You will want to verify that the OS sees the new number of processors and if you're going from 1 to 2, make sure you are using a SMP kernel.  In windows xp/2003 and newer, you can usually do this from Device Manager.
0
 
LVL 2

Expert Comment

by:tspreeth
ID: 33626538
Yes need to use custom and select the number of CPUs.
You can add CPUs to the VMs after powering it off and edit settings option.
Take a snap shot before you do in case you need to revert.
Also before adding CPU try and see if allocating more share and incresing the limit is sufficient for the VM to work .
Adding the CPU is the last resort.
0
 
LVL 5

Accepted Solution

by:
chkdsk01 earned 400 total points
ID: 33626956
I just wanted to add my 2 cents in here.  First of all, you will not see any better performance if all your VMs have the same number number of vCPUs.  The least amount of CPUs is best from the host's perspective, because there are less CPU cycles it needs to schedule.  Secondly, the link that is posted above is for ESX Server 2.  Here is a more recent paper about CPU scheduling and vSMP with vSphere 4.0.  http://www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf  Also, one more link to an article by Jason Boche about the differences& changes in 4.1 with vCPUs. http://www.boche.net/blog/index.php/2010/07/25/vsphere-4-1-multicore-virtual-cpus/
Also, while best practices do suggest starting at 1 vCPU and scalling up only if necessary, they do not suggest changing shares or setting reservations.  First of all, if you have no ESX host CPU contention (no overcommitment of resources), then changing the shares and reservations provide any benefit.  Here's a quick article from Duncan over at Yellow Bricks about reservations.
http://www.yellow-bricks.com/2010/07/08/reservations-primer/
 Another good, quick article from Jason Boche.  This one pertains to resource pools, but a resource pool is nothing more than shares, limits, & reservations for a group of VMs.  http://www.boche.net/blog/index.php/2008/11/02/63-not-utilizing-resource-pools/
Also, to the OP, if you have hyperthreading on your host server, Turn it on and get another 4 logical CPUs out of it.
0
 
LVL 4

Author Comment

by:jschweg
ID: 33628037
Thanks for the additional documentation.

So basically the general consensus is that the guest should always start out with a single processor, and ramp up if required. One of the machines that I'm virtualizing is a low load SQL server (less than 10 users, casual use), and I figured that I would give that machine 2 cpus since SQL can take advantage of that. After this discussion I will just start it out at 1 and go from there.
0
 
LVL 5

Expert Comment

by:chkdsk01
ID: 33628097
I would start it out at 1.  Heres a screenshot of our test SQL server.  Very similar usage, about 3 databases plus it is our SQL for our test vSphere environment.  It's got one CPU and 1 GB of RAM and you can see its utilization.  And for what it's worth, I just took this screenshot now, mid-day.
 

SQLMEM.PNG
0
 
LVL 5

Expert Comment

by:chkdsk01
ID: 33628135
Sorry, the first column (101) is CPU in MHz.  Second column (1009) is allocated memory and the 11 is Memory Utilization.  The 1024 is Memory size... 1 GB
Also, CPUs are Intel Nehalem E5560 @ 2.53 GHz
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
Suggested Courses

635 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