Introduction to KVM Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.

Slides:



Advertisements
Similar presentations
With ovirt & virt manager
Advertisements

Virtual Machine Technology Dr. Gregor von Laszewski Dr. Lizhe Wang.
Differentiated I/O services in virtualized environments
© 2010 VMware Inc. All rights reserved Confidential Performance Tuning for Windows Guest OS IT Pro Camp Presented by: Matthew Mitchell.
NWCLUG 01/05/2010 Jared Moore Xen Open Source Virtualization.
Virtual Machine Security Design of Secure Operating Systems Summer 2012 Presented By: Musaad Alzahrani.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 11 Windows Server 2008 Virtualization.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
VMware Infrastructure Alex Dementsov Tao Yang Clarkson University Feb 28, 2007.
Lesson 7: Creating and Configuring Virtual Machine Settings
A comparison between xen and kvm Andrea Chierici Riccardo Veraldi INFN-CNAF.
Virtualization B. Ramamurthy. References Practical Virtualization Solutions: Virtualization from the Trenches by K. Hess and A. Newman, Prentice-Hall.
Introducing VMware vSphere 5.0
Virtualization for Cloud Computing
Virtualization 101.
LINUX Virtualization Running other code under LINUX.
Virtual Network Servers. What is a Server? 1. A software application that provides a specific one or more services to other computers  Example: Apache.
Windows 7 Windows Server 2008 R2 VirtualizationVirtualization Heterogeneous Server Environment Inventory Linux, Unix & VMware Windows 7 & Server 2008.
VMware vCenter Server Module 4.
Virtualization 101.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 3 Desktop Virtualization McGraw-Hill.
Methodologies, strategies and experiences Virtualization.
Tanenbaum 8.3 See references
Operating System Virtualization
An Introduction to Xen Prof. Chih-Hung Wu
CERN IT Department CH-1211 Genève 23 Switzerland t Virtualization with Windows at CERN Juraj Sucik, Emmanuel Ormancey Internet Services Group.

INTRODUCTION TO CLOUD COMPUTING CS 595 LECTURE 7 2/23/2015.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
SAIGONTECH COPPERATIVE EDUCATION NETWORKING Spring 2010 Seminar #1 VIRTUALIZATION EVERYWHERE.
SAIGONTECH COPPERATIVE EDUCATION NETWORKING Spring 2009 Seminar #1 VIRTUALIZATION EVERYWHERE.
Virtualization. Virtualization  In computing, virtualization is a broad term that refers to the abstraction of computer resources  It is "a technique.
Module 7: Hyper-V. Module Overview List the new features of Hyper-V Configure Hyper-V virtual machines.
Chapter 8 Implementing Disaster Recovery and High Availability Hands-On Virtual Computing.
Appendix B Planning a Virtualization Strategy for Exchange Server 2010.
Secure & flexible monitoring of virtual machine University of Mazandran Science & Tecnology By : Esmaill Khanlarpour January.
Virtualization Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is licensed.
Xen Virtualization Last Update Copyright 2011 Kenneth M. Chipps Ph.D.
INTRODUCTION TO VIRTUALIZATION KRISTEN WILLIAMS MOSES IKE.
VMware vSphere Configuration and Management v6
Full and Para Virtualization
© Copyright 2011 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. HP Restricted Module 7.
Enabling Technologies for Distributed Computing Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing,
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
Operating-System Structures
Course 03 Basic Concepts assist. eng. Jánó Rajmond, PhD
KVM tutorial #3 Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
Libvirt management Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
Performance analysis comparison Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
Unit 2 VIRTUALISATION. Unit 2 - Syllabus Basics of Virtualization Types of Virtualization Implementation Levels of Virtualization Virtualization Structures.
KVM tutorial #2 Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
A comparison between xen and kvm Andrea Chierici Riccardo Veraldi INFN-CNAF CCR 2009.
Intro To Virtualization Mohammed Morsi
Open Source Virtualization Andrey Meganov RHCA, RHCX Consultant / VDEL
Virtualization Neependra Khare
Welcome to the Virtual Machine Mark Cyzyk The Sheridan Libraries Johns Hopkins University.
Daniel P. Berrangé Principal Software Engineer, Red Hat.
Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Virtualization for Cloud Computing
Virtualization.
L2- Virtualization Technology
London OpenStack Meetup, July 2012 libvirt & KVM with OpenStack Nova
Virtualization with libvirt Kashyap Chamarthy
Virtualization overview
Xen Summit Spring 2007 Platform Virtualization with XenEnterprise
Running other code under LINUX
OS Virtualization.
Virtualization 101.
Virtualization Techniques
Windows Virtual PC / Hyper-V
Presentation transcript:

Introduction to KVM Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010

What is KVM Kernel Virtual Machine Is a Full virtualization solution for Linux on AMD64 and Intel 64 hardware Is a Linux kernel module built for the standard Linux kernel Can run multiple, unmodified virtualized guest Windows and Linux operating systems The KVM hypervisor in Red Hat Enterprise Linux is managed with the libvirt API and tools built for libvirt, virt-manager and virsh. Andrea Chierici2

