CSCI 8530 Advanced Operating Systems Part 19 Virtualization
Virtualization This is a very old idea It appears in many different forms A variety of commercial products exist The idea has become hot again
Virtual Applied to an OS Became popular in the 1960s Idea is an abstraction that hides details Examples Process abstraction of one program running on a computer Virtual memory abstraction of physical memory File abstraction of disk storage Timesharing systems each user presented with abstraction of an isolated computer Device-independent I/O abstraction of physical device interface
History of Software Virtual Machines 1960s: BCPL uses O-Code interpreter 1970s: P-Code interpreter developed to make Pascal portable Compiler produces P-Code Only P-code interpreter needs to be ported 1990s: Java JVM follows same approach as Pascal
History of Virtual Machine (VM) Hardware Hardware on early IBM computers, such as the 7044, was barely able to support concurrent processes 1964: IBM creates System/360 line of computers 1966: IBM introduces the System 360/67 (model 67) Support for virtual memory All hardware interfaces exported through a Virtual Machine Monitor (VMM) VMM ran on raw hardware and allowed multiple operating systems (called supervisors) to be instantiated simultaneously on top of the VMM VMM gave each operating system the illusion of running on the underlying hardware (i.e., operating system was unchanged)
History of Virtual Machine (VM) Hardware (continued) 1967?: VMM on a model 67 supports multiple simultaneous copies of the Cambridge Monitor System (CMS) Inside IBM, model 67 ran CP-67 which allowed the 67 to simulate multiple 360 models 1970: IBM announced the System/370 series that built on the 360/67 2000s: IBM mainframes (system Z) trace their roots to the model 67 Intel introduces the ability to trap certain instructions, making it possible to build virtual machine software on Intel processors
Types of Machine Virtualization Foreign architecture emulation Full (native) virtualization Paravirtualization
Foreign Architecture Emulation Software emulates architecture X on machine with architecture Y Usually runs much slower than machine Y native code Motivations Run software intended for machine of type X on machine of type Y Develop or test software for machine X before the hardware is available Examples Emulate PowerPC on an ARM Emulate MIPS on an x86
Illustration of Architecture Emulation If emulation is complete, can run OS code plus applications User can choose which OS(es) to run at a given time
Full Virtualization Also known as native virtualization Uses Virtual Machine (VM) abstraction Layer of software exports multiple copies of the underlying hardware Originally called a Virtual Machine Monitor Now known has a hypervisor Key idea Hypervisor allows normal instructions to run directly on underlying hardware, and only intercepts privileged instructions (e.g., I/O) Makes emulation efficient enough to use
Illustration of Architecture Emulation Normal instructions run on raw hardware; hypervisor intercepts privileged instructions Special hardware may be required (e.g., extra mode) Manager launches and controls guest operating systems
Full Virtualization and Older Hardware Older hardware Lacks ability to trap all privileged instructions Only has one kernel mode (no special mode for hypervisor) Is not able to support full virtualization One option for older hardware is paravirtualization
Paravirtualization Alternative to full virtualization Guest OS must be modified before it can run We say it is hypervisor aware Some privileged instructions are replaced with hypervisor calls Main motivation: allow virtualization on older hardware Has fallen out of favor
Illustration of Paravirtualization Hypervisor and manager operate the same as with full virtualization Guest OS calls hypervisor when necessary Manager launches and controls guest operating systems
Example Virtualization Technologies Proprietary products VMware: widely used full virtualization z/vm: IBM full virtualization plus LAN emulation Open emulation Virtual Box (VBox): free and runs as an application QEMU: complete emulation of various architectures UML (User Mode Linux): allows multiple, isolated copies of Linux to run on top of an underlying Linux with UML KVM: full virtualization integrated into Linux kernel
Possible Hypervisor Designs Take over the hardware completely Run as a kernel module in another OS Run as an application Note: each approach has been used in at least one technology.
Linux KVM (Kernel Virtual Machine) Illustrates kernel module approach Runs as a module in the Linux kernel Turns Linux into a hypervisor Offers full virtualization Uses three modes Kernel mode for the KVM kernel User mode for applications Guest mode for guest operating systems
Illustration of KVM Linux with KVM module acts as hypervisor Normal apps can co-exist with guest OS
Virtual Networks Many processor virtualization technologies support network virtualization One or more network interfaces can be configured for each VM Each network interface on a VM can be connected to a specific virtual network Other possibilities Bridged virtual networks Network Address Translation between virtual networks and a real network
VM Migration Used in a data center cluster to balance load Requires Many computers in a cluster under same administrative control Each computer runs a hypervisor Management system software can migrate a VM from one computer to another Manager sets policies for migration Hypervisors must provide uniform access to files and communication mechanisms
Summary Virtualization started in the 1960s IBM System 360/67 had hardware to support a virtual machine monitor Modern virtualization paradigms include Emulation Full virtualization Paravirtualization (popularity is fading) Both proprietary (e.g., VMware) and open source (e.g., VBox) virtualization systems exist
Semester Wrap-Up
What You (Hopefully) Learned In-depth understanding of major parts of an operating system, including: Process manager Memory manager Device manager Interprocess communication Internet communication A hierarchical approach to organizing the pieces Basic concepts, typical policies, and implementation details Appreciation of design decisions and tradeoffs How to think like a systems person
What You (Hopefully) Learned (continued) A key set of invariants and principles How an operating system can provide convenient abstractions over low-level hardware How operating system functions can be implemented without resorting to millions of lines of code How seemingly straightforward policies can interact in unexpected ways How intellectually challenging it can be to understand all the consequences of even a basic system How to write code internal to an operating system
Operating Systems Difficult Because Details count (and can be overwhelming) An OS is tightly integrated with hardware, and hardware keeps changing One doesn t build a static system; the entire system must be configurable, and must adapt to variants of the hardware The prevalence of Internet means an operating systems cannot be designed without including communication protocols and distributed functionality Although no individual piece of an operating system is intrinsically complex, the intellectual challenge arises from making all the pieces work together in a smooth, unified manner
Unsolved Problems Operating systems research has made a comeback Current topics include Multi-core operating systems File systems and drivers for solid-state disks Power-aware operating systems (especially for embedded systems) Systems for wide-area VM management and migration Large-scale distributed file systems Automated configuration of systems, especially configuration of VM systems