Solved

ESXi Processor Allocation

Posted on 2010-09-07
10
1,688 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
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 5

Expert Comment

by:MrN1c3
Comment Utility
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
Comment Utility
0
 
LVL 2

Assisted Solution

by:tspreeth
tspreeth earned 50 total points
Comment Utility
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
 
LVL 4

Author Comment

by:jschweg
Comment Utility
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
Comment Utility
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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 2

Expert Comment

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It Is not possible to enable LLDP in vSwitch(at least is not supported by VMware), so in this article we will enable this, and also go trough how to enabled CDP and how to get this information in vSwitches and also in vDS.
David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

763 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

10 Experts available now in Live!

Get 1:1 Help Now