KVM: Virtualisation The Linux Way Amit Shah GEEP.

Slides:



Advertisements
Similar presentations
Content Overview Virtual Disk Port to Intel platform
Advertisements

Virtualization Technology
XEN AND THE ART OF VIRTUALIZATION Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, lan Pratt, Andrew Warfield.
Bart Miller. Outline Definition and goals Paravirtualization System Architecture The Virtual Machine Interface Memory Management CPU Device I/O Network,
G Robert Grimm New York University Disco.
Xen and the Art of Virtualization A paper from the University of Cambridge, presented by Charlie Schluting For CS533 at Portland State University.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
1 Disco: Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine, and Mendel Rosenblum, Stanford University, 1997.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Virtualization for Cloud Computing
Virtual Machine Monitors CSE451 Andrew Whitaker. Hardware Virtualization Running multiple operating systems on a single physical machine Examples:  VMWare,
LINUX Virtualization Running other code under LINUX.
虛擬化技術 Virtualization and Virtual Machines
E Virtual Machines Lecture 4 Device Virtualization
Virtualization-optimized architectures
Tanenbaum 8.3 See references
Zen and the Art of Virtualization Paul Barham, et al. University of Cambridge, Microsoft Research Cambridge Published by ACM SOSP’03 Presented by Tina.
CS 149: Operating Systems April 21 Class Meeting
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Benefits: Increased server utilization Reduced IT TCO Improved IT agility.
Xen I/O Overview. Xen is a popular open-source x86 virtual machine monitor – full-virtualization – para-virtualization para-virtualization as a more efficient.
Virtualization Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is licensed.
Virtualization: Not Just For Servers Hollis Blanchard PowerPC kernel hacker.
Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
Cloud Operating System Unit 09 Cloud OS Core Technology M. C. Chiang Department of Computer Science and Engineering National Sun Yat-sen University Kaohsiung,
02/09/2010 Industrial Project Course (234313) Virtualization-aware database engine Final Presentation Industrial Project Course (234313) Virtualization-aware.
Virtualisation Front Side Buses SMP systems COMP Jamie Curtis.
Introduction to virtualization
Full and Para Virtualization
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
Introduction Why are virtual machines interesting?
Operating-System Structures
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Extending Xen * with Intel ® Virtualization Technology Mobile Embedded System Choi, Jin-yong
Cloud Computing – UNIT - II. VIRTUALIZATION Virtualization Hiding the reality The mantra of smart computing is to intelligently hide the reality Binary->
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Virtualization Neependra Khare
Virtualization Overview Date: 8/7/2012 SCF-FEF-SSS Author: Tyler Parsons.
Virtualization-optimized architectures
Virtualization for Cloud Computing
Introduction to Virtualization
Virtualization.
Virtual Machine Monitors
Virtualization Technology
Kernel Design & Implementation
Presented by Yoon-Soo Lee
Virtual Machines: Versatile Platforms for Systems and Processes
Virtualization overview
Morgan Kaufmann Publishers
Disco: Running Commodity Operating Systems on Scalable Multiprocessors
Running other code under LINUX
CS 140 Lecture Notes: Virtual Machines
OS Virtualization.
Virtualization Techniques
A Survey on Virtualization Technologies
Computer Security: Art and Science, 2nd Edition
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Introduction to Virtual Machines
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Introduction to Virtual Machines
Xen and the Art of Virtualization
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
CS295: Modern Systems Virtualization
Presentation transcript:

KVM: Virtualisation The Linux Way Amit Shah GEEP

Copyright © 2007 Qumranet, Inc. All rights reserved. Virtualisation Strategies “Native” Hypervisors Have a runtime Need a “primary” guest OS Examples: Xen, VMWare ESX Server, IBM mainframes Containers Different namespaces for different guests Run on host kernel Userland can be different from host Examples: OpenVZ, FreeVPS, Linux-Vserver Paravirtualisation Emulation Examples: QEMU, PearPC

Copyright © 2007 Qumranet, Inc. All rights reserved. 3 KVM: Architectures Supported S390 IBM mainframes: a hypervisor is a must Included in IA-64 Included in X86 Included in KVM-lite: PV Linux guest on non-VTx / non-SVM host (proposed) PowerPC PV Architecture support for hypervisor Included in

Copyright © 2007 Qumranet, Inc. All rights reserved. X86 Hardware Extensions 'guest mode' in addition to user and kernel modes Raise a trap for all privileged instructions Virtualised registers Processor Intel-VTx (VMX) AMD-V (SVM) MM EPT (Intel) NPT (AMD) IO VT-d (Intel) IOMMU (AMD)

Copyright © 2007 Qumranet, Inc. All rights reserved. 5 What's handled in the kernel? CPU virtualisation (special instructions) MMU virtualisation Local APIC, PIC, IOAPIC, PIT (guest) paravirtualised network and block device drivers virtio-net virtio-block (guest) paravirtualised kernel support code paravirt_ops MMU (guest) paravirtualised clock driver