Guest mode With KVM every virtual machine is a regular Linux process, scheduled by the standard Linux scheduler. KVM adds a third mode to the standard kernel and user modes, the guest mode.  Guest mode processes are processes that are run from within the virtual machine.  The guest mode, just like the normal mode, has its own kernel and user-space variations. Andrea Chierici3

Key Features (1) Overcommitting  allocating more virtualized CPUs or memory than the available resources on the system.  CPU overcommitting allows virtualized guests to run on fewer servers and in higher densities.  Memory overcommitting allows hosts to utilize memory and virtual memory to increase guest densities. Andrea Chierici4

Key Features (2) KSM  Kernel SamePage Merging (KSM) is used by the KVM hypervisor to allow KVM guests to share identical memory pages  These shared pages are usually common libraries or other identical, high-use data.  KSM allows for greater guest density of identical or similar guest operating systems by avoiding memory duplication. Andrea Chierici5

KVM installation A typical KVM installation consists of the following components:  Device driver for managing the virtualization hardware; this driver exposes its capabilities via a character device /dev/kvm.  User-space component for emulating PC hardware; currently, this is handled in the user space and is a lightly modified QEMU process.  The I/O model is directly derived from QEMU’s, with support for copy-on-write disk images and other QEMU features. Andrea Chierici6

Packages To fully utilize the KVM support built into the kernel the following packages are required:  qemu-kvm  virt-manager  virt-viewer  python-virtinst Andrea Chierici7

Architecture Andrea Chierici8

QEMU KVM uses a program called QEMU QEMU is a process emulator that offers many features:  can save and restore the state of the virtual machine with all programs running  VMs can be equipped with many types of hardware, and virtual hard disk images can be stored so that they only take up disk space that the guest OS actually uses  Uses VNC to access the VM display  The OS can be installed both locally on the virtualization node HDDs or on the SAN. Booting VMs from SAN allows having diskless servers.  KVM has the ability to take advantage of the latest kernel optimizations, advancements and hardware compatibility Andrea Chierici9

qcow2 qcow2 is a QEMU disk image format. It is a copy-on-write format. QEMU can use a base image which is read-only, and store all writes to the qcow2 image. Versatile format Use it to have smaller images (useful if your filesystem does not support holes, for example on FAT32),  optional AES encryption,  zlib based compression and support of multiple VM snapshots Andrea Chierici10

Libvirt Libvirt is a hypervisor-independent virtualization API that is able to interact with the virtualization capabilities of a range of operating systems. libvirt is free software available under the GNU Lesser General Public License. The libvirt project aims to provide a long term stable C API. The libvirt Open Source project currently supports Xen, Qemu, KVM, LXC, OpenVZ, VirtualBox, OpenNebula, and VMware ESX. The RHEL libvirt package supports Xen and KVM on RHEL5 and only KVM on RHEL6 Andrea Chierici11

virsh The virsh command-line tool is built on the libvirt management API operates as an alternative to the graphical virt-manager application can be used  read-only mode by unprivileged users  with root access, full administration functionality. Ideal for scripting virtualization administration Included in the libvirt-client package. Andrea Chierici12

virt-manager graphical desktop tool for managing virtualized guests can be used to perform virtualization administration, virtualized guest creation, migration and configuration tasks allows access to graphical guest consoles can view virtualized guests, host statistics, device information and performance graphs can manage the local hypervisor and remote hypervisors using the same interface and methods. Andrea Chierici13

Difference between KVM and Xen Xen is an external hypervisor  assumes control of the machine and divides resources among guests.  it does have its own scheduler, memory manager, and machine intialization packages added to Linux  On the other hand, KVM is part of Linux and uses the regular Linux scheduler and memory management. KVM is much smaller and simpler to use; it is also more featureful; for example KVM can swap guests to disk in order to free RAM. KVM only run on processors that supports x86 hvm (vt/svm instructions set)  Xen allows running modified operating systems on non-hvm x86 processors using a technique called paravirtualization.  KVM does not support paravirtualization for CPU but may support paravirtualization for device drivers to improve I/O performance. Andrea Chierici14

Difference between KVM and VMware VMware is a proprietary product. KVM is Free Software released under the GPL. Vmware is primarily a piece of software that fully virtualizes the x86 architecture. It is pretty much the industry standard and has great performance scalability. large and complex software package Andrea Chierici15

Difference between KVM and QEMU QEMU uses emulation; KVM uses processor extensions (HVM) for virtualization. Andrea Chierici16

Virtualized and emulated devices Emulated devices are virtual devices which exist entirely in software.  Emulated devices do not require a real hardware device to back them. Emulated drivers may use either a physical device or a virtual software device  The device level instructions are completely translated by the KVM hypervisor A system has a number of virtual CPUs (VCPUs) relative to the number of physical processor cores.  The number of virtual CPUs is finite and represents the total number of virtual CPUs that can be assigned to guest virtual machines. Andrea Chierici17

