In this article, we will cover the processor configuration for Hot/Add additional CPU available in Windows Server Hyper-V.
The Hyper-V role in Windows Server lets you create a virtualized computing environment where you can create and manage virtual machines. You can run multiple operating systems on one physical computer and isolate the operating systems from each other. With this technology, you can improve the efficiency of your computing resources and free up your hardware resources.
In This Article
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, we can see that the number of virtual processors is grayed out while the VM is running:
Configure Hot/Add additional CPU
What we can do, we can reserve a number of resources for a virtual machine.
For example: always make sure at least 25% of a single processor core is reserved for this VM.
The next 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 host.
This VM has a single processor with 6% of total system resources because the physical host effectively has 16 logical processors.
So 1 Processor over 16 is equal to 6% of the overall system.
What a nice thing we can actually do, we can change these limits while the VM is running as shown in the figure below.
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 :)
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 problem to give it more virtual processors.
So 4 vCPUs with a 100% limit equal to 25% of total system resources…
However, we want actually to limit that to 50%, so effectively now is giving 2 cores worth of processing, and this is all that we would be allowing for the VM to be used.
If it’s a busy time, we 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 Virtual Machine is running… !!!
The final option is, Relative weight is really used in times of contention.
The Relative weight really controls how much CPU time I can get compared to other virtual machines.
So suppose this VM has a Relative weight of 100 and another virtual machine for example has a relative weight of 200.
The one with 200 will get twice as many CPU cycles as the one with 100.
This lets us balance which VM is more important than others.
In this article, we showed you how to configure Hot/Add additional CPU in Windows Server Hyper-V.
Some key points to note. The rule of thumb when allocating CPUs to a Virtual Machine as best practice is to allocate 1 virtual Processor and then test the CPU utilization.
Microsoft products that should be considered for multiple vCPU’s are the following:
1) Exchange Server.
2) SQL Server.
3) SharePoint Server.
4) Lync Server.
5) Remote Desktop Services (RDS) Infrastructure.
Hopefully, Microsoft will add this feature in the next release of Hyper-V (add/remove Virtual Processors on the fly).
Make sure to check my recent Windows Server Hyper-V Cookbook for in-depth details about Hyper-V!
Enjoy your day!