Today’s post will cover the processor configuration available in Hyper-V.
As you already know up to this point in time, we cannot add or remove Virtual Processor (vCPU) while the virtual machine is running. This has been the case since Hyper-V was released back in October 2008.
If we look at a regular virtual machine, you can see that the Number of virtual processors is grayed out while the VM is running:
What we can do, we can reserve an amount of resource for this virtual machine.
For example: always make sure at least 25% of a single processor core is reserved for this VM.
The next cool option is the Virtual machine limit (percentage).
Notice what is showing in the Percent total system resources, what amount is that the overall system resource of the Hyper-V box.
This VM has single processor with 6% of total system resources, because the physical host affectively has 16 logical processors.
So 1 Processor over 16 is equal to 6% of the overall system.
What the nice thing we can actually do, we can change these limits while the VM is running as you can see…
One thing we can do, let’s say for example to this Virtual Machine I wanted it to only have 2 processors normally.
But could be this extreme scenario where I want to access 4 vCPUs while the VM is running, how…? No magic :)
So we just give it 4 virtual processors, there is no real disadvantage in Hyper-V because it doesn’t use gain scheduling in the processor like VMware, no disadvantage to give it more virtual processor.
So 4 vCPUs with 100% limit equal to 25% of total system resources…
However, I want actually limit that to 50%, so effectively now is giving 2 cores worth of processing and this all what we would be allowing for the VM to be used.
If it’s a busy time, I want to effectively hot/add some additional CPU resources, we could increase that limit maybe to 3 cores worth @ 75% or access all 4 @ 100%.
Those actually can be changed while the VM is running… !!!
The final option is the Relative weight is really used in time of contention.
The relative weight really control how much CPU time I can get compare to other virtual machines.
So suppose this VM has a Relative weight 100 and another virtual machine for example has a relative weight of 200.
The one with 200 will get twice as many CPU cycle as the one with 100.
This let us balance which VM is more important than others.
Some key points to note:
The rule of thumb when allocating CPU’s to a Virtual Machine as best practice is to allocate 1 vProc and then test the CPU utilization.
Microsoft products that should be considered for multiple vCPU’s:
- Exchange Server.
- SQL Server.
- SharePoint Server.
- Lync Server.
- Remote Desktop Services Infrastructure.
Hopefully Microsoft will add this feature in the next release of Hyper-V (add/remove Virtual Processors on the fly).
Enjoy your day!