Ben Armstrong, who is Virtualization Program Manager at Microsoft posted a four part article about CPU scheduling in Hyper-V. Most of the aspects of the Hyper-V CPU scheduler come into play when all of the CPU resources on a physical computer are being used, called ” contention for resource” and Hyper-V has to decide who wins and who loses when new resources are requested. Each option is detailed, and pros and cons are provided.
When defining a VM within Hyper-V the following Processor options are available:
Virtual Machine Reserve – covered in part one of the four part article and covers the lower bound of the CPU resource. It is configured as a total possible CPU usage of a VM, the VM will not boot if the necessary percentage of CPU usage isn’t available and the VM will allways get its CPU percentage when needed while booted.
Virtual Machine limit – covered in part two which covers the upper bound of the CPU resource and is also configured as a percentage of total CPU usage of a VM. It states that the VM will never be allowed to use more than the specified percentage of its virtual processors. Which can help with poorly written applications which consumes all the available CPU resources.
Relative Weight – covered in part three defines how CPU is handled between the lower and the upper bound of the CPU resource. It is a number between 1 and 10,000 and which comes into effect when there is a contention for CPU resource on the host. The height of the weight determines the share of the system resource the VM receives. Using this setting VMs can be marked as important and not-important in a mixed production and development/staging environment.
Part four covers some Frequently Asked Questions based on the described options, like why a percentage is used for limit and reserve and not Mhz/Ghz.