Energy Efficiency in Hyper-V Infrastructures

Original author: Brien Posey
  • Transfer

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, are there any options that you can to change.



Windows Power Plans


If your goal is more balanced power consumption without negatively impacting performance, then it would be nice to start with Windows power plans. Nutrition plans are designed to help administrators achieve the right balance between energy and performance.

This approach makes us consider power plans as an automated tool to turn off the power of monitors and hard drives during a system downtime. While power plans, of course, can do all of the above, they also tend to affect processor speed.

For testing, we created a new virtual machine running Windows Server 2012 R2 on a Hyper-V server, which also runs Windows Server 2012 R2. Then they downloaded the free NovaBench benchmarking program (Fig. 1). Prior to the analysis, all other VMs were turned off so as not to distort the test results.


Figure 1. A study of nutrition plans with NovaBench.

Windows Server 2012 R2 uses the “Balanced” power plan by default. In the first test, we tested the “Energy Saving”, “Balanced” and “High Performance” plans, tuning them at the virtual machine level. Since NovaBench offers many different tests, it was decided to run a full set of tests and record the total score and processor test score. Higher scores reflect better performance.

Upon receipt of the first indicators (see Table 1), we noticed that scores gradually decreased with each test passed, regardless of which power plan was used. After several checks, it was discovered that this was caused by Windows Update, which were disabled before the analysis began.


Test 1 Table 1: Virtual Machine Power Plans

Complete test results for the power plan in Figure 2.


Fig. 2. Test results of a virtual machine configured to use an energy-saving 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 configured to use a balanced plan, and indicators were collected inside the VM.


Table 2 Test 2: Hypervisor Nutrition Plans

The results of these tests are quite interesting. When the power level at the VM level was adjusted to high-performance, this actually led to a lower score (probably as a result of the background system process performing some kind of task). However, the processor results were almost identical across all power plans.

When the power plan was set up at the hypervisor level, there was a huge drop in performance when you turned on the power saving mode, and a slight increase in performance when you turned on the high-performance mode.

By the way, the power plan can be changed when you open the control panel and go to the indicators "Equipment / Energy Settings". It is worth noting that, as a rule, it is preferable to configure the power plan at the group policy level. You can find the necessary settings in the Computer Configuration | Administrative Templates | System | Power Management (Computer Configuration | Administrative Templates | System | Power Management). The parameter you need is “Select” the active power circuit, as shown in Figure 3.


Figure 3. Using group policies to manage the power plan

When implemented at the parent operating system level, the power plan determines how much power the server will consume and also affects server performance. In this regard, a number of questions arise:

  1. Does the cost offset the advantage of using more power?
  2. Is this high performance suitable for any load?
  3. Is there a way to use less energy without giving up high performance?

Since the first two questions cannot always be answered quickly, there are several different strategies that can be used to reduce power consumption while maintaining a high level of performance. It is worth noting that both of these strategies require the System Center Virtual Machine Manager (VMM), since the required functionality does not exist in  Hyper-V Manager or in the Windows operating system.

Using Host Groups


One option for managing Hyper-V power consumption is to use VMM host groups. Host groups are nothing more than a collection of host servers and host clusters.

As you know, you can group servers in Active Directory and assign different group policies for each group. Thus, you can assign a balanced power plan for one group of Hyper-V hosts and a high-performance plan for another group. After that, you can create two corresponding separate host groups in VMM. You can then put the hosts or Hyper-V clusters into the appropriate groups based on their group policies.

After Hyper-V hostsdistributed in groups, you can start moving virtual machines based on performance needs. Demanded virtual machines, such as SQL servers , should probably be located on a host using a high-performance plan, while less demanding virtual machines, such as file servers or DHCP servers, can be located on hosts with a balanced power plan or even an energy-efficient one. .

Such a distribution can be easily organized in many companies, since it is a generally accepted policy to organize host groups based on hardware capabilities. For example, we met a company that uses a host group called Gold Tier (or something similar) that 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 this host group is a fairly simple task.

Power optimization


The second way you can control Hyper-V power consumption is with VMM's Power Optimization feature. The basic idea is quite simple: in many companies there is a certain time of day (or night) when the load is relatively small. At this time, you can perform dynamic migration of virtual machines to alternative hosts of Hyper-V nodes in order to facilitate some servers. At the same time, empty hosts can be disabled until they become necessary. At such moments, hosts can be put in a backup state, and the load can be redistributed to effectively use the available resources.

There are several prerequisites that must be met in order to use energy optimization. At first, you will need a suitable failover cluster. Typically, a cluster will need at least five hosts, but 4 can also be used if the cluster was created using VMM. The reason is that power optimization is designed to keep the cluster from losing quorum. In this situation, it will keep the minimum number of cluster hosts online, plus one additional node (in case of failure).

Typically, the fewest hosts that can support this model are five. In a  five-node cluster, at least three nodes must remain online to maintain a quorum. With the addition of 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. Hence the five-nodalA cluster is the smallest cluster that can benefit from power optimization, with one exception: if a 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). 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 involvement.

At Microsoft, setting up energy-saving features is easy: open the VMM console, then find the group of nodes containing the cluster for which you want to turn on energy 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 energy-saving features. This checkbox is not available by default, but can be enabled by selecting the option of automatic transfer of virtual machines for workload distribution, as shown in Figure 4.


Figure 4. Enable automatic load balancing before enabling power consumption optimization.

Before you turn on the power saving function, you should pay attention to two parameters. At first, “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, which will occur so often that they will ultimately affect performance.

Another parameter is the frequency of load balancing. This number determines how often VMM checks if virtual machines need Live Migrations. The reason why you should pay attention to this value is because it is also used to optimize nutrition. When nodes are de-energized as a result of the power optimization function, VMM by default checks every 10 minutes to see if nodes need to be returned online.

If you click the “Settings” 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 configure the energy optimization schedule and the corresponding set of threshold values.


Figure 5. Setting the schedule for optimizing energy consumption

Keep in mind that the cluster nodes will not automatically shut down only after reaching the set time. Before shutting down any nodes, VMM verifies that virtual machines can be transferred to other cluster nodes in working order without affecting performance and without depleting the hardware resources of the remaining nodes to the level of any 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 typically make up a significant percentage of the total IT budget . It is worth the time to develop a power plan for each Hyper-V host in each company to gain the potential to reduce energy consumption and ultimately lower operating costs.


Also popular now: