KVM: Kernel-based Virtualization Driver



Similar documents
kvm: Kernel-based Virtual Machine for Linux

Scaling Microsoft Exchange in a Red Hat Enterprise Virtualization Environment

Advanced Computer Networks. Network I/O Virtualization

Full and Para Virtualization

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

How To Understand The Power Of A Virtual Machine Monitor (Vm) In A Linux Computer System (Or A Virtualized Computer)

Architecture of the Kernel-based Virtual Machine (KVM)

Virtualization. Types of Interfaces

KVM Architecture Overview

Virtualization in Linux KVM + QEMU

Virtual Machines. COMP 3361: Operating Systems I Winter

kvm: the Linux Virtual Machine Monitor

The Microsoft Windows Hypervisor High Level Architecture

Virtualization. Pradipta De

VMkit A lightweight hypervisor library for Barrelfish

Virtualization Technologies

Virtual machines and operating systems

The MIPS architecture and virtualization

Kernel Virtual Machine

VMware Server 2.0 Essentials. Virtualization Deployment and Management

COS 318: Operating Systems. Virtual Machine Monitors

Hypervisors and Virtual Machines

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Beyond the Hypervisor

HRG Assessment: Stratus everrun Enterprise

A technical review on comparison of Xen and KVM hypervisors: An analysis of virtualization technologies

IOS110. Virtualization 5/27/2014 1

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

The Art of Virtualization with Free Software

KVM Security Comparison

Date: December 2009 Version: 1.0. How Does Xen Work?

KVM KERNEL BASED VIRTUAL MACHINE

Virtualization. Dr. Yingwu Zhu

KVM Virtualized I/O Performance

RED HAT ENTERPRISE VIRTUALIZATION

Nested Virtualization

Using Linux as Hypervisor with KVM

Database Virtualization

A quantitative comparison between xen and kvm

OVA KVM THE SOLUTION. Virtually Unmatched. Get to know KVM. Low cost, super secure and infinitely scalable. JOIN WHAT IS GET SECURITY LOW COST

Comparing Virtualization Technologies

Anh Quach, Matthew Rajman, Bienvenido Rodriguez, Brian Rodriguez, Michael Roefs, Ahmed Shaikh

RED HAT ENTERPRISE VIRTUALIZATION & CLOUD COMPUTING

Cloud Computing CS

Enabling Technologies for Distributed Computing

Assessing the Performance of Virtualization Technologies for NFV: a Preliminary Benchmarking

Operating Systems. Lecture 03. February 11, 2013

FRONT FLYLEAF PAGE. This page has been intentionally left blank

Chapter 5 Cloud Resource Virtualization

VIRTUALIZATION 101. Brainstorm Conference 2013 PRESENTER INTRODUCTIONS

Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM

CPS221 Lecture: Operating System Structure; Virtual Machines

Virtualization. Jukka K. Nurminen

Introduction to Virtualization & KVM

Virtual Machines.

High-performance vnic framework for hypervisor-based NFV with userspace vswitch Yoshihiro Nakajima, Hitoshi Masutani, Hirokazu Takahashi NTT Labs.

Virtualization. Explain how today s virtualization movement is actually a reinvention

HP Data Protector software. Assuring Business Continuity in Virtualised Environments

Operating System Organization. Purpose of an OS

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

Enabling Technologies for Distributed and Cloud Computing

RCL: Design and Open Specification

Security Overview of the Integrity Virtual Machines Architecture

Virtualization Technology. Zhiming Shen

Virtualization Performance on SGI UV 2000 using Red Hat Enterprise Linux 6.3 KVM

The Benefits of POWER7+ and PowerVM over Intel and an x86 Hypervisor

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Red Hat VDI. David Simmons

Xen and the Art of. Virtualization. Ian Pratt

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

BHyVe. BSD Hypervisor. Neel Natu Peter Grehan

Intel Embedded Virtualization Manager

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Building Docker Cloud Services with Virtuozzo

How To Create A Cloud Based System For Aaas (Networking)

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization. Jia Rao Assistant Professor in CS

Cloud Architecture and Virtualisation. Lecture 4 Virtualisation

evm Virtualization Platform for Windows

Intro to Virtualization

Virtualization and the U2 Databases

GUEST OPERATING SYSTEM BASED PERFORMANCE COMPARISON OF VMWARE AND XEN HYPERVISOR

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Hypervisor Software and Virtual Machines. Professor Howard Burpee SMCC Computer Technology Dept.

Masters Project Proposal

Installing & Using KVM with Virtual Machine Manager COSC 495

KVM, OpenStack, and the Open Cloud

Introduction of Virtualization Technology to Multi-Process Model Checking

Dynamic Load Balancing of Virtual Machines using QEMU-KVM

CSC 2405: Computer Systems II

Cloud Server. Parallels. Key Features and Benefits. White Paper.

Hybrid Virtualization The Next Generation of XenLinux

RCL: Software Prototype

Basics of Virtualisation

Securing Your Cloud with Xen Project s Advanced Security Features

Transcription:

KVM: Kernel-based Virtualization Driver White Paper

