Solved

ESXi Processor Allocation

Posted on 2010-09-07
10
1,696 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Isolated network on ESXi 6.5 8 135
VMWare 101 9 101
VMware Health 6 43
Vmware 5.5 Consolidation is needed 50 40
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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