1 Virtualization – Part III VMware Ahmad Ibrahim.

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
Virtualisation From the Bottom Up From storage to application.
G Robert Grimm New York University Disco.
Disco Running Commodity Operating Systems on Scalable Multiprocessors.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.
Virtual Machines. Virtualization Virtualization deals with “extending or replacing an existing interface so as to mimic the behavior of another system”
Virtualization for Cloud Computing
LINUX Virtualization Running other code under LINUX.
Distributed Systems CS Virtualization- Overview Lecture 22, Dec 4, 2013 Mohammad Hammoud 1.
CSE 451: Operating Systems Winter 2012 Module 18 Virtual Machines Mark Zbikowski and Gary Kimura.
Virtualization-optimized architectures
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.
Virtualization Virtualization is the creation of substitutes for real resources – abstraction of real resources Users/Applications are typically unaware.
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.
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
CS533 Concepts of Operating Systems Jonathan Walpole.
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.
Virtual Machine and its Role in Distributed Systems.
Embedded System Lab. 오명훈 Memory Resource Management in VMware ESX Server Carl A. Waldspurger VMware, Inc. Palo Alto, CA USA
Outline Basic VM Concepts Formal Definitions Virtualization Theorems
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.
Virtualization Part 2 – VMware Hardware Support. Virtualization 2 CS 5204 – Fall, 2008 VMware: binary translation Hypervisor VMM Base Functionality (e.g.
 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.
Introduction Why are virtual machines interesting?
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,
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.
1 Virtualization "Virtualization software makes it possible to run multiple operating systems and multiple applications on the same server at the same.
CS 695 Topics in Virtualization and Cloud Computing, Autumn 2012 CS 695 Topics in Virtualization and Cloud Computing More Introduction + Processor Virtualization.
Virtualization-optimized architectures
Operating Systems, 2016, Meni Adler, Danny Hendler & Amnon Meisels
Virtualization for Cloud Computing
Introduction to Virtualization
Virtualization.
Virtualization D. J. Foreman 2009.
Virtualization Technology
L2- Virtualization Technology
Presented by Mike Marty
CS 3214 Introduction to Computer Systems
CS 3214 Operating Systems Virtualization.
CS 3214 Operating Systems Virtualization Godmar Back.
Virtualization Dr. Michael L. Collard
Virtualization Virtualization is the creation of substitutes for real resources – abstraction of real resources Users/Applications are typically unaware.
Virtual Servers.
Running other code under LINUX
Virtualization Virtualization is the creation of substitutes for real resources – abstraction of real resources Users/Applications are typically unaware.
OS Virtualization.
Virtualization Techniques
Virtualization Dr. S. R. Ahmed.
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
System Virtualization
Slides from E0-253 taught by Arkaprava Basu and Vinod Ganapathy
Hypervisor A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines. A computer.
Presentation transcript:

1 Virtualization – Part III VMware Ahmad Ibrahim

VMware CS 5204 – Fall, Topics Covered – My Cheat Sheet Virtualization  Review  What is virtualization  Definition of classical virtualization  Trap-and-Emulate  Memory Management x86 Virtualization  What are the challenges Memory Tricks  What are the solutions Binary Translation Approaches to Server Virtualization  Full Virtualization  Paravirtualization OS Assisted virtualization  Hardware-assisted virtualization  Charts Memory Management  Memory Tax  Chart  Ballooning  Content based Page Sharing

VMware CS 5204 – Fall, Overview Virtualization x86 Virtualization Approaches to Server Virtualization Memory Resource Management Techniques

VMware What is Virtualization? Virtualization allows one computer to do the job of multiple computers, by sharing the resources of a single hardware across multiple environments CS 5204 – Fall, Virtualization Layer Virtual Container App. AApp. B Hardware Virtual Container App. CApp. D

VMware VMWare Product Suite Desktop – runs in a host OS  VMWare Workstation (1999) – runs on PC  VMWare Fusion – runs on Mac OS X  VMWare Player – run, but not create images Server  VMWare Server (GSX Server) –hosted on Linux or Windows  VMWare ESX (ESX Server) – no host OS  VMWare ESXi (ESX 3i) – freeware (July 2008)

VMware Terminology Virtual Machine  abstracted isolated Operating System Virtual Machine Monitor (VMM)  capable of virtualizing all hardware resources, processors, memory, storage, and peripherals  aka Hypervisor CS 5204 – Fall, Hypervisor VMM Base Functionality (e.g. scheduling) Enhanced Functionality

VMware Popek & Goldberg: Virtualization Criteria “Formal Requirements for Virtualizable Third Generation Architectures” (1974) Properties of Classical Virtualization 1. Equivalence = Fidelity Program running under a VMM should exhibit a behavior identical to that of running on the equivalent machine 2. Efficiency = Performance A statistically dominant fraction of machine instructions may be executed without VMM intervention 3. Resource Control = Safety  VMM is in full control of virtualized resources CS 5204 – Fall,

VMware CS5204 – Operating Systems Strategies: CPU Virtualization De-privileging  VMM emulates the effect on system/hardware resources of privileged instructions whose execution traps into the VMM  aka trap-and-emulate  Typically achieved by running GuestOS at a lower hardware priority level than the VMM  Problematic on some architectures where privileged instructions do not trap when executed at deprivileged priority resource vmm privileged instruction trap GuestOS resource emulate change change

VMware Strategies: Memory Virtualization CS 5204 – Fall, Primary/Shadow structures Isolation/protection of Guest OS address spaces Avoid the two levels of translation on every access Memory traces Efficient MM address translation

VMware Popek & Goldberg: Classically Virtualizable According to Popek and Goldberg, ” an architecture is virtualizable if the set of sensitive instructions is a subset of the set of privileged instructions.” CS 5204 – Fall, Is x86 Virtualizable?  No

VMware CS 5204 – Fall, Overview Virtualization x86 Virtualization Approaches to Server Virtualization Memory Resource Management Techniques

VMware Challenges to x86 Virtualization (1) Lack of trap when privileged instructions run at user-level  Classic Example: popf instruction Same instruction behaves differently depending on execution mode User Mode: changes ALU flags Kernel Mode: changes ALU and system flags Does not generate a trap in user mode CS 5204 – Fall,

VMware Challenges to x86 Virtualization (2) Visibility of privileged state  Sensitive register instructions: read or change sensitive registers and/or memory locations such as a clock register or interrupt registers:  Protection system instructions: reference the storage protection system, memory or address relocation system: CS 5204 – Fall,

VMware CS5204 – Operating Systems 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)

