Discussing power management issues is something weird in the context of Hyper-V technology, isn't it? In the end, virtual servers run on virtual hardware, however, even in this situation, the cost of electricity and cooling make up a large part of the budget, so it makes sense to think about how these resources are used. to change.
Windows power plans
If your goal is a more balanced power consumption without a negative impact on performance, then it would be nice to start with Windows power plans. Power plans are designed to help administrators achieve the necessary balance between power consumption and performance.
This approach forces us to consider power plans as an automated tool for turning off power to monitors and hard drives when the system is idle. While the power plans, of course, can do all of the above, they also tend to affect the speed of the processor.
')
For testing, we created a new virtual machine running Windows Server 2012 R2 on the
Hyper-V server, which also runs on Windows Server 2012 R2. Then they downloaded the free benchmarking program NovaBench (Fig. 1). Prior to the analysis, all other VMs were disabled so as not to distort the test results.
Figure 1. Research meal plans with NovaBench.Windows Server 2012 R2 uses a “Balanced” default power plan. In the first test, the “Energy Saving”, “Balanced” and “High Performance” plans were tested, tuning them at the virtual machine level. Since NovaBench offers many different tests, it was decided to run a full set of tests and fix the total score and the test score of the processor. Higher scores reflect higher performance.

Upon receipt of the first indicators (see Table 1), we noticed that the scores gradually decreased with each test passed, regardless of which power plan was used. After several checks, it was discovered that it was caused by Windows Update, which were disabled before the analysis began.
Table 1 Test 1: Virtual Machine Power PlansThe full test results for the energy saving plan in Figure 2.
Fig. 2. Results of testing a virtual machine configured to use an energy-efficient power scheme.For the second test (Table 2), the same power plans were checked, but this time configured at the host level. The VM was set up to use a balanced plan, and indicators were collected inside the VM.
Table 2 Test 2: Hypervisor Power PlansThe results of these tests are quite interesting. When the power mode at the VM level was adjusted to high-performance, it actually led to a lower score (probably as a result of a background system process performing
some task). However, the results of the processor were almost identical for all power plans.
When the power plan was configured at the hypervisor level, there was a huge drop in performance when the power saving mode was activated, and a slight increase in performance when the high performance mode was turned on.
By the way, the power plan can be changed when you open the control panel and go to the indicators "Equipment / Energy parameters". It is worth noting that, as a rule, it is preferable to set up a power plan at the group policy level. You can find the necessary settings in Computer Configuration | Administrative Templates | System | Power Management (Computer Configuration | Administrative Templates | System | Power Management). The parameter you need is a “Select” active power circuit, as shown in Figure 3.
Figure 3. Using group policies to manage your power planWhen implemented at the level of the parent operating system, the power plan determines how much power the server will consume and also affects the performance of the server. This raises a number of questions:
- Does the cost compensate for the advantage of using more power?
- Is this high performance suitable for any load?
- Is there a way to use less energy without giving up high performance?
Since it’s not always possible to quickly find answers to the first two questions, there are several different strategies that can be used to reduce energy consumption while maintaining a high level of performance. It is worth noting that both of these strategies require System Center Virtual Machine Manager (VMM), since the required functionality is missing and does not exist in
Hyper-V Manager or in the Windows operating system.
Using host groups
One option for managing the power consumption of
Hyper-V is to use VMM host groups. Host groups are nothing more than a set of host servers and host clusters.
As you know, you can group servers in Active Directory and assign different group policies for each group. In this way, you can assign a balanced power plan to one group of
Hyper-V hosts and a high-performance plan to another group. You can then create two corresponding separate host groups in VMM. You can then place the
Hyper-V hosts or clusters in the appropriate groups based on their group policies.
After the
Hyper-V hosts are distributed into groups, you can begin moving virtual machines based on performance needs. Demanded virtual machines, such as
SQL servers , probably need to be hosted on a host using a high-performance plan, while less demanding virtual machines, such as file servers or DHCP servers, can be hosted on a balanced power plan or even energy-efficient. .
This distribution can be easily organized in many companies, since it is a common policy to organize host groups based on hardware capabilities. For example, we met a company that uses a group of hosts called Gold Tier (or something similar), which contains the most high-performance virtualization hosts and is used for the most demanding virtual machines. Adding an appropriate power plan for servers included in such a host group is fairly straightforward.
Energy Optimization
The second way to control the power consumption of
Hyper-V is the VMM Power Optimization feature. The basic idea is quite simple: in many companies there is a certain time of the day (or night) when the load is relatively small. At this time, you can perform dynamic migration of virtual machines to alternate hosts of
Hyper-V nodes in order to facilitate some servers. In this case, empty hosts can be disabled until they become necessary. At such moments, the hosts can be transferred to the backup state, and the load can be redistributed to use the available resources efficiently.
There are several prerequisites that must be met in order to use energy optimization.
First , you need a suitable failover cluster. Typically, the cluster will need at least five hosts, but you can use 4 as well if the cluster was created using VMM. The reason is that the power optimization is designed to keep the cluster from losing quorum. In this scenario, it will keep the minimum number of cluster hosts online, plus one additional node (in case of failure).
As a rule, the smallest number of hosts that can support this model is five. In a
five-node cluster, at least three nodes must remain online in order to maintain the quorum. When adding an additional host that will remain online in the event of a failure, the number of hosts required in the online state grows to four. Consequently, a
five-node cluster is the smallest cluster that can benefit from power optimization with one exception: if the cluster was created using VMM, it can use a disk instead of a host.
Due to node requirements, larger clusters tend to benefit most from energy savings.
The second requirement is that the cluster nodes must be equipped with a Baseboard Management Controller (BMC) controller. The controller provides out-of-band node management. This is a mechanism that allows a host to shut down and start up again without administrator intervention.
In Microsoft, it’s easy to set up power saving features: open the VMM console, then find the group of nodes containing the cluster for which you want to enable power optimization. Next, right-click on the host group and select the "Properties" command in the context menu. When you do this, the console will display the “Properties” window of the host group.
Power optimization options are located on the Dynamic Optimization tab. Dynamic optimization is a VMM feature that automatically performs load balancing of virtual machines running in a host cluster. At the bottom of the window there is a checkbox with which you can enable power saving features. This box is unavailable by default, but can be enabled by selecting the option to automatically migrate virtual machines for workload distribution, as shown in Figure 4.
Figure 4. Enable automatic load balancing before enabling energy optimization.Before turning on the power saving function, you should pay attention to two parameters.
First , the “Aggressiveness” setting shown in fig. 4, as a rule, should be set at an average level. Using more aggressive optimizations will result in a more balanced workload, but can cause live migrations that will occur so often that they will ultimately affect performance.
Another parameter is the load balancing frequency. This number determines how often VMM checks if virtual machines need Live Migrations. The reason why you should pay attention to this value is that it is also used to optimize nutrition. When the nodes are de-energized as a result of the power optimization function, VMM by default checks every 10 minutes whether the nodes should be returned to the online state.
If you click the Parameters button shown in Figure 4, you will be taken to the Energy Optimization Schedule Settings dialog box shown in Figure 5. As you can see, this allows you to set the energy optimization schedule and the corresponding set of threshold values.
Figure 5. Setting the schedule for energy optimizationKeep in mind that the cluster nodes will not automatically turn off only when the set time is reached. Before shutting down
any nodes, VMM checks that the virtual machines can be moved to other nodes in the cluster without affecting performance and without depleting the hardware resources of the remaining nodes to the level of the threshold values ​​shown in the figure.
Energy saving
Power management is a problem for large and small data centers, because power and cooling tend to be a significant percentage of the total
IT budget . It is worth taking the time to develop a power management plan for the
Hyper-V hosts in each company to get the potential to reduce energy consumption and reduce operating costs in the end.