SlideShare a Scribd company logo
1 of 22
Download to read offline
KVM: Virtualisation The
Linux Way
Amit Shah
amit.shah@qumranet.com




GEEP
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.
KVM: Architectures Supported

    S390
      IBM mainframes: a hypervisor is a must
      Included in 2.6.26
    IA-64
      Included in 2.6.26
    X86
      Included in 2.6.20
      KVM-lite: PV Linux guest on non-VTx / non-SVM host
      (proposed)
    PowerPC
      PV
      Architecture support for hypervisor
      Included in 2.6.26
3   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.
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

5   Copyright © 2007 Qumranet, Inc. All rights reserved.
KVM Process Model




                task           task      guest             task   task   guest




                                                 kernel


6   Copyright © 2007 Qumranet, Inc. All rights reserved.
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




7    Copyright © 2007 Qumranet, Inc. All rights reserved.
KVM Execution Model
        Userspace                              Kernel               Guest


                ioctl()

                                              Switch to
                                              Guest Mode

    Heavyweight                              Lightweight Exit   Native Guest
    Exit                                                         Execution

                                              Kernel
                                              Exit Handler


            Userspace
            Exit Handler

8   Copyright © 2007 Qumranet, Inc. All rights reserved.
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




9    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


                        BLK               NET
                                                          User-
                             Virtio PCI                   space
                            Guest kernel


                                                 QEMU
                                Shared
                                Memory

                                                  Linux




 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
 http://kvm.qumranet.com/kvmwiki/TODO




 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 Qumranet, Inc. All rights reserved.
  Copyright © 2007
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 2.6.20 (4 Feb 2007): Initial release
  Linux 2.6.21 (25 Apr 2007): Stability,
  suspend/resume
  Linux 2.6.22 (8 Jul 2007): Stable ABI
    Old userspace, new kernel
    New userspace, old kernel
 Linux 2.6.23 (9 Oct 2007): SMP, performance
 Linux 2.6.24 (24 Jan 2008): In-kernel APIC,
 preemptibility, virtio
 Linux 2.6.25 (16 Apr 2008): Guest swapping,
 paravirt_ops, balloon drv
 Linux 2.6.26 (soon): PowerPC, s390, IA64, NPT,
 Copyright © 2007 Qumranet, Inc. All rights reserved. ...
 EPT, more paravirt (mmu),
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/*
 KvmForum2007 wiki page on
 http://kvm.qumranet.com
 kvm@vger.kernel.org
 virtualization@lists.osdl.org




  Copyright © 2007 Qumranet, Inc. All rights reserved.
Thank You

More Related Content

What's hot

Introduction to linux containers
Introduction to linux containersIntroduction to linux containers
Introduction to linux containersGoogle
 
Virtualization VMWare technology
Virtualization VMWare technologyVirtualization VMWare technology
Virtualization VMWare technologysanjoysanyal
 
VMware Tanzu Introduction
VMware Tanzu IntroductionVMware Tanzu Introduction
VMware Tanzu IntroductionVMware Tanzu
 
Virtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareVirtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareDatapath Consulting
 
Virtual Infrastructure Overview
Virtual Infrastructure OverviewVirtual Infrastructure Overview
Virtual Infrastructure Overviewvalerian_ceaus
 
Server virtualization by VMWare
Server virtualization by VMWareServer virtualization by VMWare
Server virtualization by VMWaresgurnam73
 
vSphere7 with Tanzu
vSphere7 with Tanzu vSphere7 with Tanzu
vSphere7 with Tanzu VMware Tanzu
 
VMware Vsphere Graduation Project Presentation
VMware Vsphere Graduation Project PresentationVMware Vsphere Graduation Project Presentation
VMware Vsphere Graduation Project PresentationRabbah Adel Ammar
 
Virtualization Vs. Containers
Virtualization Vs. ContainersVirtualization Vs. Containers
Virtualization Vs. Containersactualtechmedia
 
Introduction to Hyper-V
Introduction to Hyper-VIntroduction to Hyper-V
Introduction to Hyper-VMark Wilson
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasDocker, Inc.
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...Edureka!
 

What's hot (20)

Introduction to linux containers
Introduction to linux containersIntroduction to linux containers
Introduction to linux containers
 
Qemu
QemuQemu
Qemu
 
Virtualization VMWare technology
Virtualization VMWare technologyVirtualization VMWare technology
Virtualization VMWare technology
 
VMware Tanzu Introduction
VMware Tanzu IntroductionVMware Tanzu Introduction
VMware Tanzu Introduction
 
Virtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMwareVirtualization 101: Everything You Need To Know To Get Started With VMware
Virtualization 101: Everything You Need To Know To Get Started With VMware
 
Virtual Infrastructure Overview
Virtual Infrastructure OverviewVirtual Infrastructure Overview
Virtual Infrastructure Overview
 
VMWARE ESX
VMWARE ESXVMWARE ESX
VMWARE ESX
 
Server virtualization by VMWare
Server virtualization by VMWareServer virtualization by VMWare
Server virtualization by VMWare
 
VMware
VMwareVMware
VMware
 
vSphere7 with Tanzu
vSphere7 with Tanzu vSphere7 with Tanzu
vSphere7 with Tanzu
 
Vmware overview
Vmware overviewVmware overview
Vmware overview
 
VMware Vsphere Graduation Project Presentation
VMware Vsphere Graduation Project PresentationVMware Vsphere Graduation Project Presentation
VMware Vsphere Graduation Project Presentation
 
Virtualization Vs. Containers
Virtualization Vs. ContainersVirtualization Vs. Containers
Virtualization Vs. Containers
 
Virtualization basics
Virtualization basics Virtualization basics
Virtualization basics
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Introduction to Hyper-V
Introduction to Hyper-VIntroduction to Hyper-V
Introduction to Hyper-V
 
Live migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchasLive migrating a container: pros, cons and gotchas
Live migrating a container: pros, cons and gotchas
 
Virtualization
VirtualizationVirtualization
Virtualization
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
VMware Tutorial For Beginners | VMware Workstation | VMware Virtualization | ...
 

Similar to The kvm virtualization way

DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...Jim St. Leger
 
Virtualization concept slideshare
Virtualization concept slideshareVirtualization concept slideshare
Virtualization concept slideshareYogesh Kumar
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & dockerejlp12
 
Virtualization Primer for Java Developers
Virtualization Primer for Java DevelopersVirtualization Primer for Java Developers
Virtualization Primer for Java DevelopersRichard McDougall
 
Virtualization technolegys for amdocs
Virtualization technolegys for amdocsVirtualization technolegys for amdocs
Virtualization technolegys for amdocsSamuel Dratwa
 
Linux virtualization
Linux virtualizationLinux virtualization
Linux virtualizationGoogle
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0guest72e8c1
 
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaaf
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaafTechnical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaaf
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaafSyed Shaaf
 
open source virtualization
open source virtualizationopen source virtualization
open source virtualizationKris Buytaert
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07congvc
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTThe Linux Foundation
 
virtualization and hypervisors
virtualization and hypervisorsvirtualization and hypervisors
virtualization and hypervisorsGaurav Suri
 
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...The Linux Foundation
 
Xen Project Update LinuxCon Brazil
Xen Project Update LinuxCon BrazilXen Project Update LinuxCon Brazil
Xen Project Update LinuxCon BrazilThe Linux Foundation
 
Hyper V And Scvmm Best Practis
Hyper V And Scvmm Best PractisHyper V And Scvmm Best Practis
Hyper V And Scvmm Best PractisBlauge
 

Similar to The kvm virtualization way (20)

DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
 
Virtualization concept slideshare
Virtualization concept slideshareVirtualization concept slideshare
Virtualization concept slideshare
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & docker
 
Virtualization Primer for Java Developers
Virtualization Primer for Java DevelopersVirtualization Primer for Java Developers
Virtualization Primer for Java Developers
 
Virtualization technolegys for amdocs
Virtualization technolegys for amdocsVirtualization technolegys for amdocs
Virtualization technolegys for amdocs
 
Linux virtualization
Linux virtualizationLinux virtualization
Linux virtualization
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
 
RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaaf
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaafTechnical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaaf
Technical update KVM and Red Hat Enterprise Virtualization (RHEV) by syedmshaaf
 
Drive into kvm
Drive into kvmDrive into kvm
Drive into kvm
 
open source virtualization
open source virtualizationopen source virtualization
open source virtualization
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07
 
Xen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XTXen and Client Virtualization: the case of XenClient XT
Xen and Client Virtualization: the case of XenClient XT
 
virtualization and hypervisors
virtualization and hypervisorsvirtualization and hypervisors
virtualization and hypervisors
 
VirtFS
VirtFSVirtFS
VirtFS
 
5 kvm arm
5 kvm arm5 kvm arm
5 kvm arm
 
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
CIF16/Scale14x: The latest from the Xen Project (Lars Kurth, Chairman of Xen ...
 
Kvm setup
Kvm setupKvm setup
Kvm setup
 
Xen Project Update LinuxCon Brazil
Xen Project Update LinuxCon BrazilXen Project Update LinuxCon Brazil
Xen Project Update LinuxCon Brazil
 
Hyper V And Scvmm Best Practis
Hyper V And Scvmm Best PractisHyper V And Scvmm Best Practis
Hyper V And Scvmm Best Practis
 

More from Francisco Gonçalves

O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...
O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...
O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...Francisco Gonçalves
 
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp0220140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02Francisco Gonçalves
 
A automatização e virtualização do seu negócio
A automatização e virtualização do seu negócioA automatização e virtualização do seu negócio
A automatização e virtualização do seu negócioFrancisco Gonçalves
 
O rad da wave maker developing for the cloud
O rad da wave maker developing for the cloudO rad da wave maker developing for the cloud
O rad da wave maker developing for the cloudFrancisco Gonçalves
 
Scale out database apps através de galera cluster e maria db
Scale out database apps através de galera cluster e maria dbScale out database apps através de galera cluster e maria db
Scale out database apps através de galera cluster e maria dbFrancisco Gonçalves
 
Re pensando-virtualização-através-linux containers
Re pensando-virtualização-através-linux containersRe pensando-virtualização-através-linux containers
Re pensando-virtualização-através-linux containersFrancisco Gonçalves
 
O docker vai mudar tudo na sua infra estrutura-ti
O docker vai mudar tudo na sua infra estrutura-tiO docker vai mudar tudo na sua infra estrutura-ti
O docker vai mudar tudo na sua infra estrutura-tiFrancisco Gonçalves
 
Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !Francisco Gonçalves
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationFrancisco Gonçalves
 
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Francisco Gonçalves
 

More from Francisco Gonçalves (20)

Ulteo virtual desktop system
Ulteo virtual desktop systemUlteo virtual desktop system
Ulteo virtual desktop system
 
O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...
O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...
O que é o SecondLife? Sabia que este pode catalisar a colaboração na sua empr...
 
Porque a-burocracia-deve-morrer
Porque a-burocracia-deve-morrerPorque a-burocracia-deve-morrer
Porque a-burocracia-deve-morrer
 
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp0220140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
20140128 webinar-get-more-out-of-mysql-with-tokudb-140319063324-phpapp02
 
A automatização e virtualização do seu negócio
A automatização e virtualização do seu negócioA automatização e virtualização do seu negócio
A automatização e virtualização do seu negócio
 
O rad da wave maker developing for the cloud
O rad da wave maker developing for the cloudO rad da wave maker developing for the cloud
O rad da wave maker developing for the cloud
 
Scale out database apps através de galera cluster e maria db
Scale out database apps através de galera cluster e maria dbScale out database apps através de galera cluster e maria db
Scale out database apps através de galera cluster e maria db
 
Re pensando-virtualização-através-linux containers
Re pensando-virtualização-através-linux containersRe pensando-virtualização-através-linux containers
Re pensando-virtualização-através-linux containers
 
O docker vai mudar tudo na sua infra estrutura-ti
O docker vai mudar tudo na sua infra estrutura-tiO docker vai mudar tudo na sua infra estrutura-ti
O docker vai mudar tudo na sua infra estrutura-ti
 
Teamwork Web Application
Teamwork Web ApplicationTeamwork Web Application
Teamwork Web Application
 
Node Js
Node JsNode Js
Node Js
 
Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !Hypervisor "versus" Linux Containers with Docker !
Hypervisor "versus" Linux Containers with Docker !
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 
Linux capacity planning
Linux capacity planningLinux capacity planning
Linux capacity planning
 
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
Wavemaker RAD for the Cloud with CloudJee - Future Direction 2014
 
Juju on ubuntu cloud
Juju on ubuntu cloudJuju on ubuntu cloud
Juju on ubuntu cloud
 
Cloud foundry and openstackcloud
Cloud foundry and openstackcloudCloud foundry and openstackcloud
Cloud foundry and openstackcloud
 
Ubuntu cloud infrastructures
Ubuntu cloud infrastructuresUbuntu cloud infrastructures
Ubuntu cloud infrastructures
 
Openstack deployment-with ubuntu
Openstack deployment-with ubuntuOpenstack deployment-with ubuntu
Openstack deployment-with ubuntu
 
Desk top virtual_gbanif
Desk top virtual_gbanifDesk top virtual_gbanif
Desk top virtual_gbanif
 

Recently uploaded

Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kitJamie (Taka) Wang
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud DataEric D. Schabell
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameKapil Thakar
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3DianaGray10
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2DianaGray10
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024Brian Pichman
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 

Recently uploaded (20)

Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kit
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3UiPath Studio Web workshop Series - Day 3
UiPath Studio Web workshop Series - Day 3
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2UiPath Studio Web workshop series - Day 2
UiPath Studio Web workshop series - Day 2
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 

The kvm virtualization way

  • 1. KVM: Virtualisation The Linux Way Amit Shah amit.shah@qumranet.com GEEP
  • 2. 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 2.6.26 IA-64 Included in 2.6.26 X86 Included in 2.6.20 KVM-lite: PV Linux guest on non-VTx / non-SVM host (proposed) PowerPC PV Architecture support for hypervisor Included in 2.6.26 3 Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 4. 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 5 Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 6. KVM Process Model task task guest task task guest kernel 6 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 7 Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 8. KVM Execution Model Userspace Kernel Guest ioctl() Switch to Guest Mode Heavyweight Lightweight Exit Native Guest Exit Execution Kernel Exit Handler Userspace Exit Handler 8 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 9 Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 10. 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.
  • 11. 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.
  • 12. 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.
  • 13. Virtio-net on KVM BLK NET User- Virtio PCI space Guest kernel QEMU Shared Memory Linux Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 14. 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 http://kvm.qumranet.com/kvmwiki/TODO Copyright © 2007 Qumranet, Inc. All rights reserved.
  • 15. 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 Qumranet, Inc. All rights reserved. Copyright © 2007
  • 16. 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.
  • 17. 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.
  • 18. Journey Linux 2.6.20 (4 Feb 2007): Initial release Linux 2.6.21 (25 Apr 2007): Stability, suspend/resume Linux 2.6.22 (8 Jul 2007): Stable ABI Old userspace, new kernel New userspace, old kernel Linux 2.6.23 (9 Oct 2007): SMP, performance Linux 2.6.24 (24 Jan 2008): In-kernel APIC, preemptibility, virtio Linux 2.6.25 (16 Apr 2008): Guest swapping, paravirt_ops, balloon drv Linux 2.6.26 (soon): PowerPC, s390, IA64, NPT, Copyright © 2007 Qumranet, Inc. All rights reserved. ... EPT, more paravirt (mmu),
  • 19. 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.
  • 20. 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.
  • 21. Do Read virt/*, arch/[x86|ia64|s390|powerpc]/kvm/* KvmForum2007 wiki page on http://kvm.qumranet.com kvm@vger.kernel.org virtualization@lists.osdl.org Copyright © 2007 Qumranet, Inc. All rights reserved.