Virtualization Part 2 – VMware Hardware Support. Virtualization 2 CS 5204 – Fall, 2008 VMware: binary translation Hypervisor VMM Base Functionality (e.g.

Slides:



Advertisements
Similar presentations
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Appears in SOSDI.
Advertisements

Virtualization Dr. Michael L. Collard
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.
Segmentation and Paging Considerations
G Robert Grimm New York University Disco.
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Network Implementation for Xen and KVM Class project for E : Network System Design and Implantation 12 Apr 2010 Kangkook Jee (kj2181)
Memory Management 2010.
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Computer Organization and Architecture
Hosted VMM Architecture Advantages: –Installs and runs like an application –Portable – host OS does I/O access –Coexists with applications running on.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.
Operating System Support for Virtual Machines Samuel King, George Dunlap, Peter Chen Univ of Michigan Ashish Gupta.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Virtual Machines. Virtualization Virtualization deals with “extending or replacing an existing interface so as to mimic the behavior of another system”
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Introduction to Virtual Machines. Administration Presentation and class participation: 40% –Each student will present two and a half times this semester.
1 Virtualization – Part III VMware Ahmad Ibrahim.
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
A Comparison of Software and Hardware Techniques for x86 Virtualization Keith Adams Ole Agesen Oct. 23, 2006.
Zen and the Art of Virtualization Paul Barham, et al. University of Cambridge, Microsoft Research Cambridge Published by ACM SOSP’03 Presented by Tina.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Virtual Machines.
Keith Adams, Ole Agesen 1st October 2009 Presented by Chwa Hoon Sung, Kang Joon Young A Comparison of Software and Hardware Techniques for x86 Virtualization.
ITEC 325 Lecture 29 Memory(6). Review P2 assigned Exam 2 next Friday Demand paging –Page faults –TLB intro.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
CS533 Concepts of Operating Systems Jonathan Walpole.
Virtualization The XEN Approach. Virtualization 2 CS5204 – Operating Systems XEN: paravirtualization References and Sources Paul Barham, et.al., “Xen.
Operating System Support for Virtual Machines Samuel T. King, George W. Dunlap,Peter M.Chen Presented By, Rajesh 1 References [1] Virtual Machines: Supporting.
Virtualization Concepts Presented by: Mariano Diaz.
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.
Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Embedded System Lab. 오명훈 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Palo Alto, CA USA
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.
CS533 Concepts of Operating Systems Jonathan Walpole.
 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,
Introduction to virtualization
CS 3204 Operating Systems Godmar Back Lecture 27.
VMWare MMU Ranjit Kolkar. Designed for efficient use of resources. ESX uses high-level resource management policies to compute a target memory allocation.
MEMORY RESOURCE MANAGEMENT IN VMWARE ESX SERVER 김정수
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,
Lecture 12 Virtualization Overview 1 Dec. 1, 2015 Prof. Kyu Ho Park “Understanding Full Virtualization, Paravirtualization, and Hardware Assist”, White.
Operating-System Structures
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Memory Resource Management in VMware ESX Server By Carl A. Waldspurger Presented by Clyde Byrd III (some slides adapted from C. Waldspurger) EECS 582 –
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Introduction to Virtualization
Virtualization.
Memory Resource Management in VMware ESX Server
Why VT-d Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing.
L2- Virtualization Technology
Presented by Mike Marty
CS 3214 Introduction to Computer Systems
CS 3214 Operating Systems Virtualization Godmar Back.
Virtualization Dr. Michael L. Collard
Morgan Kaufmann Publishers
Running other code under LINUX
Group 8 Virtualization of the Cloud
OS Virtualization.
Virtualization Techniques
Computer Security: Art and Science, 2nd Edition
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
Presentation transcript:

Virtualization Part 2 – VMware Hardware Support

Virtualization 2 CS 5204 – Fall, 2008 VMware: binary translation Hypervisor VMM Base Functionality (e.g. scheduling) Enhanced Functionality References and Sources Carl Waldspurger, “Memory Resource Mangement in VMware ESX Server” Proceedings, 5 th Symposium on Operating Systems Design and Implementation, Boston, Massachusetts, December 9-11, 2002, 14 pages. Keith Adams, and Ole Agesen, “A Comparison of Software and Hardware Techniques for x86 Virtualization,” Proceedings, ASPLOS’06, San Jose, California, October 21, 2006, 12 pages.

Virtualization 3 CS 5204 – Fall, 2008 Binary Translation Characteristics Binary – input is machine-level code Dynamic – occurs at runtime On demand – code translated when needed for execution System level – makes no assumption about guest code Subsetting – translates from full instruction set to safe subset Adaptive – adjust code based on guest behavior to achieve efficiency innocuous sensitive IDENT(ical) SIMULATE(d)

Virtualization 4 CS 5204 – Fall, 2008 Binary Translation TU: translation unit (usually a basic block) CCF: compiled code fragment : continuation TU Binary Translator Translation Cache CCF PC[x][y] ([x], [y]) Hash Table execute Running time % translation Few cache hits Working set captured

Virtualization 5 CS 5204 – Fall, 2008 Eliminating faults/traps Expensive traps/faults can be avoided Example: Pentium privileged instruction (rdtsc)  Trap-and-emulate: 2030 cycles  Callout-and-emulate: 1254 cycles  In-TC emulation: 216 cycles Process  Privileged instructions – eliminated by simple binary translation (BT)  Non-privileged instructions – eliminated by adaptive BT (a) detect a CCF containing an instruction that trap frequently (b) generate a new translation of the CCF to avoid the trap (perhaps inserting a call-out to an interpreter), and patch the original translation to execute the new translation

Virtualization 6 CS 5204 – Fall, 2008 Memory resource management VMM (meta-level) memory management  Must identify both VM and pages within VM to replace  VMM replacement decisions may have unintended interactions with GuestOS page replacement policy  Worst-case scenario: double paging Strategies  “ballooning” – add memory demands on GuestOS so that the GuestOS decides which pages to replace Also used in Xen  Eliminating duplicate pages – even identical pages across different GuestOSs. VMM has sufficient perspective Clear savings when running numerous copies of same GuestOS  Allocation algorithm Balances memory utilization vs. performance isolation guarantees “taxes” idle memory

Virtualization 7 CS 5204 – Fall, 2008 Ballooning “balloon” – module inserted into GuestOS as pseudo-device driver or kernel service Has no interface to GuestOS or applications Has a private channel for communication to VMM Polls VMM for current “balloon” size Balloon holds number of “pinned” page frames equal to its current size Inflating the balloon  Balloon requests additional “pinned” pages from GuestOS  Inflating the balloon causes GuestOS to select pages to be replaced using GuestOS page replacement policy  Balloon informs VMM of which physical page frames it has been allocated  VMM frees the machine page frames s corresponding to the physical page frames allocated to the balloon (thus freeing machine memory to allocate to other GuestOSs) Deflating the balloon  VMM reclaims machine page frames  VMM communicates to balloon  Balloon unpins/ frees physical page frames corresponding to new machine page frames  GuestOS uses its page replacement policy to page in needed pages

Virtualization 8 CS 5204 – Fall, 2008 Content-based page sharing A hash table contains entries for shared pages already marked “copy-on-write” A key for a candidate page is generated from a hash value of the page’s contents A full comparison is made between the candidate page and a page with a matching key value Pages that match are shared – the page table entries for their VMMs point to the same machine page If no match is found, a “hint” frame is added to the hash table for possible future matches Writing to a shared page causes a page fault which causes a separate copy to be created for the writing GuestOS

Virtualization 9 CS 5204 – Fall, 2008 Page sharing performance Identical Linux systems running same benchmark “best case” scenario Large fraction (67%) of memory sharable Considerable amount and percent of memory reclaimed Aggregate system throughput essentially unaffected

Virtualization 10 CS 5204 – Fall, 2008 Measuring Cross-VM memory usage Each GuestOS is given a number of shares, S, against the total available machine memory. The shares-per-page represents the “price” that a GuestOS is willing to pay for a page of memory. The price is determined as follows: shares price page allocation fractional usage idle page cost The idle page cost is k = 1/(1-  ) where 0 ≤  < 1 is the “tax rate” that defaults to 0.75 The fractional usage, f, is determined by sampling (what fraction of 100 randomly selected pages are accesses in each 30 second period) and smoothing (using three different weights)

Virtualization 11 CS 5204 – Fall, 2008 Memory tax experiment Initially, VM1 and VM2 converge to same memory allocation with  =0 (no idle memory tax) despite greater need for memory by VM2 When idle memory tax applied at default level (75%), VM1 relinquishes memory to VM2 which improves performance of VM2 by over 30% VM1: idles VM2: memory-intensive workload

Virtualization 12 CS 5204 – Fall, 2008 I/O Note: refers to hosted (workstation) version, not ESX (server) version Startup  VmApp loads/executes as normal application  Uses VMDriver installed in Host OS to create VMmonitor  VMDriver facilitates transfer of control between host world and VMM world (“world switch”) Overhead significant for devices with both low latency and high throughput demands (i.e., network devices)

Virtualization 13 CS 5204 – Fall, 2008 Performance Systems become CPU bound before network link is saturated Optimizations  Handling in the VMM operations to I/O ports that do not involve data transfer  Combine multiple send operations  Use shared memory bitvector to reduce cost of notifying completion of operation

Virtualization 14 CS 5204 – Fall, 2008 Hardware Support for Virtualization Vanderpool Pacifica

Virtualization 15 CS 5204 – Fall, 2008 Intel/VT-X Two forms of CPU operation  VMX root (VMM) and VMX non-root (Guest/VM)  Each has four protection levels (rings 0-3)  Each can run in separate address space Transitions  VM exit: from VM to VMM  VM entry: from VMM to VM VMCS control structure  Contains state for root and non-root  Defines processor behavior in non-root mode Deprivileged non-root execution (defined in VMCS)  Separate controls for set of privileged instructions  Interrupt controls: a VM exit occurs All interrupts When VM ready to receive interrupt As defined by bitmap VMCS VM exit saverestore VM enter non-rootroot

Virtualization 16 CS 5204 – Fall, 2008 AMD GuestOS and VMM execute in isolation Transitions:  VMRUN: begins/resumes GuestOS  Hypervisor entered on execution of privileged instruction or protected register access Virtual Machine Control Block (VMCB) stores GuestOS state on transition VMMCALL allows GuestOS to invoke hypervisor directly