1 / 41

Virtualization

Operating system (vimia219). Virtualization. Zoltan Micskei http://www.mit.bme.hu/~micskeiz. Virtualization. Central concept in computers Virtualization : hiding the actual parameters of a resource from its users , e.g. presenting a resource as separate logical ones ,

odetta
Download Presentation

Virtualization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating system (vimia219) Virtualization Zoltan Micskei http://www.mit.bme.hu/~micskeiz

  2. Virtualization • Central concept in computers • Virtualization: hiding the actual parameters of a resource from its users, e.g. • presenting a resource as separate logical ones, • presenting separate resources as one logical… • Virtual memory, virtual filesystem…

  3. The virtualization buzzword Packaged applications Computer virtualization Dymamic management, lifecycle, templates… Thin clients Hiding the storage structure + OS level virtualization: separate OS containers Desktop products Misused termonology

  4. Virtual machine taxonomy* VM seesan ABI VM sees a hardware Java, .NET… Multiprog-rammed OS Source: J. Smith and Ravi Nair, “The architecture of virtual machines,” IEEEComputer, vol. 38, 2005, pp. 32-38. * taxonomy ~ structure for presenting relationships between concepts

  5. Virtual machine taxonomy (detailed)

  6. Platform virtualization • Platform virtualization: virtualizing a full computer, running multiple OS on one hardware • Also known as: server, computer, hardware virtualization.. • Concepts: • Hostmachine = physical computer • Guestmachine = virtual computer • VirtualMachine Monitor (VMM): program managing the virtual machines

  7. History of platformvirtualization • ~1960 - IBM CP-40 system • in the mainframe products • x86 virtualization • Seemed impossible • 1997: Stanford, Discoprojects • 1998: VMwaresolution • 2000- Other solutions • Now: • has its own business • becomes commodity

  8. Why is platform virtualization good? Building test systems HW consolidation Legacysystems On-demandarchitectures High availability, disaster recovery Portable applications …

  9. Platform virtualization GUEST App. App. ManagementApp. App. App. App. OS OS Management OS OS OS OS Virt. SW Virt. SW Hardware Hardware Neve: VMM – VirtualMachine Monitor Hypervisor Main component: VMM – VirtualMachine Monitor HOST Hosted Bare-metal Mainly desktop productsL:VMware Workstation, Server, Player, OracleVirtualBox,MS VirtualPC, KVM, UML Mainly server products: VMware ESX Server, XenEnterprise, MS Hyper-V Two approaches:

  10. Usecase: mobil virtualization

  11. Theoretical background

  12. Requirements Gerald J. Popek, Robert P. Goldberg: Formal Requirements for Virtualizable Third Generation Architectures. Commun. ACM 17(7): 412-421 (1974) Requirements fora virtualization solution: Equivalence: programs in a VM should perform indistinguishable from running on the hardware Resource control: the VMM should handle all the physical resources Efficiency: most of the VM’s instructions should run directly on the hardware

  13. Main problem • The system must be protected from the guests • E.g.: HLT (Halt) instruction • Desirable: only the VM should stop • But all VMs would stop if executed • Solution: VMM monitors the guest instructions • Privileged instructions should be handled

  14. Theoretical background CPU virtualization Memory virtualization I/O virtualization

  15. Basic methods – Full emulation Full state of the virtual hardware is stored in the emulator (registers, flags) Virtual machine Application • Every instruction is • inspected by the VMM Virtual HW Emulator State of virtual HW • Instruction is applied in the emulator,transforms the instruction, executes • Pro: • Different CPU can be emulated • Con: • Slow HW

  16. Basic methods – Trap and emulate Virtual machine Application • Non-privileged instructions are • directly executed on the hardware Virtual HW • Privileged or sensitive instructions cause a trap, VMM handles it Emulator State of virtual HW • HW support is required: • protection modes (e.g. x86 ring) • VM runs in a lower mode • Privileged instructions should case a trap when called from a non-privileged mode HW Trap: hardware exception handling, which resumes execution after the handler

  17. Issues with x86 virtualization Conclusion: the trap & emulatemethod cannot be used on the original x86 • Some architectures can be easily virtualized • x86 cannot • From ~250 instructions 17 violate the classical requirements, e.g. • POPF instruction: modifies EFLAGS register • But if not executed in ring 0, doesn’t throw an exception • Privileged state can be detected • OS can detected whether it’s running in a VM

  18. Solutions for virtualizing x86 Binary translation (software) Paravirtualization Hardware-assisted virtualization

  19. Binary translation most of the instructions run directly privileged instructions translated runtime doesn’t need source caches translated code guest OS not aware of virtualization

  20. Binary translation – example Guest Code Translation Cache vEPC movebx, eax movebx, eax start cli mov [VIF], 0 and ebx, ~0xfff and ebx, ~0xfff movebx, cr3 mov [CO_ARG], ebx sti call HANDLE_CR3 ret mov [VIF], 1 test [INT_PEND], 1 jne call HANDLE_INTS jmp HANDLE_RET Source: Carl Waldspurger,IntroductiontoVirtualMachines

  21. Paravirtualization Modifying the source of the guest OS Replacing “problematic” instructions Hypercall: calling the VMM directly

  22. Hardware-assisted virtualization • ~2005: Intel Virtualization Technology (VT-x) andAMD AMD-V • HW support: rootmode, VMCS • Instructions: VMCALL, VMLAUNCH • trap & emulate now works

  23. What is the best? 2006. VMware: BT is betterthan HW assistedvirtualization 2008. VMware: Paravirtalization + BT is betterthanpure BT 2009. Comparing Hardware Virtualization Performance Utilizing VMmark v1.1 • Answer changes constantly • Depends on the environment, workload • BT used to be more matures, but.. • Most products mix several techniques

  24. Theoretical background CPU virtualization Memory virtualization I/O virtualization

  25. Memory virtualization(software) Guest page tables VM1 VM2 Guest: virtual memory Guest: „physical” memory Machine: physical memory Instead of double translation:shadow page tables ISSUE: synchronization VM allocation page tables

  26. Memory virtualization (paravirtualization) Also uses shadow page tables Modifying the guest OS source code When the OS modifies it’s page tables, it should notify the VMM also

  27. Memory virtualization(hardware) • HW support in the recent CPUs • AMD Rapid Virtualization Indexing , Intel ExtendedPageTables • Nestedpagetable • Storing guest physical -> machines physical translation • Traversed by HW address translation • Tagging TLB entries • Great performance increase: • 2008. 04., KVM: MMU paravirtualization is dead • 2009., VMware: Performance Evaluation of AMD RVI Hardware Assist, 42% improvement in some cases

  28. Theoretical background CPU virtualization Memory virtualization I/O virtualization

  29. Handling I/O devices (software) Virtual machine • Emulating the whole real communication Guest OS Unmodified driver VMM Emulated virtual HW HW manager I/O device

  30. Handling I/O devices(paravirtualization) Virtual machine Virtual machine Guest OS Guest OS Unmodified driver Paravirt. driver • Simplified calls, • communication through shared memory VMM VMM Emulated virtual HW HW manager HW manager I/O device I/O device • Special package installed in the VM: • VMwareTools, Virtual PC Additions • Always install these!

  31. Handling I/O devices (hardware) • Hardware support • Intel VT-d, AMD IOMMU • PCI standard extensions: I/O Virtualization (IOV) • I/O devices • can be shared between VMs • can be directly assigned to one VM

  32. Products and companies

  33. Players http://www.virtualization.info/radar/

  34. Players

  35. Centralized management • Resource pools • VM maps • Performance graphs • LiveMigration – moving VMs between hosts on the fly

  36. Cloudcomputing ???

  37. Cloudcomputing Cloud

  38. Types of cloud computing

  39. Future (?): Mirage OS

  40. More information • OleAgesenet al.: The evolution of an x86 virtual machine monitor, SIGOPS Oper. Syst. Rev. 44, 4 (December 2010) • P. Barhamet al.: Xenand the Art of Virtualization, SIGOPS Oper. Syst. Rev. 37, 5 (October 2003)

  41. Summary • Virtualization: became commodity • Conflicting terminology • Many competing vendors • Operating systems • Core functions implemented in the hypervisor • Purpose of general OS?

More Related