Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ESXi Processor Allocation

Posted on 2010-09-07
10
Medium Priority
?
1,705 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
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 200 total points
ID: 33617941
0
 
LVL 2

Assisted Solution

by:tspreeth
tspreeth earned 200 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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:Danny McDaniel
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 1600 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

879 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