【正文】
ave the same kind of guest operating system 24 中間件對虛擬化的支持 — 庫級(jí)虛擬化 ? Librarylevel virtualization is also known as userlevel Application Binary Interface (ABI) or API emulation ? create execution environments for running alien programs on a platform rather than creating a VM to run the entire operating system ? API call interception and remapping are the key functions 25 中間件對虛擬化的支持 26 CPU、內(nèi)存和 I/O設(shè)備的虛擬化 為支持虛擬化,處理器利用硬件輔助虛擬化,引入一種特殊的運(yùn)行模式和指令,使得 VMM和客戶操作系統(tǒng)可運(yùn)行在不同模式中,客戶操作系統(tǒng)及其應(yīng)用程序的所有敏感指令會(huì) trap到 VMM中。 盡管 VE可為不同用戶分別定制,但它們?nèi)怨蚕硗粋€(gè)操作系統(tǒng)內(nèi)核。 從用戶的視角來看, VE就像真實(shí)服務(wù)器。它使得在一個(gè)操作系統(tǒng)內(nèi)核中可以同時(shí)運(yùn)行多個(gè)隔離的虛擬機(jī)。半虛擬化虛擬機(jī)在用戶程序中提供了特殊的 API,要求真正修改操作系統(tǒng)。特定的應(yīng)用可運(yùn)行在虛擬機(jī)中。 該主機(jī)操作系統(tǒng)仍舊負(fù)責(zé)管理硬件??蛻舨僮飨到y(tǒng)和它們的應(yīng)用由非臨界和臨界指令構(gòu)成。 全虛擬化不需要修改主機(jī)操作系統(tǒng)。 Domain 0可以直接訪問硬件和管理設(shè)備。 Major VMM and Hypervisor Providers 13 3. 2虛擬化的結(jié)構(gòu) /工具與機(jī)制 ? Hypervisor ? 全虛擬化 基于主機(jī)的虛擬化 ? 半虛擬化 14 hypervisor與 Xen體系結(jié)構(gòu) ? The hypervisor supports hardwarelevel on bare metal devices like CPU, memory, disk and work interfaces ? he hypervisor software sits directly between the physical hardware and its OS ? The hypervisor provides hypercalls for the guest OSes and applications 15 ?Xen是一個(gè)由劍橋大學(xué)開發(fā)的開源 hypervisor程序。第一, VMM應(yīng)該為程序提供與原始硬件機(jī)器基本一致的環(huán)境;第二,運(yùn)行在該環(huán)境中的程序的性能損失應(yīng)較低;第三,系統(tǒng)資源應(yīng)處于 VMM的完全控制之中。 limitation: poor application flexibility and isolation 10 UserApplication level: It virtualizes an application as a virtual machine. This layer sits as an application program on top of an operating system and exports an abstraction of a VM that can run programs written and piled to a particular abstract machine definition. Typical systems: JVM , NET CLI , Panot Advantage: has the best application isolation Shorting amp。s VPS / FVM Advantage: have minimal starup/shutdown cost, low resource requirement, and high scalability。 limitation: One source instruction may require tens or hundreds of native target instructions to perform its function, which is relatively slow. VISA requires adding a processorspecific software translation layer in the plier. 7 Virtualization at Hardware Abstraction level: Virtualization is performed right on top of the hardware. It generates virtual hardware environments for VMs, and manages the underlying hardware through virtualization. Typical systems: VMware, Virtual PC, Xen Advantage: has higher performance and good application isolation Shorting amp。1 Chapter 3: Virtual Machines and Virtualization of Clusters and datacenters 虛擬化 2 虛擬化的實(shí)現(xiàn)層次 虛擬化技術(shù)通過在同一個(gè)硬件主機(jī)上多路復(fù)用虛擬機(jī)的方式來共享昂貴的硬件資源, 虛擬化的基本思想是分離軟硬件以產(chǎn)生更好的系統(tǒng)性能 虛擬化實(shí)現(xiàn)的層次 引入虛擬化后,不同用戶應(yīng)用程序由自身的操作系統(tǒng)(即客戶操作系統(tǒng))管理,并且那些客戶操作系統(tǒng)可以獨(dú)立于主機(jī)操作系統(tǒng)同時(shí)運(yùn)行在同一個(gè)硬件上,這通常是通過新添加一個(gè)稱為虛擬化層的軟件來完成,該虛擬化層稱為 hypervisor或虛擬機(jī)監(jiān)視器( Virtual Machine Monitor, VMM) 3 虛擬化軟件的主要功能是將一個(gè)主機(jī)的物理硬件虛擬化為可被各虛擬機(jī)互斥使用的虛擬資源,可在多個(gè)層次實(shí)現(xiàn) 4 從硬件到應(yīng)用程序的 5個(gè)虛擬化抽象層次 5 ?指令集體系結(jié)構(gòu)級(jí):代碼解釋和動(dòng)態(tài)二進(jìn)制翻譯 ?硬件抽象級(jí):虛擬化一個(gè)計(jì)算機(jī)硬件資源 ?操作系統(tǒng)級(jí):在單一物理服務(wù)器上創(chuàng)建隔離的容器和操作系統(tǒng)實(shí)例 ?庫支持級(jí):庫接口的虛擬化 ?應(yīng)用程序級(jí):進(jìn)程級(jí)虛擬化、高級(jí)語言( High Level Language, HLL)虛擬機(jī) 6 Virtualization at ISA level: Emulating a given ISA by the ISA of