Copyright © 2007 Qumranet, Inc. All rights reserved. 6 KVM Process Model kernel task guest task guest

Copyright © 2007 Qumranet, Inc. All rights reserved. 7 KVM Process Model (cont'd) ‏ Guests are scheduled as regular processes kill(1), top(1) work as expected Guest physical memory is mapped into the task's virtual memory space Virtual processors in one VM are threads

Copyright © 2007 Qumranet, Inc. All rights reserved. 8 KVM Execution Model Native Guest Execution Kernel Exit Handler Userspace Exit Handler Switch to Guest Mode ioctl() UserspaceKernelGuest Lightweight Exit Heavyweight Exit

Copyright © 2007 Qumranet, Inc. All rights reserved. 9 Flow Example: Memory Access Guest accesses an unmapped memory location Hardware traps into kernel mode kvm walks the guest page table, determines guest physical address kvm performs guest physical -> host physical translation kvm installs shadow page table entry containing guest virtual -> host physical translation Processor restarts execution of faulting instruction

Copyright © 2007 Qumranet, Inc. All rights reserved. Paravirtualisation Modifying guest OS for performance Virtio Common drivers for all hypervisors Hypervisor-specific backend KVM backend in qemu Faster performance Efficient block, net drivers Balloon lguest, KVM use it already PV DMA Pass through Ethernet devices paravirt_ops

Copyright © 2007 Qumranet, Inc. All rights reserved. Network Devices Fully virtualised device performance not great 55 Mbps for RTL Lots of IO-exits per packet Decided to implement a modern e1000 Advantages: All code in userspace (qemu) All existing drivers recognise device IRQ coalescing Only 2-3 IO-exits per packet Goes in excess of 800 Mbps

Copyright © 2007 Qumranet, Inc. All rights reserved. Virtio Net Shared memory between host and guest Two queues: recv and send Ring buffer within each queue 'available' pointer controlled by guest 'used' pointer controlled by host

Copyright © 2007 Qumranet, Inc. All rights reserved. Virtio-net on KVM Guest kernel BLKNET Virtio PCI QEMU Linux Shared Memory User- space

Copyright © 2007 Qumranet, Inc. All rights reserved. Ideas Shared memory between host and guest via virtio- pci Shared directory between host and guest using virtio + fuse VMGL (OpenGL for Virtual Machines) support

Copyright © 2007 Qumranet, Inc. All rights reserved. KVM Pros Leverages Linux scheduler, memory management, I/O No scheduler involvement for I/O Full virtualisation: No changes to the guest necessary Paravirt drivers available for better performance Uses existing Linux security model can run VM as ordinary user Uses existing management tools Power management Guest memory swapping Real-time scheduling, NUMA Leverages Linux development momentum: all new drivers, {cpu, disk} schedulers, file systems, etc supported

Copyright © 2007 Qumranet, Inc. All rights reserved. Distro / Industry interest libvirt Managing various guests under a hypervisor Support for Xen, KVM APIs between UI, middle layer and virtualisation backend Distributions Debian Ubuntu RedHat EL SLES Qumranet Dekstop Virtualisation

Copyright © 2007 Qumranet, Inc. All rights reserved. Release Philosophy Development snapshots every 1-2 weeks Release early and often Features introduces quickly Bugs fixed quickly Bugs added quickly Allows developers and users to track and test the latest and greatest Stable releases part of Linux 2.6.x With bugfixes going into Linux 2.6.x.y

Copyright © 2007 Qumranet, Inc. All rights reserved. Journey Linux (4 Feb 2007): Initial release Linux (25 Apr 2007): Stability, suspend/resume Linux (8 Jul 2007): Stable ABI Old userspace, new kernel New userspace, old kernel Linux (9 Oct 2007): SMP, performance Linux (24 Jan 2008): In-kernel APIC, preemptibility, virtio Linux (16 Apr 2008): Guest swapping, paravirt_ops, balloon drv Linux (soon): PowerPC, s390, IA64, NPT, EPT, more paravirt (mmu),...

Copyright © 2007 Qumranet, Inc. All rights reserved. KVM is Developer-friendly No need to reboot (usually) Netconsole, oprofile, all the tools work Small codebase Friendly community

Copyright © 2007 Qumranet, Inc. All rights reserved. Future Consolidate various virtualisation solutions existing in the kernel Started with move to virt/ from drivers/kvm/ More hardware features support More paravirtualisation support Improve guest scaling Better support for management layers like libvirt Intel Real Mode Emulation

Copyright © 2007 Qumranet, Inc. All rights reserved. Do Read virt/*, arch/[x86|ia64|s390|powerpc]/kvm/* KvmForum2007KvmForum2007 wiki page on

Thank You