Energy Management for Hypervisor-Based Virtual Machines
Total Page:16
File Type:pdf, Size:1020Kb
Energy Management for Hypervisor-Based Virtual Machines Jan Stoess Christian Lang Frank Bellosa System Architecture Group, University of Karlsruhe, Germany {stoess, chlang, bellosa}@ira.uka.de Abstract Research has proposed several approaches to OS di- Current approaches to power management are rected control over a computer’s energy consump- based on operating systems with full knowledge of tion, including user- and service-centric management and full control over the underlying hardware; the schemes. However, most current approaches to en- distributed nature of multi-layered virtual machine ergy management are developed for standard, legacy environments renders such approaches insufficient. OSes with a monolithic kernel. A monolithic kernel In this paper, we present a novel framework for en- has full control over all hardware devices and their ergy management in modular, multi-layered oper- modes of operation; it can directly regulate device ating system structures. The framework provides activity or energy consumption to meet thermal or a unified model to partition and distribute energy, energy constraints. A monolithic kernel also controls and mechanisms for energy-aware resource account- the whole execution flow in the system. It can easily ing and allocation. As a key property, the frame- track the power consumption at the level of individ- work explicitly takes the recursive energy consump- ual applications and leverage its application-specific tion into account, which is spent, e.g., in the virtu- knowledge during device allocation to achieve dy- alization layer or subsequent driver components. namic and comprehensive energy management. Our prototypical implementation targets hyper- Modern VM environments, in contrast, consist of visor-based virtual machine systems and comprises a distributed and multi-layered software stack in- two components: a host-level subsystem, which con- cluding a hypervisor, multiple VMs and guest OSes, trols machine-wide energy constraints and enforces device driver modules, and other service infrastruc- them among all guest OSes and service components, ture (Figure 1). In such an environment, direct and, complementary, an energy-aware guest oper- and centralized energy management is unfeasible, as ating system, capable of fine-grained application- device control and accounting information are dis- specific energy management. Guest level energy tributed across the whole system. management thereby relies on effective virtualiza- At the lowest-level of the virtual environment, tion of physical energy effects provided by the vir- the privileged hypervisor and host driver modules tual machine monitor. Experiments with CPU and have direct control over hardware devices and their disk devices and an external data acquisition system energy consumption. By inspecting internal data demonstrate that our framework accurately controls structures, they can obtain coarse-grained per-VM and stipulates the power consumption of individual information on how energy is spent on the hard- hardware devices, both for energy-aware and energy- ware. However, the host level does not possess any unaware guest operating systems. knowledge of the energy consumption of individual applications. Moreover, with the ongoing trend to 1 Introduction restrict the hypervisor’s support to a minimal set of hardware and to perform most of the device control Over the past few years, virtualization technology in unprivileged driver domains [8,15], hypervisor and has regained considerable attention in the design of driver modules each have direct control over a small computer systems. Virtual machines (VMs) estab- set of devices; but they are oblivious to the ones not lish a development path for incorporating new func- managed by themselves. tionality – server consolidation, transparent migra- The guest OSes, in turn, have intrinsic knowledge tion, secure computing, to name a few – into a sys- of their own applications. However, guest OSes oper- tem that still retains compatibility to existing oper- ate on deprivileged virtualized devices, without di- ating systems (OSes) and applications. At the very rect access to the physical hardware, and are un- same time, the ever increasing power density and dis- aware that the hardware may be shared with other sipation of modern servers has turned energy man- VMs. Guest OSes are also unaware of the side- agement into a key concern in the design of OSes. effects on power consumption caused by the vir- USENIX Association 2007 USENIX Annual Technical Conference 1 Applications Applications global, system-wide notion into a local, component- or user-specific one. The second contribution is a Guest OS Guest OS vCPU vNIC vDISK vCPU vNIC vDISK distributed energy accounting approach, which ac- curately tracks back the energy spent in the system Service Drv. NIC Drv. DISK to originating activities. In particular, the presented vCPU vCPU vCPU approach incorporates both the direct and the side- Hypervisor CPU effectual energy consumption spent in the virtual- ization layers or subsequent driver components. As the third contribution, our framework exposes all re- Figure 1: Increasing number of layers and components source allocation mechanisms from drivers and other in today’s virtualization-based OSes. resource managers to the respective energy manage- ment subsystems. Exposed allocation enables dy- tual device logic: since virtualization is transpar- namic and remote regulation of energy consumption ent, the “hidden”, or recursive power consumption, in a way that the overall consumption matches the which the virtualization layer itself causes when re- desired constraints. quiring the CPU or other resources simply vanishes We have implemented a prototype that targets unaccounted in the software stack. Depending on hypervisor-based systems. We argue that virtual the complexity of the interposition, resource require- server environments benefit from energy manage- ments can be substantial: a recent study shows ment within and across VMs; hence the prototype that the virtualization layer requires a considerable employs management software both at host-level amount of CPU processing time for I/O virtualiza- and at guest-level. A host-level management subsys- tion [5]. tem enforces system-wide energy constraints among The whole situation is even worsened by the non- all guest OSes and driver or service components. partitionability of some of the physical effects of It accounts direct and hidden power consumption power dissipation: the temperature of a power con- of VMs and regulates the allocation of physical de- suming device, for example, cannot simply be par- vices to ensure that each VM does not consume more titioned among different VMs in a way that each than a given power allotment. Naturally, the host- one gets alloted its own share on the temperature. level subsystem performs independent of the guest Beyond the lack of comprehensive control over and operating system; on the downside, it operates at knowledge of the power consumption in the system, low level and in coarse-grained manner. To ben- we can thus identify the lack of a model to com- efit from fine-grained, application-level knowledge, prehensively express physical effects of energy con- we have complemented the host-level part with an sumption in distributed OS environments. optional energy-aware guest OS, which redistributes To summarize, current power management the VM-wide power allotments among its own, sub- schemes are limited to legacy OSes and unsuitable ordinate applications. In analogy to the host-level, for VM environments. Current virtualization solu- where physical devices are allocated to VMs, the tions disregard most energy-related aspects of the guest OS regulates the allocation of virtual devices hardware platform; they usually virtualize a set of to ensure that its applications do not spend more standard hardware devices only, without any special energy than their alloted budget. power management capabilities or support for en- Our experiments with CPU and disk devices ergy management. Up to now, power management demonstrate that the prototype effectively accounts for VMs is limited to the capabilities of the host OS and regulates the power consumption of individual in hosted solutions and mostly dispelled from the physical and virtual devices, both for energy-aware server-oriented hypervisor solutions. and energy-unaware guest OSes. Observing these problems, we present a novel The rest of the paper is structured as follows: In framework for managing energy in distributed, Section 2, we present a generic model to energy man- multi-layered OS environments, as they are com- agement in distributed, multi-layered OS environ- mon in today’s computer systems. Our framework ments. We then detail our prototypical implementa- makes three contributions. The first contribution is tion for hypervisor-based systems in Section 3. We a model for partitioning and distributing energy ef- present experiments and results in Section 4. We fects; our model solely relies on the notion of energy then discuss related approaches in Section 5, and fi- as the base abstraction. Energy quantifies the phys- nally draw a conclusion and outline future work in ical effects of power consumption in a distributable Section 6. way and can be partitioned and translated from a 2 2007 USENIX Annual Technical Conference USENIX Association 2 Distributed Energy Management the temperature of a device. Such effects can easily be expressed as energy constraints, by means of a The following