VMware CS5204 – Operating Systems Binary Translation TC: translation cache 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 Guest Code

VMware Eliminating faults/traps 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 CS 5204 – Fall,

VMware Binary Translation - Performance Advantages Avoid privilege instruction traps  Pentium privileged instruction (rdtsc) Trap-and- emulate: 2030 cycles Callout-and-emulate: 1254 cycles BT emulation: 216 cycles (but TSC value is stale)

VMware CS 5204 – Fall, Overview Virtualization x86 Virtualization Approaches to Server Virtualization Memory Resource Management Techniques

VMware Approaches to Server Virtualization CS 5204 – Fall, st Generation: Full virtualization (Binary translation) –Software Based –VMware and Microsoft 3 rd Generation: Silicon-based (Hardware-assisted) virtualization –Unmodified guest –VMware and Xen on virtualization-aware hardware platforms 2 nd Generation: Paravirtualization –Cooperative virtualization –Modified guest –VMware, Xen Dynamic Translation Virtual Machine Hardware Operating System Virtual Machine … Hypervisor Hardware VM Hardware Virtual Machine Virtual Machine … Hypervisor …

VMware 1 st Generation: Full Virtualization CS 5204 – Fall,

VMware Full Virtualization - Drawbacks Hardware emulation comes with a performance price In traditional x86 architectures, OS kernels expect to run privileged code in Ring 0 –However, because Ring 0 is controlled by the host OS, VMs are forced to execute at Ring 1/3, which requires the VMM to trap and emulate instructions Due to these performance limitations, paravirtualization and hardware-assisted virtualization were developed Application Ring 3 Operating System Ring 0 Traditional x86 Architecture Application Ring 3 Guest OS Ring 1 / 3 Virtual Machine Monitor Ring 0 Full Virtualization

