EE 660: Computer Architecture Cloud Architecture: Virtualization Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Based on the slides of Prof. Roy Campbell & Prof Reza Farivar
Agenda Introduction to Virtualization Implementations of Virtualization OS based Virtualization: Xen Containers: Dockers
Sharing Resources Economics of Clouds requires sharing resources How do we share a physical computer among multiple users? Answer: Abstraction Introduce an abstract model of what a generic computing resource should look like The physical computer resource then provides this abstract model to many users
Layers of Abstraction Introduce an abstract model of what a generic computing resource should look like The physical computer resource then provides this abstract model to many users Virtualization avoids creating dependencies on physical resources
Layers of Abstraction Introduce an abstract model of what a generic computing resource should look like The physical computer resource then provides this abstract model to many users Virtualization avoids creating dependencies on physical resources
Virtualization: Foundation of Cloud Computing Virtualization allows distributed computing models without creating dependencies on physical resources Clouds are based on Virtualization offer services based mainly on virtual machines, remote procedure calls, and client/servers provide lots of servers to lots of clients (e.g. phones) Simplicity of use and ease of programming requires allowing client server paradigms to be used to construct services from lots of resources
Types of virtualization Native, full Hardware assisted Para-virtualization OS level Containers Jails Chroot Zones Open-VZ à Virtuozzo
Background The Virtual Machine concept isn t new IBM mainframes implemented it in 1960s Features of Classical Virtualization : FIDELITY: software s execution on the virtual machine is identical -- except for timing -- to its execution on actual hardware PERFORMANCE: the vast majority of a guest s instructions are executed without any intervention SAFETY: all hardware resources are controlled by the Virtual Machine Manager
Native and Full Virtualization the virtual machine simulates enough hardware to allow an unmodified "guest" OS (one designed for the same CPU) to be run in isolation. Examples: VirtualBox Virtual PC Vmware QEMU Apps Guest OS Apps Guest OS.. Space reserved Manag for video Do not put anything ement here Hypervisor (VMM) Hardware
Hardware enabled virtualization the virtual machine has its own hardware and allows a guest OS to be run in isolation. Intel VT (IVT) AMD virtualization (AMD-V) Examples: VMware Fusion Parallels Desktop for Mac Parallels Workstation Apps Apps Apps Guest Guest Guest.. OS OS OS Hardware VM Hardware VM Hardware
Paravirtualization the virtual machine does not necessarily simulate hardware, but instead (or in addition) offers a special API that can only be used by modifying the "guest" OS. Examples: XEN Apps Apps Modified Guest OS Stub Modified Guest OS Stub.. Space reserved Manag for video Do not put anything ement here Hypervisor (VMM) Hardware
Operating system-level virtualization virtualizing a physical server at the operating system level, enabling multiple isolated and secure virtualized servers to run on a single physical server. Examples: Linux-Vserver Solaris Containers FreeBSD Jails Chroot CGroups Private Server Private Server.. Private Server Operating Do System not put anything here Hardware
The Software-defined Network 3. Well-defined open API App App App 2. At least one good operating system that is extensible and possibly open source Network Operating System 1. Open interface to hardware Simple Packet Forwarding Hardware Simple Packet Forwarding Hardware Simple Packet Forwarding Hardware Simple Packet Forwarding Hardware Simple Packet Forwarding Hardware
Trend Virtualized OS + Virtualized Network App App App App App App Windows Mac W W (O (O in d S ) o w s L in in u x M a Linux O (OS) a c S S c OS NCO C ox o n n tr t o rol e le r r 1 1 (Network OS) C C o o n n tr t o ro l l e le r r N2e2twork OS Virtualization Layer x86 (Computer) Virtualization or Slicing OpenFlow Computer Industry Network Industry Simple common stable hardware substrate below + programmability + strong isolation model + competition above = faster innovation
Trend Then Add Virtualized Storage App WWininddoo Wwiwnsdsows (O(SO(O)SS)) App Linu Linu Lxinxux x86 (Computer) App Mac M O a a c S S c OS Virtualization Layer Computer Industry App C C o o n n t t r r o ol NOX (Ne e er r tw1 1 ork OS) App Slicing OpenFlow Network Industry App CCoonnttrroollele Nr retwork O2 2S App C C o o n n tr t o ro l l e le r r 1 1 HDFS App Virtualization App Controller Controller H2B2ase Distributed FS Storage Area Network Storage Industry
Agenda Introduction to Virtualization Implementations of Virtualization OS based Virtualization: Xen Containers: Dockers
Types of Virtualization Native, full Hardware assisted Para-virtualization OS level Containers Jails Chroot Zones Open-VZ à Virtuozzo
Native and Full Virtualization The virtual machine simulates enough hardware to allow an unmodified "guest" OS (one designed for the same CPU) to be run in isolation. Examples: VirtualBox Virtual PC Vmware QEMU Win4Lin XEN/Virtual Iron
x86 poses some problems Certain x86 instructions were impossible to truly virtualize in that classical sense For example, the smsw instruction can be executed at any privilegelevel, and in any processor mode, revealing to software the current hardware status (e.g., PE, PG, ET) Intel s Vanderpool Project endeavored to remedy this (using new processor modes)
VT-x Virtualization Technology for x86 CPUs Two new processor execution-modes VMX root mode (for VM Managers) VMX non-root mode (for VM Guests) Ten new hardware instructions A six-part VMCS data-structure A variety of control-options for VMs
Interaction of VMs and VMM VM #1 (Guest) VM #2 (Guest) VM Exit VM Exit VM Entry VM Entry VMXON VM Monitor (Host) VMXOFF
Hardware Enabled Virtualization The virtual machine has its own hardware and allows a guest OS to be run in isolation. Intel VT (IVT) AMD virtualization (AMD-V) Examples: VMware Fusion Parallels Desktop for Mac Parallels Workstation
Partial Virtualization The virtual machine simulates multiple instances of much (but not all) of an underlying hardware environment, particularly address spaces.
Paravirtualization The virtual machine does not necessarily simulate hardware, but instead (or in addition) offers a special API that can only be used by modifying the "guest" OS. Terminologies Hypervisor, hypercall Enomalism Examples: XEN, KVM, Win4Lin 9x
Operating System-Level Virtualization Virtualizing a physical server at the operating system level, enabling multiple isolated and secure virtualized servers to run on a single physical server. Examples: Parallels Workstation Linux-VServer, Virtuozzo OpenVZ, Solaris Containers FreeBSD Jails Chroot?
Operating System-Level Virtualization Hypervisor (VM) One real HW, many virtual HWs, many Oss High versatility can run different Oss Lower density, performance, scalability <<Lowers>> are mitigated by new hardware features (such as VT-D) Containers (CT) One real HW (no virtual HW), one kernel, many userspace instances Higher density, natural page sharing Dynamic resource allocation Native performance: [almost] no overhead
Thinner Containers, Better Performance Containers Share host OS and drivers Have small virtualization layer Naturally share pages Hypervisors Have separate OS plus virtual hardware Hardware emulation requires VMM state Have trouble sharing guest OS pages Containers are more elastic than hypervisors Container slicing of the OS is ideally suited to cloud slicing families on one server Hypervisors only advantage in IaaS is support for different OS
What Is the Trade-Off? 10
Feature Comparison Hypervisor Container Multiple Kernels X Load Arbitrary Modules Space X reserved for video Local Administration All Live Migration OpenVZ Live System Update X Zap 11
Agenda Introduction to Virtualization Implementations of Virtualization OS based Virtualization: Xen Containers: Dockers
Xen 3.0 Guest VM
Xen 3.0 Guest VM Driver Domain Map Virtual Devices CFQ for disk HTB for network
Xen 3.0 Guest VM I/O Path Process to Guest OS Guest OS to IDD
Xen 3.0 Guest VM Security Isolation Hypervisor Access Physical Level PCI Address Virtual Memory
Xen 3.0 Guest VM Security Isolation Hypervisor Access Physical Level PCI Address Virtual Memory Resource Control Hypervisor Allocate Resources Schedule VMs
Agenda Introduction to Virtualization Implementations of Virtualization OS based Virtualization: Xen Containers: Dockers
Overview Docker containers wrap up a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries anything you can install on a server. This guarantees that the software will always run the same, regardless of its environment it is running in. (Docker Inc., n.d.)
Overview Docker automates the deployment of applications inside software containers Additional layer of abstraction and automation of operating system level virtualization on Linux.
History of Docker Solomon Hykes started Docker in France as an internal project within dotcloud, a platform-as-a-service company Docker was released as open source in 13 March 2013 libcontainer library written in the Go programming language. Latest version 1.11.2 (31 May 2016) Docker team, Red Hat, IBM, Google, Cisco Systems and Amadeus IT Group.
Docker Structure
Containers built with Docker
Basics of Docker C o n t a i n e r A Push Docker Container Image Registry Component A s Docker File Source Code Repository Build Docker Engine Developer Linux Host C o n t a i n e r A C o n t a i n e r B C o n t a i n e r C Destination Linux Host D o c k e r search Pull Run
Changes and Updates App A Bins + Libs Original Container A p p Diffs packaged in Update Container A p p Docker Container Image Registry App A Update copies of container App A Get Update Bins + Libs Bins + Libs Docker Engine Docker Engine