Para-virtualized drivers (1) Para-virtualized drivers are device drivers that increase the I/O performance of virtualized guests.  Para-virtualized drivers decrease I/O latency and increase I/O throughput to near bare-metal levels  must be installed on the guest operating system Included in latest RHEL4,5,6 Must be manually installed on windows guests Andrea Chierici18

Para-virtualized drivers (2) Para-virtualized network driver Para-virtualized block driver  all storage devices supported by the hypervisor attached to the virtualized guest Para-virtualized clock Balloon driver  allows guests to express to the hypervisor how much memory they require  allows the host to efficiently allocate memory to the guest and allow free memory to be allocated to other guests and processes  Guests can mark sections of the guest's RAM as not in use (balloon inflation)  When the guest requires the freed memory again, the hypervisor can reallocate RAM to the guest (balloon deflation) Andrea Chierici19

KVM VM Migration (1) Migration is the term for the process of moving a virtualized guest from one host to another  Offline  Live useful for:  Load balancing - guests can be moved to hosts with lower usage  Hardware failover - when hardware devices on the host start to fail  Energy saving - guests can be redistributed to other hosts and host systems powered off to save energy and cut costs in low usage periods.  Geographic migration - guests can be moved to another location for lower latency or in serious circumstances Andrea Chierici20

KVM VM Migration (2) Migration only moves the virtualized guest's memory.  The guest's storage is located on networked storage which is shared between the source host and the destination.  Without shared storage migration is not possible Offline migration suspends the guest then moves an image of the guest's memory to the destination host Live migration is the process of migrating a running guest from one physical host to another physical host Andrea Chierici21

KVM requirements The KVM hypervisor requires:  an Intel processor with the Intel VT and the Intel 64 extensions, or  an AMD processor with the AMD-V and the AMD64 extensions. The working guest storage methods are:  files on local storage,  physical disk partitions,  locally connected physical LUNs,  LVM partitions,  NFS shared file systems,  iSCSI,  GFS2 clustered file systems, and  Fibre Channel-based LUNs  SRP devices (SCSI RDMA Protocol), the block export protocol used in Infiniband and 10GbE iWARP adapters. Andrea Chierici22

KVM limitations Virtualized guests support up to a maximum of 64 virtualized CPUs in Red Hat Enterprise Linux 6.0 It is not recommended to have more than 10 virtual CPUs per physical processor core SCSI emulation is limited to 16 virtualized (emulated) SCSI devices. KVM is limited to a maximum of four virtualized (emulated) IDE devices per guest Para-virtualized devices, which use the virtio drivers, are PCI devices. Presently, guests are limited to a maximum of 32 PCI devices Live migration is only possible with CPUs from the same vendor (that is, Intel to Intel or AMD to AMD only). Andrea Chierici23

Application limitations There are aspects of virtualization which make virtualization unsuitable for certain types of applications. Applications with high I/O throughput requirements should use the para-virtualized drivers for fully virtualized guests.  Without the para-virtualized drivers certain applications may be unstable under heavy I/O loads.  The following applications should be avoided for their high I/O requirement reasons: kdump, netdump servers Andrea Chierici24

KVM compatibility Operating systemSupport level Red Hat Enterprise Linux 3 x86Optimized with para-virtualized drivers Red Hat Enterprise Linux 4 x86Optimized with para-virtualized drivers Red Hat Enterprise Linux 4 AMD 64 and Intel 64Optimized with para-virtualized drivers Red Hat Enterprise Linux 5 x86Optimized with para-virtualized drivers Red Hat Enterprise Linux 5 AMD 64 and Intel 64Optimized with para-virtualized drivers Red Hat Enterprise Linux 6 x86Optimized with para-virtualized drivers Red Hat Enterprise Linux 6 AMD 64 and Intel 64Optimized with para-virtualized drivers Fedora 12 x86Optimized with para-virtualized drivers Fedora 12 AMD 64 and Intel 64Optimized with para-virtualized drivers Fedora 13 x86Optimized with para-virtualized drivers Fedora 13 AMD 64 and Intel 64Optimized with para-virtualized drivers Windows Server 2003 R2 32-BitOptimized with para-virtualized drivers Windows Server 2003 R2 64-BitOptimized with para-virtualized drivers Windows Server 2003 Service Pack 2 32-BitOptimized with para-virtualized drivers Windows Server 2003 Service Pack 2 64-BitOptimized with para-virtualized drivers Windows XP 32-BitOptimized with para-virtualized drivers Windows Vista 32-BitSupported Windows Vista 64-BitSupported Windows Server BitOptimized with para-virtualized drivers Windows Server 2008 (and R2) 64-BitOptimized with para-virtualized drivers Windows 7 32-BitOptimized with para-virtualized drivers Windows 7 64-BitOptimized with para-virtualized drivers Andrea Chierici25

References KVM: Libvirt: QEMU: Gruppo virtualizzazione CCR Andrea Chierici26