VMware 2 nd Generation: Paravirtualization CS 5204 – Fall,

VMware Paravirtualization Challenges Guest OS and hypervisor tightly coupled  Relies on separate kernel for native and in virtual machine  Tight coupling inhibits compatibility  Changes to the guest OS are invasive  Inhibits maintainability and supportability  Guest kernel must be recompiled when hypervisor is updated CS 5204 – Fall,

VMware Hardware Support for Virtualization CS 5204 – Fall,

VMware Software vs Hardware Hardware extensions allow classical virtualization on the x86. The overhead comes with exits – it no exits, then native speed Hardware Advantages:  Code density is preserved – no translation  Precise exceptions – BT performs extra work to recover guest state for faults and interrupts in non- IDENT code  System calls run without VMM intervention Software Advantages:  Trap elimination – replaced with callouts which are usually faster  Emulation speed – callouts provide emulation routine whereas hardware must fetch and decode the trapping instruction, then emulate  Callout avoidance: BT can avoid a lot of callouts by using in-TC emulation CS 5204 – Fall,

VMware Summary CS 5204 – Fall,

VMware CS 5204 – Fall, Overview Virtualization x86 Virtualization Approaches to Server Virtualization Memory Resource Management Techniques

VMware CS5204 – Operating Systems 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  Eliminating duplicate pages – even identical pages across different GuestOSs. VMM has sufficient perspective Clear savings when running numerous copies of same GuestOS  “ballooning” – add memory demands on GuestOS so that the GuestOS decides which pages to replace Also used in Xen  Allocation algorithm Balances memory utilization vs. performance isolation guarantees “taxes” idle memory

VMware CS5204 – Operating Systems 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

VMware CS5204 – Operating Systems 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

VMware CS5204 – Operating Systems Ballooning: Inflate 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)

VMware Ballooning: Deflate 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 CS 5204 – Fall,

VMware CS5204 – Operating Systems 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)

VMware CS5204 – Operating Systems 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

VMware ??? CS 5204 – Fall,

VMware References and Sources A Comparison of Software and Hardware Techniques for x86 Virtualization Keith Adams & Ole Agesen A Comparison of Software and Hardware Techniques for x86 Virtualization Mike Marty A Comparison of Software and Hardware Techniques for x86 Virtualization A Comparison of Software and Hardware Techniques for x86 Virtualization Jordan and Justin Ehrlich A Comparison of Software and Hardware Techniques for x86 Virtualization A Survey on Virtualization Technologies Susanta K Nanda A Survey on Virtualization Technologies Disco: Running Commodity Operating Systems on Scalable Multiprocessors Divya Parekh Disco: Running Commodity Operating Systems on Scalable Multiprocessors Hardware Support for Efficient Virtualization John Fisher-Ogden Hardware Support for Efficient Virtualization Memory Resource Management in VMware ESX Server Carl A. Waldspurger Memory Resource Management in VMware ESX Server VMware Memory Resource Management in VMware ESX Server Resource Management Carl A. Waldspurger Resource Management Understanding Intel® Virtualization Technology (VT) Dr. Michael L. Collard Understanding Intel® Virtualization Technology (VT) CS 5204 – Fall,

VMware References and Sources Understanding Memory Resource Management in VMwareо ESX™ Server VMware Understanding Memory Resource Management in VMwareо ESX™ Server Understanding Full Virtualization, Paravirtualization and Hardware Assist VMware Understanding Full Virtualization, Paravirtualization and Hardware Assist Virtualization Intel and Argentina Software Pathfinding and Innovation Virtualization VMware and CPU Virtualization Technology Jack Lo VMware and CPU Virtualization Technology VMware Virtualization of Oracle and Java Scott Drummonds & Tim Harris VMware Virtualization of Oracle and Java Lecture on Vmware Dr. Dennis Kafura Lecture on Vmware What is Virtualization Scott Devine What is Virtualization CS 5204 – Fall,