CS 3214 Operating Systems Virtualization Godmar Back.

Slides:



Advertisements
Similar presentations
Virtualization Dr. Michael L. Collard
Advertisements

Virtual Machines What Why How Powerpoint?. What is a Virtual Machine? A Piece of software that emulates hardware.  Might emulate the I/O devices  Might.
CS-3013 & CS-502, Summer 2006 Virtual Machine Systems1 CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 2.
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Bugnion et al. Presented by: Ahmed Wafa.
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.
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
1 Disco: Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine, and Mendel Rosenblum, Stanford University, 1997.
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.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Virtualization Technology Prof D M Dhamdhere CSE Department IIT Bombay Moving towards Virtualization… Department of Computer Science and Engineering, IIT.
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.
Virtualization Concepts Presented by: Mariano Diaz.
Virtualization Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is licensed.
Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.
Virtualization Part 2 – VMware. Virtualization 2 CS5204 – Operating Systems VMware: binary translation Hypervisor VMM Base Functionality (e.g. scheduling)
Our work on virtualization Chen Haogang, Wang Xiaolin {hchen, Institute of Network and Information Systems School of Electrical Engineering.
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Edouard et al. Madhura S Rama.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
Virtual Memory Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Introduction to virtualization
CS 3204 Operating Systems Godmar Back Lecture 27.
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,
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,
E Virtual Machines Lecture 1 What is Virtualization? Scott Devine VMware, Inc.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Unit 2 VIRTUALISATION. Unit 2 - Syllabus Basics of Virtualization Types of Virtualization Implementation Levels of Virtualization Virtualization Structures.
Virtual Machines (part 2) CPS210 Spring Papers  Xen and the Art of Virtualization  Paul Barham  ReVirt: Enabling Intrusion Analysis through Virtual.
Virtualization Neependra Khare
Lecture 13: Virtual Machines
Virtualization for Cloud Computing
A move towards Greener Planet
Introduction to Virtualization
Virtualization.
Virtual Machine Monitors
Virtualization Technology
CS 5204 Operating Systems Virtualization Godmar Back.
L2- Virtualization Technology
CS 3214 Introduction to Computer Systems
CS 3214 Operating Systems Virtualization.
Virtualization Dr. Michael L. Collard
Chapter 8: Main Memory.
CS352H: Computer Systems Architecture
A Real Problem What if you wanted to run a program that needs more memory than you have? September 11, 2018.
Lecture 24 Virtual Machine Monitors
Swapping Segmented paging allows us to have non-contiguous allocations
Virtualization overview
Morgan Kaufmann Publishers
Virtual Servers.
Disco: Running Commodity Operating Systems on Scalable Multiprocessors
1. 2 VIRTUAL MACHINES By: Satya Prasanna Mallick Reg.No
Running other code under LINUX
Group 8 Virtualization of the Cloud
OS Virtualization.
A Survey on Virtualization Technologies
Virtual machines benefits
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
Xen and the Art of Virtualization
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
CS295: Modern Systems Virtualization
Hypervisor A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines. A computer.
Presentation transcript:

CS 3214 Operating Systems Virtualization Godmar Back

Definitions for “virtual machine” Term is somewhat ill-defined, generally A machine that’s implemented in software, rather than hardware A self-contained environment that acts like a computer An abstract specification for a computing device (instruction set, etc.) Common distinction: (language-based) virtual machines Instruction set usually does not resemble any existing architecture Java VM, .Net CLR, many others virtual machine monitors (VMM) instruction set fully or partially taken from a real architecture CS 3214 Fall 2014

Use of Virtual Machines Test applications Program / debug OS; fault injection Bundle applications + OS (“Virtual appliances”) Monitor for intrusions Resource sharing/hosting `cloud computing’ Migration Replication Simulate networks CS 3214 Fall 2014

History of virtual machines See Goldberg [1972], [1974] CS 3214 Fall 2014

History (cont’d) “Disco” project at Stanford [Bugnion 1997] Created hypervisor to run commodity OS on new “Flash” multiprocessor hardware Based on MIPS VMWare was spun off, created VMWare Workstation – first hypervisor for x86 2000’s Resurgence under Cloud moniker CS 3214 Fall 2014

Types of Virtual Machines Type I Type II CS 3214 Fall 2014

for VMM: skas3, UMLinux, vmware.ko, KVM VMM Classification Paravirtualized guest drivers Unmodified Guest Ported Guest Guest OS sees true hardware interface Guest OS sees (almost) hardware interface, has some awareness of virtualization Guest OS sees virtualized hardware interface Hypervisor runs directly on host hardware VMware ESX MS Virtual Server Xen Windows 7 (HyperV) Hypervisor runs on host OS qemu, VMware Workstation, VMware GSX, Sun VirtualBox UML Kernel Support for VMM: skas3, UMLinux, vmware.ko, KVM Type I Type II CS 3214 Fall 2014

Virtualizing the CPU Basic mode: direct execution Requires Deprivileging (Code designed to run in supervisor mode will be run in user mode) Hardware vs. Software Virtualization Hardware: “trap-and-emulate” Not possible on x86 prior to introduction of Intel/VT & AMD/Pacifica See [Robin 2000] Software: Either require cooperation of guests to not rely on traps for safe deprivileging Or binary translation to avoid running unmodified guest OS code (note: guest user code is always safe to run!) CS 3214 Fall 2014

Binary translation vs trap-and-emulate Interesting history: IBM/360 (70’s) used trap-and-emulate Late 90’s: x86 requires binary translation Early 00’s: x86 adds hardware for complete trap-and-emulate (*) Late 00’s: predominantly hardware-based virtualization + guest accommodation (*) Adams [ASPLOS 2006] asked: Is binary translation always slower than trap-and-emulate? Surprising result: binary translation beat trap-and-emulate. Why? Binary translation is highly optimized: most instructions are translated as IDENT (identical), preserving most compiler optimizations and only slightly increasing code size binary translation can be adaptive: if you know an instruction is going to trap, inline part of all of trap handler. Way cheaper than actually trapping. This trade-off is changing as hardware support gets better, e.g., microcode assist See also [PLDI 2012 Agesen] CS 3214 Fall 2014

Virtualizing Memory: MMU Guest OS programs page table mapping virtual  physical Hypervisor must map guest’s “physical” to machine addresses Approaches: Shadow page tables (ESX): hypervisor makes a copy of page table, installs copy in MMU Paravirtualization: ask cooperation of guest to create suitable virtual  hardware page tables (Xen) Hardware assisted: nested page tables: let hardware perform additional translation step CS 3214 Fall 2014

Address Translation & TLB Virtual Address done in hardware done in OS software restart instruction TLB Lookup done in software or hardware machine-dependent miss hit Page Table Walk Check Permissions page present else denied ok TLB Reload Page Fault Exception “Page Not Present” Page Fault Exception “Protection Fault” Physical Address machine-independent logic Load Page Terminate Process CS 3214 Fall 2014

Shadow Page Tables vs. Paravirtualization vs. Nested Page Tables Paravirtualized MMU Nested Page tables eliminate need for either Shadow Page Table Primary Shadow Virtual Physical Hardware CS 3214 Fall 2014

Memory Management in ESX Have so far discussed how VMM achieves isolation By ensuring proper translation But VMM must also make resource management decisions: Which guest gets to use which memory, and for how long Challenges: OS generally not (yet) designed to have (physical memory) taken out/put in. Assume (more or less contiguous) physical memory starting at 0 Assume they can always use all physical memory at no cost (for file caching, etc.) Unaware that they may share actual machine with other guests Already perform page replacement for their processes based on these assumptions CS 3214 Fall 2014

Goals for Virtual Memory Performance Is key. Recall that avg access = hit rate * hit latency + miss rate * miss penalty Miss penalty is huge for virtual memory Overcommiting Want to announce more physical memory to guests that is present, in sum Needs a page replacement policy Sharing If guests are running the same code/OS, or process the same data, keep one copy and use copy-on-write CS 3214 Fall 2014

Page Replacement Must be able to swap guest pages to disk Question is: which one? VMM has little knowledge about what’s going on inside guest. For instance, it doesn’t know about guest’s internal LRU lists (e.g., Linux page cache) Potential problem: Double Paging VMM swaps page out (maybe based on hardware access bit) Guest (observing the same fact) – also wants to “swap it out” – then VMM must bring in the page from disk just so guest can write it out Need a better solution CS 3214 Fall 2014

Ballooning What if we could trick guest into reducing its memory footprint? Download balloon driver into guest kernel Balloon driver allocates pages, possibly triggering guest’s replacement policies. Balloon driver pins page (as far as guest is concerned) and (secretly to guest) tells VMM that it can use that memory for other guests Deflating the balloon increases guest’s free page pool Relies on existing memory in-kernel allocators (e.g., Linux’s get_free_page() If not enough memory is freed up by ballooning, do random page replacement CS 3214 Fall 2014

Ballooning Source: VMware CS 3214 Fall 2014

Page Sharing (1) Source: Waldspurger ‘02 CS 3214 Fall 2014

Page Sharing (2) Source: Waldspurger ‘02 CS 3214 Fall 2014

Virtualizing I/O Most challenging of the three Consider Gigabit networking, 3D graphics devices Modern device drivers are tightly interwoven with memory & CPU management E.g. direct-mapped I/O, DMA Interrupt scheduling CS 3214 Fall 2014

Source: VMware white paper on virtualization considerations. Virtualizing I/O Xen ESX Source: VMware white paper on virtualization considerations. CS 3214 Fall 2014

Windows Hyper V Source: Wikipedia Commons CS 3214 Fall 2014

IOMMU & Self-Virtualizing HW IOMMU – hardware support to protect DMA, interrupts space Self-Virtualizing – device is aware of existence of multiple VMs above it CS 3214 Fall 2014

Container-Based Virtualization Provide OS-level virtualization Namespace separation (Security Isolation) Resource Isolation Fault Isolation Examples chroot, “jails” Solaris Containers Linux “LXC” Soltesz et al, Eurosys 2007 CS 3214 Fall 2014

Summary Virtualization enables a variety of arrangements/benefits in organizing computer systems Two types: VMM may run on bare hardware VMM is process running on/integrated with host OS Key challenges include virtualization of CPU Memory I/O Both correctness and efficiency are important CS 3214 Fall 2014