Solved

ESXi Processor Allocation

Posted on 2010-09-07
10
1,690 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 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

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…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…

776 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