Chapter 16- Virtual Machines.ppt
《Chapter 16- Virtual Machines.ppt》由会员分享,可在线阅读,更多相关《Chapter 16- Virtual Machines.ppt(47页珍藏版)》请在麦多课文档分享上搜索。
1、Chapter 16: Virtual Machines,Chapter 16: Virtual Machines,Overview History Benefits and Features Building Blocks Types of Virtual Machines and Their Implementations Virtualization and Operating-System Components Examples,Chapter Objectives,To explore the history and benefits of virtual machinesTo di
2、scuss the various virtual machine technologiesTo describe the methods used to implement virtualizationTo show the most common hardware features that support virtualization and explain how they are used by operating-system modules,Overview,Fundamental idea abstract hardware of a single computer into
3、several different execution environments Similar to layered approach But layer creates virtual system (virtual machine, or VM) on which operation systems or applications can run Several components Host underlying hardware system Virtual machine manager (VMM) or hypervisor creates and runs virtual ma
4、chines by providing interface that is identical to the host (Except in the case of paravirtualization) Guest process provided with virtual copy of the host Usually an operating system Single physical machine can run multiple operating systems concurrently, each in its own virtual machine,System Mode
5、ls,(a) Nonvirtual machine,(b) Virtual machine,Implementation of VMMs,Vary greatly, with options including: Type 0 hypervisors - Hardware-based solutions that provide support for virtual machine creation and management via firmware IBM LPARs and Oracle LDOMs are examples Type 1 hypervisors - Operatin
6、g-system-like software built to provide virtualization Including VMware ESX, Joyent SmartOS, and Citrix XenServer Type 1 hypervisors Also includes general-purpose operating systems that provide standard functions as well as VMM functions Including Microsoft Windows Server with HyperV and RedHat Linu
7、x with KVM Type 2 hypervisors - Applications that run on standard operating systems but provide VMM features to guest operating systems Includeing VMware Workstation and Fusion, Parallels Desktop, and Oracle VirtualBox,Implementation of VMMs (cont.),Other variations include: Paravirtualization - Tec
8、hnique in which the guest operating system is modified to work in cooperation with the VMM to optimize performance Programming-environment virtualization - VMMs do not virtualize real hardware but instead create an optimized virtual system Used by Oracle Java and Microsoft.Net Emulators Allow applic
9、ations written for one hardware environment to run on a very different hardware environment, such as a different type of CPU Application containment - Not virtualization at all but rather provides virtualization-like features by segregating applications from the operating system, making them more se
10、cure, manageable Including Oracle Solaris Zones, BSD Jails, and IBM AIX WPARs Much variation due to breadth, depth and importance of virtualization in modern computing,History,First appeared in IBM mainframes in 1972 Allowed multiple users to share a batch-oriented system Formal definition of virtua
11、lization helped move it beyond IBM A VMM provides an environment for programs that is essentially identical to the original machine Programs running within that environment show only minor performance decreases The VMM is in complete control of system resources In late 1990s Intel CPUs fast enough f
12、or researchers to try virtualizing on general purpose PCs Xen and VMware created technologies, still used today Virtualization has expanded to many OSes, CPUs, VMMs,Benefits and Features,Host system protected from VMs, VMs protected from each other I.e. A virus less likely to spread Sharing is provi
13、ded though via shared file system volume, network communication Freeze, suspend, running VM Then can move or copy somewhere else and resume Snapshot of a given state, able to restore back to that state Some VMMs allow multiple snapshots per VM Clone by creating copy and running both original and cop
14、y Great for OS research, better system development efficiency Run multiple, different OSes on a single machine Consolidation, app dev, ,Benefits and Features (cont.),Templating create an OS + application VM, provide it to customers, use it to create multiple instances of that combination Live migrat
15、ion move a running VM from one host to another! No interruption of user accessAll those features taken together - cloud computing Using APIs, programs tell cloud infrastructure (servers, networking, storage) to create new guests, VMs, virtual desktops,Building Blocks,Generally difficult to provide a
16、n exact duplicate of underlying machine Especially if only dual-mode operation available on CPU But getting easier over time as CPU features and support for VMM improves Most VMMs implement virtual CPU (VCPU) to represent state of CPU per guest as guest believes it to be When guest context switched
17、onto CPU by VMM, information from VCPU loaded and stored Several techniques, as described in next slides,Building Block Trap and Emulate,Dual mode CPU means guest executes in user mode Kernel runs in kernel mode Not safe to let guest kernel run in kernel mode too So VM needs two modes virtual user m
18、ode and virtual kernel mode Both of which run in real user mode Actions in guest that usually cause switch to kernel mode must cause switch to virtual kernel mode,Trap-and-Emulate (cont.),How does switch from virtual user mode to virtual kernel mode occur? Attempting a privileged instruction in user
19、 mode causes an error - trap VMM gains control, analyzes error, executes operation as attempted by guest Returns control to guest in user mode Known as trap-and-emulate Most virtualization products use this at least in part User mode code in guest runs at same speed as if not a guest But kernel mode
20、 privilege mode code runs slower due to trap-and-emulate Especially a problem when multiple guests running, each needing trap-and-emulate CPUs adding hardware support, mode CPU modes to improve virtualization performance,Trap-and-Emulate Virtualization Implementation,Building Block Binary Translatio
21、n,Some CPUs dont have clean separation between privileged and nonprivileged instructions Earlier Intel x86 CPUs are among them Earliest Intel CPU designed for a calculator Backward compatibility means difficult to improve Consider Intel x86 popf instruction Loads CPU flags register from contents of
22、the stack If CPU in privileged mode - all flags replaced If CPU in user mode - on some flags replaced No trap is generated,Binary Translation (cont.),Other similar problem instructions we will call special instructions Caused trap-and-emulate method considered impossible until 1998 Binary translatio
23、n solves the problem Basics are simple, but implementation very complex If guest VCPU is in user mode, guest can run instructions natively If guest VCPU in kernel mode (guest believes it is in kernel mode) VMM examines every instruction guest is about to execute by reading a few instructions ahead o
24、f program counter Non-special-instructions run natively Special instructions translated into new set of instructions that perform equivalent task (for example changing the flags in the VCPU),Binary Translation (cont.),Implemented by translation of code within VMM Code reads native instructions dynam
25、ically from guest, on demand, generates native binary code that executes in place of original code Performance of this method would be poor without optimizations Products like VMware use caching Translate once, and when guest executes code containing special instruction cached translation used inste
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CHAPTER16VIRTUALMACHINESPPT
