Virtual Machines. Philipp Koehn. 2 December 2016

Similar documents
Virtual machines and operating systems

Virtual Machines. COMP 3361: Operating Systems I Winter

Distributed Systems. Virtualization. Paul Krzyzanowski

Virtualization Technology. Zhiming Shen

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

Full and Para Virtualization

COS 318: Operating Systems. Virtual Machine Monitors

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtual Machines Fact Sheet

Virtualization in Linux KVM + QEMU

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

Virtualization. Types of Interfaces

Virtualization. Pradipta De

Virtualization. Dr. Yingwu Zhu

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization. Jia Rao Assistant Professor in CS

Chapter 5 Cloud Resource Virtualization

Introduction to Virtual Machines

VMware Server 2.0 Essentials. Virtualization Deployment and Management

COS 318: Operating Systems. Virtual Machine Monitors

x86 Virtualization Hardware Support Pla$orm Virtualiza.on

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

Understanding Full Virtualization, Paravirtualization, and Hardware Assist. Introduction...1 Overview of x86 Virtualization...2 CPU Virtualization...

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

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

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

System Virtual Machines

Performance tuning Xen

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

The Xen of Virtualization

Introduction to Virtual Machines

Hypervisors and Virtual Machines

Xen and the Art of. Virtualization. Ian Pratt

Virtual Machines. Virtualization

Enabling Technologies for Distributed Computing

Nested Virtualization

IOS110. Virtualization 5/27/2014 1

Enabling Technologies for Distributed and Cloud Computing

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

AMD 64 Virtualization

Virtualization. Jukka K. Nurminen

CS 695 Topics in Virtualization and Cloud Computing. More Introduction + Processor Virtualization

Implementation of a Purely Hardware-assisted VMM for x86 Architecture

kvm: Kernel-based Virtual Machine for Linux

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Kernel Virtual Machine

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

COS 318: Operating Systems. Virtual Memory and Address Translation

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

GUEST OPERATING SYSTEM BASED PERFORMANCE COMPARISON OF VMWARE AND XEN HYPERVISOR

Virtualization Technologies

Computing in High- Energy-Physics: How Virtualization meets the Grid

Cloud Computing. Dipl.-Wirt.-Inform. Robert Neumann

Basics of Virtualisation

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

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

Intel Virtualization Technology Overview Yu Ke

Lecture 2 Cloud Computing & Virtualization. Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

Cloud Computing #6 - Virtualization

Virtualization for Cloud Computing

CS5460: Operating Systems. Lecture: Virtualization 2. Anton Burtsev March, 2013

x86 ISA Modifications to support Virtual Machines

9/26/2011. What is Virtualization? What are the different types of virtualization.

VMkit A lightweight hypervisor library for Barrelfish

Virtualization and the U2 Databases

Virtualization. ! Physical Hardware. ! Software. ! Isolation. ! Software Abstraction. ! Encapsulation. ! Virtualization Layer. !

Hybrid Virtualization The Next Generation of XenLinux

Virtualization Approaches in Cloud Computing

COS 318: Operating Systems

BHyVe. BSD Hypervisor. Neel Natu Peter Grehan

Data Centers and Cloud Computing

CPS221 Lecture: Operating System Structure; Virtual Machines

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

Multi-core Programming System Overview

Virtual Machines.

Nested Virtualization

Best Practices for Virtualised SharePoint

Unit two is about the components for cloud computing.

Advanced Computer Networks. Network I/O Virtualization

RPM Brotherhood: KVM VIRTUALIZATION TECHNOLOGY

Virtual Computing and VMWare. Module 4

Clouds Under the Covers. Elgazzar - CISC Fall

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

KVM KERNEL BASED VIRTUAL MACHINE

evm Virtualization Platform for Windows

Virtualization VMware Inc. All rights reserved

Models For Modeling and Measuring the Performance of a Xen Virtual Server

CS 61C: Great Ideas in Computer Architecture Virtual Memory Cont.

The QEMU/KVM Hypervisor

COM 444 Cloud Computing

OS Virtualization Frank Hofmann

Windows Server Virtualization & The Windows Hypervisor

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

CSE490H: Virtualization

The Microsoft Windows Hypervisor High Level Architecture

Using Linux as Hypervisor with KVM

Virtual Machine in Automation Projects

Security Challenges in Virtualized Environments

Cloud Architecture and Virtualisation. Lecture 4 Virtualisation

Transcription:

Virtual Machines Philipp Koehn 2 December 2016

Basic Idea 1 Run multiple instances of full operating systems on a machine Example: run Windows and Linux on a Mac Not to be confused with Java Virtual Machines

2 Philipp Koehn Computer Systems Fundamentals: Virtual Machines 2 December 2016

Snapshots 3 Freeze copy of a virtual machine Copy of file system and memory

Migration 4 Migration: move a VM to another host (maybe because of spike of VM usage overloads current machine) Steps take snapshot (fast) copy all pages of snapshot (not so fast) copy modified pages (fast) freeze virtual machine and copy VM memory Very fast, fractions of a second