Overview The current interest in virtualization has led to the creation of several different hypervisors. Most of these, however, predate hardware-assisted x86 virtualization, and are therefore somewhat complex pieces of software. With the advent of Intel VT (Virtualization Technology) and AMD's SVM (Secure Virtual Machine), writing a hypervisor has become significantly easier and it is now possible to enjoy the benefits of virtualization while leveraging existing open source achievements to date. Common Hypervisor Model The common hypervisor model in use today consists of a software layer which multiplexes the hardware among several guest operating systems. The hypervisor performs basic scheduling and memory management, and typically delegates management and I/O functions to a special, privileged, guest. I/O proxy Privileged kernel I/O proxy Unprivileged 1 Unprivileged 2 Hypervisor Figure 1 Hypervisor Based Architecture Today's hardware, however is becoming increasingly complex. The so-called basic scheduling operations have to take into account multiple hardware threads on a core, multiple cores on a socket, and multiple sockets on a system. Similarly, on-chip memory controllers require that memory management take into effect the Non-Uniform Memory Access (NUMA) characteristics of a system. While great effort is invested into adding these capabilities to hypervisors, we already have a mature scheduler and memory management system that handles these issues very well the Linux kernel. Copyright 2006 Qumranet Inc. 2

Linux as a Hypervisor By adding virtualization capabilities to a standard Linux kernel, we can enjoy all the fine-tuning work that has gone (and is going) into the kernel, and bring that benefit into a virtualized environment. Under this model, every virtual machine is a regular Linux process scheduled by the standard Linux scheduler. Its memory is allocated by the Linux memory allocator, with its knowledge of NUMA and integration into the scheduler. A normal Linux process has two modes of execution: kernel and user. Kvm adds a third mode: guest mode (which has its own kernel and user modes, but these do not interest the hypervisor at all). Normal User Process Normal User Process mode Qemu I/O mode Qemu I/O Linux Kernel KVM Driver Figure 2 kvm Based Architecture The division of labor among the different modes is: mode: execute non-i/o guest code Kernel mode: switch into guest mode, and handle any exits from guest mode due to I/O or special instructions. User mode: perform I/O on behalf of the guest. By integrating into the kernel, the kvm 'hypervisor' automatically tracks the latest hardware and scalability features without additional effort. A Minimal System One of the advantages of the traditional hypervisor model is that it is a minimal system (see Figure 2 above), consisting of only a few hundred thousands lines of code. However, this view does not take into account the privileged guest. This guest has access to all system memory, either through hypercalls or by Copyright 2006 Qumranet Inc. 3

programming the DMA hardware. A failure of the privileged guest is not recoverable as the hypervisor is not able to restart it if it fails. A kvm based system's privilege footprint is truly minimal: only the host kernel plus a few thousand lines of the kernel mode driver have unlimited hardware access. kvm Components The simplicity of kvm is exemplified by its structure; there are two components: A device driver for managing the virtualization hardware; this driver exposes its capabilities via a character device /dev/kvm A user-space component for emulating PC hardware; this is a lightly modified qemu process The modified qemu process mmap()s the guest's physical memory and calls the kernel mode driver to execute in guest mode. The I/O model is directly derived from qemu's, with support for copy-on-write disk images and other qemu features. I/O Performance The kvm model has some performance advantage when performing I/O on behalf of the guest 1. Consider the sequence of events in a privileged-guest system: issues an I/O instruction Hypervisor traps the I/O instruction and forwards it to the privileged guest (some instructions may be handled internally) The hypervisor's scheduler has to schedule the privileged guest A guest switch is performed into the privileged guest The privileged guest's interrupt handler is invoked, which causes an I/O process to be scheduled using the privileged guest's scheduler A process context switch is performed The I/O process initiates the I/O on behalf of the guest The I/O process signals (through the privileged guest kernel and hypervisor) that the I/O initiation is complete The hypervisor switches back into the original guest 1 We acknowledge the fact the mentioned performance benefit is of unknown measure at this point, no comparative benchmarks were ran to quantify it. This should be viewed qualitatively. Copyright 2006 Qumranet Inc. 4

The hypervisor resumes the guest code Same sequence on a kvm host: issues an I/O instruction Host kernel traps the instruction and exits into the VM's userspace (some instructions may be handled in kernel mode) The VM's user-space initiates the I/O on behalf of the guest The VM's user-space returns to the kernel The kernel resumes guest code Management Since a virtual machine is simply a process, all of the standard Linux process management tools apply: one can destroy, pause, and resume a virtual machine with the kill command (or even using Ctrl-C and similar keyboard shortcuts) and view resource usage with top. Permissions are handled by the normal Linux method: the virtual machine belongs to the user who started it (which need not be root; all that is required is access to /dev/kvm), and all accesses are verified by the kernel. This allows system administrators to manage virtual machines with existing tools, allowing systems to be virtualized incrementally. Conclusions Leveraging new silicon capabilities, the kvm model introduces an approach to virtualization that is fully aligned with Linux architecture and all of its latest achievements. Furthermore, integrating the hypervisor capabilities into a host Linux kernel as a loadable module can simplify management and improve performance in virtualized environments, while minimizing impact on existing systems. Copyright 2006 Qumranet Inc. 5