Virtualization Pradipta De pradipta.de@sunykorea.ac.kr
Today s Topic Virtualization Basics System Virtualization Techniques CSE506: Ext Filesystem 2
Virtualization? A virtual machine (VM) is an emulation of a particular computer system Why is it useful? Server Workload Consolidation Security and isolation Migration Executing legacy software systems A virtual machine is implemented as a combination of a real machine and virtualizing software. What does the virtualizing software virtualize?
Basic Definitions Process Perspective System Perspective Application Binary Interface Instruction Set Architecture (ISA) interface
Process Virtual Machine Process Virtual Machine: Process VM can support the execution of a process developed for a different OS and a different ISA Virtualizing software placed at ABI interface, and emulates user level instructions and OS calls. A guest program developed for a machine (ISA and OS) other than the user s host system can be used in the same way as all other programs in the host system
System Virtual Machine System Virtual Machine: System VM provides a complete system environment Virtualizing software emulates the hardware ISA so that conventional software sees a different ISA than the one supported by hardware. The virtualizing software is often referred to as virtual machine monitor (VMM) or hypervisor.
Types of Process VMs Multiprogramming OS provides a replicated process level VM for each of concurrently executing applications Emulators and Dynamic Binary Translators Support program binaries compiled to a different ISA to run on a host with different ISA Interpretation: fetches, decodes and emulates the execution of each instruction Binary translation: blocks of source program are translated into target instructions
Types of Process VMs Conventional System HLL VM Environment High level language VM Designed to minimize dependence on hardware and OS specific features Uses an abstract ISA to generate intermediate code
System VM on same ISA Classic VM Architecture: Type-I VMM runs on H/W Good performance VMware ESXi Hosted VM Architecture: Type-II VMM runs on host OS Ease of installation VMware Workstation
Taxonomy
Another taxonomy The focus is on different system virtualization techniques Source: http://www.ravellosystems.com/blog/nested-virtualization-with-binary-translation/
History of Virtual Machine 1970s: for running multiple single user OS on IBM mainframes Drop in hardware cost, and development of multi-user OS loss in interest for VM How did the classical VM technology work? It used full virtualization supported by hardware ( trap-and-emulate technique) What virtualization techniques are commonly used since VMware re-introduced virtualization?
Which resources are virtualized? Processor Ex: Register states Memory Ex: Page tables I/O devices, platform, peripherals Disk, network interface Interrupt controller, timer, bus
Processor Virtualization (1/4) Trap-and-Emulate Guest OS runs in unprivileged state, while VMM is in privileged state Privileged instructions in guest OS traps to VMM VMM emulates the execution on real hardware Unprivileged instructions can run directly on the processor (called direct execution) Does all architectures support trap on privileged instructions when executed from unprivileged state? Many modern architectures do not, including x86
Processor Virtualization (2/4) Binary Translation Replace instructions that do not trap with trap instruction VMM emulates original instruction in trap handler Use Dynamic Binary translation Translate till the next jmp instruction
Processor Virtualization (3/4) Paravirtualization Guest OS kernel makes explicit calls to the VMM Modify OS kernel to replace non-virtualizable instructions with hypercalls Hypercalls are interfaces to the hypervisor Poor compatibility and portability since OS is modified Xen is an example of paravirtualization
Processor Virtualization (4/4) Hardware Assisted Virtualization Hardware support for virtualization increasing Intel-VT and AMD-V allows new CPU execution mode where VMM runs in a more privileged state (special root mode) than CPL=0 Privileged and sensitive calls automatically trap to VMM Kernel Virtual Machines (KVM) uses hardware assisted virtualization
Processor Virtualization Summary Binary Translation Paravirtualization Hardware Assisted
Memory Virtualization Address Translation Guest virtual address (virtual address) Guest Physical address (physical address) Guest Physical address Host Physical Address (machine address) VMM manages physical memory by swapping guest real pages into and out of its own swap space Shadow page tables maintained by VMM to reduce one level of address translation Virtual <--> machine
Putting It Together Virtualization Terminology and Background Virtualization Techniques CSE506: Ext Filesystem 20