Why? 5 Better resource utilization: sharing of a single computer among several users Isolation and security in clouds Security limitations of standard operating systems Faster processors make overhead acceptable

History 6 Virtual machines popular in mainframes in 1970s Not on "personal computer" Intel x86 for a long time First x86 virtualization: VMWare 1999 Intel and AMD added hardware support 2005/2006 Used in cloud computing (e.g., Amazon web services)

7 basics

Virtual Machine Monitor 8 Host machine runs a regular operating system Virtual machine monitor (VMM) runs as a process of the operating system has privileged access to CPU VMM runs other operating systems (guest machine) manages their access to hardware intercepts exceptions and interrupts

Virtual Machine Monitor 9 Normal OS Kernel exec syscall Process Process Process Process

Virtual Machine Monitor 10 Virtual Machine VMM exec Kernel Kernel exec syscall Process Process Process Process

Basic Functions of Operating System 11 User mode process runs in own virtual memory makes systems calls to kernel Kernel mode manages processes handles interrupts and exceptions e.g., page faults Hardware supports this with "privileged" mode for instructions e.g., allow access to physical memory

User Processes 12 Run already in "virtual mode" Memory access is channeled through virtual memory Device interactions are handled by kernel via system calls Very little overhead when running inside virtual machine (unless very I/O intensive)

Interrupt Handling 13 VMM controls access to privileged CPU state input/output devices exceptions interrupts "Trap and emulate" VMM catches exceptions and directs them to the right guest

Traps 14 Normal OS exception interrupt syscall exec Kernel Process Process Process Process

Virtual Machine Monitor Catches Traps 15 Virtual Machine VMM exception interrupt syscall exec exec Kernel Kernel Process Process Process Process

16 emulation

Emulation 17 Binary translation Shaddowing Device emulation

Binary Translation 18 Some instructions require supervisor mode access to physical memory handling interrupt flags Raw kernel code instructions need to be translated i.e., rewritten into user mode instructions This is tricky...

Shadowing 19 Guest kernel data structures need to be duplicated by VMM Example: page tables of virtual memory VMM maintains copy of page tables traps access attenpts emulating them instead in software VMM tracks changes by guest kernel

Device Emulation 20 Kernel accesses devices directly, e.g., network adapter disk keyboard video/audio i/o VMM talks directly to these Guest OS interactions with hardware have to go through VMM Guest OS has access only to generic devices

Hardware Support 21 Intel and AMD implement virtualization support for x86 Direct execution model new execution mode: guest mode direct execution of guest OS code incl. privileged instructions virtual machine control block (VMCB) controls what operations trap records info to handle traps in VMM Steps new instruction "vmrun" enters guest mode, runs VM code when VM traps, CPU executes new "exit" instruction enters VMM, which emulates operation

22 shadow page tables

Virtualizing Memory 23 OS assumes it has full control over memory managing it: OS assumes it owns it all mapping it: OS assumes it can map to any physical page VMM partitions memory among VMs VMM needs to assign hardware pages to VMs VMM needs to control mappings for isolation OS can only map to a hardware page given to it by the VMM

Additional Abstraction 24 Three abstractions of memory machine: actual hardware memory, e.g., 16 GB of DRAM physical: abstraction of hardware memory managed by OS - VMM allocates 2 GB to a VM OS thinks the computer has 2 GB of contiguous physical memory - note: underlying machine memory may be discontiguous virtual: virtual address spaces of process (48 bit 256TB) Guest OS creates and manages page tables but: these page tables are not used by the MMU hardware

Address Translation 25 Guest Virtual Guest Physical Machine Memory Guest A Guest B

Shadow Page Tables 26 VMM manages page tables that map virtual pages to machine pages ("shadow page tables") These tables are loaded into the MMU on a context switch VMM needs to keep its V M tables consistent with changes made by OS to its V P tables VMM maps OS page tables as read only when OS writes to page tables, trap to VMM VMM applies write to shadow table and OS table, returns

Hardware Support 27 Intel extended page tables (EPT), AMD nested page tables (NPT) Original page tables map virtual to (guest) physical pages Managed by OS in VM, backwards-compatible No need to trap to VMM when OS updates its page tables New tables map physical to machine pages: Managed by VMM Translation lookup buffer (TLB) tagged TLB w/ virtual process identifiers (VPIDs) tag VMs with VPID, no need to flush TLB on VM/VMM switch

28 containers

Deploying Services 29 Often the goal is to deploy complex software applications Many dependencies: specific versions of libraries Example: "web service" answers HTTP request to fulfill complex tasks One solution: virtual machine package all the software into a virtual machine deployment: run virtual machine but: relatively large overhead (runs entire operating system) Light-weight solution: containers

Docker Containers 30 One (host) operating system Containers include application and all dependencies But share the kernel with other containers Each containers runs as isolated process in user space Initial release of open source software in 2013

Containers vs. Virtual Machine 31