Control Processor resources in Hyper-V clients

In this article, I will show you the options for controlling processor resources and how to use them.

Robert Larson

Windows Server 2008 Hyper-V allows you to use up to four virtual processors in a virtual machine and allows you to configure options for how these virtual processors are balanced between virtual machines. In this article we will show you the options for controlling microprocessor resources and how to use them.

Hyper-V uses processors and physical cores to provide virtual processors to virtual machines. Each virtual machine starts with a virtual processor, but you can increase the number of virtual processors to 2 or 4 on each virtual machine. Virtual processors are real threads in the parent partition that run the name of a physical processor. When a virtual machine is operational, the 'on' state, a thread is created for each processor in the virtual machine and can be scheduled by the Virtual Machine Manager (VMM) on the physical core or a own physical processor.

Configuring the number of processors in a virtual machine is done from the virtual machine settings dialog. You can observe the number of virtual processors when the virtual machine is active, but cannot change the number of available processors until the virtual machine is in 'off' state. Figure 1 shows you the dialog box with settings, in this picture the Processor button is selected and you can see the right part is able to select the number of processors, in this case, 1 or 2 Processors are available. This is determined by the number of cores available in the parent partition. To change and select 4 processors in a virtual machine, the parent partition must have 4 cores (or 4 processors if not multiple cores).

Picture 1 of Control Processor resources in Hyper-V clients

Figure 1

Control resources

Virtualization will allow you to set some limitations for physical hardware processing. We can have only 4 cores on the physical server, but have created and have more than 4 virtual machines running. Each virtual machine will share a virtual processor in the parent partition, but without the restriction imposed, a virtual machine can use all one core in the machine. For example, if we put a virtual machine processor on a machine that has a four-core processor, the virtual machine will have one thread that can consume the entire core or processing time. If it has two configured microprocessors, it is capable of consuming two cores. In case you configure the virtual machine to have 4 cores, it can consume all the processing power of the server and take up the resources of other virtual machines.

Virtual Machine Manager (VMM) manages the scheduling of threads for all active virtual machines. By default, it will try to balance the processing on all the cores in the physical machine to balance the distribution to the processors. As mentioned above, a virtual machine can completely use all processor cores and take away threads running on one core. While Hyper-V does not have the same capabilities (the ability for specific processor cores to have one thread running on it), you still have the ability to 'command' VMM to what you want to apply to Control resources on each virtual machine to set restrictions on the capabilities of virtual machines.

Hyper-V has implemented resource control in different ways:

  1. Set up a reserve for processing resources in percent
  1. Set the maximum for resource processing by percent
  1. Set the equivalent weight of virtual machines together in the system.

Reserve virtual machines

Virtual machine reserve allows you to specify the percentage of virtual processors assigned to the virtual machine to be protected on the physical host. This value can range from 1-100% and correlates with the number of processors assigned to the virtual machine. For example, if a physical host has 4 errors and you assign a single processor to a virtual machine, the virtual machine can use the entire processor core for processing time but is not guaranteed That processing time is available at all times.

By setting this reserve value to 100%, the virtual machine will be reserved as the entire processor core. If the virtual machine is idle about 10% in most of the time, then 90% of the processing time is still not available for any other virtual machine. Controlling reserved resources will limit the available amount of virtual processor resources that can be shared on the Hyper-V host and will limit the number of virtual machines running simultaneously. If you have 20 virtual machines configured with a single processor on a host with 4 cores and you set up a reserve of 100%, you can only use 4 virtual machines.

Reserves should only be used in case you want to ensure that a virtual machine is always active. It is typically used on virtual machines that you know will need to handle a lot of work and is of real importance.

Restrict virtual machines

Virtual machine restrictions are in contrast to its reserves, which allows you to specify the maximum number of processors a virtual machine consumes. This value can be set from 100-1% and is equivalent to the number of processors assigned to the virtual machine. For example, if a physical host has 4 cores and you assign a microprocessor to a virtual machine, that virtual machine can consume the entire processing time of the core but there are no restrictions at all. so the virtual machine can use all the core resources. However, if the limit is set to 10%, the virtual machine will be limited to a maximum of 10% of the entire processing power of the core.

If a virtual machine needs to prioritize handling it, it will be limited to no more than 10% of the core's productivity and therefore will have good performance. Using this resource restriction control limits the amount of virtual processor resources available that are consumed on the Hyper-V host and allows you to control the number of physical virtual machines that work in the field. Time and get the specific amount of processing capacity on each virtual machine. If you have 20 virtual machines configured with a single processor on a 4-core host and set a limit of 10%, you only spend the equivalent of two processor cores and can still provide other machines (if there is enough memory and disk resources). This also means that if you only process on a virtual machine, it may not consume more than 10% of the core processing power.

Limiting the processor should only be used if you want to limit the processing power of the virtual machine. This method is often used by web service providers, because they want to get the maximum number of virtual machines on a host, but still provide a specific level of service.

Counterbalancing accordingly

Relative counterweight allows you to specify a virtual machine with priority without using a restriction or reserve. This value is set from 0-10000. Relative counterbalance is used to create clarity in case someone wants to handle resources when multiple requests are made at the same time. For example, by default if you have 4 virtual machines running, all 4 share the same processing power because they all have equal matching counterparts. If you have a machine that is more important than the other machines and wants the requirements on that machine to be prioritized over other machines, you can assign that virtual machine a higher counterweight than other virtual machines. . This means that if the virtual machine has a higher counterpart that needs more resources, it will be allowed to use, but if it is not used, other virtual machines can still be used. This method is still limited by the number of processors assigned to the virtual machine. If you assign a virtual machine a single processor and have a high counterweight, it can make the most of the processing power of this core.

Conclude

Hyper-V provides default for all virtual machines with equal priority levels and access to equivalent resources. You may encounter situations where you want to ensure that a virtual machine has some specific processing power for the entire time, may want to ensure that the virtual machine will probably never spend much. more than a specific percentage of processing capacity or want it to balance productivity by default except for peak processing time and then allow some virtual machine to handle priority. Hyper-V allows you the flexibility to choose a method to control resources on your virtual machine.

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile