1 / 43

Virtual Machine Monitors: Technology and Trends

Virtual Machine Monitors: Technology and Trends. Jonathan Kaldor CS614 / F07. Virtual machine Monitors (VMMs). Allow users to run multiple commodity OSes on a single piece of hardware Applications unchanged Resources fairly distributed and multiplexed

Télécharger la présentation

Virtual Machine Monitors: Technology and Trends

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. Virtual Machine Monitors:Technology and Trends Jonathan Kaldor CS614 / F07

  2. Virtual machine Monitors (VMMs) • Allow users to run multiple commodity OSes on a single piece of hardware • Applications unchanged • Resources fairly distributed and multiplexed • Can get, but doesn’t need help from hardware/OS • Main difference between two papers

  3. Why a VMM? Server A Server B OS A OS B Application A Application B Client (Windows) Client (Windows) Client (Linux)

  4. Why a VMM? Server A • Hardware consolidation OS A Application A Application B Client (Windows) Client (Windows) Client (Linux)

  5. Why a VMM? Server A • Hardware consolidation OS A Application A Application B Client (Windows) Client (Windows) Client (Linux)

  6. Why a VMM? Server A • Hardware consolidation OS A ??? Application A Application B Windows Linux Client (Windows) Client (Windows) Client (Linux)

  7. Why a VMM? Server A • Hardware consolidation OS A Application A Application B Client (Windows) Client (Linux)

  8. Why a VMM? Server A • Hardware consolidation OS A Application A Application B Client (Windows) Client (Linux)

  9. Why a VMM? Server A • Hardware consolidation • While preserving boundaries OS A Application A Application B Client (Windows) Client (Linux)

  10. Why a VMM? Server A • Hardware consolidation • While preserving boundaries VMM Guest OS A Guest OS B Application A Application B Client (Windows) Client (Windows) Client (Linux)

  11. Applications • Server consolidation • Application hosting • Application mobility • Security • Reducing need for dual-booting

  12. Exokernel-like layer (Type I) Multiplexes and manages hardware through virtual layer Layered on Host OS (Type II) Use HostOS to interface with hardware VMM Organizational Types App App App App App App App App GuestOS GuestOS GuestOS GuestOS GuestOS VM VM VM VM VM App VMM VMM HostOS Hardware Hardware

  13. To Host or Not to Host • Hosted eases development • Can use HostOS drivers to interface with hardware • But performs poorly • Hybrid systems (modify HostOS for performance)

  14. Performance • Run code directly on CPU for speed • Conflicting requirements: • VMM needs to maintain control • OS assumes it is privileged • Solution: run Guest OS code directly in less-privileged level • How to deal with the consequences?

  15. Hardware Issues(or why no one has ever called x86 elegant, part 15,023) • Allows multiple privilege levels (ring 0-3) • ISA can be ill-defined in virtualized environment • Silent failures, multiple outcomes, etc • Hardware page tables • Nontrivial for VMM to exert control

  16. (Para-) Virtualization • OS no longer has complete control over hardware • Paravirtualization • Provide alternatives to privileged instructions • Requires modifying source code of GuestOS • Binary Translation • Translate privileged instructions to virtualized alternatives while running

  17. (Para-) Virtualization, cont. • Arguments for paravirtualization • Can improve performance • Important virtual/nonvirtual concepts • Time! • Architecture doesn’t necessarily work well with full virtualization

  18. (Para-) Virtualization, cont. • Arguments for binary translation • Does not require access to source • Unrealistic at times to modify the OS • *cough*Windows*cough* • Legacy apps compatible with older OSes • Can be reasonably fast?

  19. Design Decisions

  20. An example: Page Tables Application OS VMWare Shadow Table Page Table • VMWare: Keeps a shadow copy of page table

  21. “Add page 52” “Add page 10” An example: Page Tables Application OS VMWare Shadow Table Page Table • VMWare: Keeps a shadow copy of page table • Detects when change is made, makes corresponding change to shadow table • Translation from OS address to machine address

  22. An example: Page Tables Application OS Xen Page Table • Xen: OS tells Xen about the page table, relinquishes write control

  23. An example: Page Tables Application OS “Add page 10” Xen Page Table • Xen: OS tells Xen about the page table, relinquishes write control • OS tells Xen what updates it wants to make • Xen ensures updates are legal, can batch

  24. Xen: Improving Performance • Minimize TLB flushes • Xen lives at top 64MB of every address space • Allow batch updates/requests to Xen • I/O, page tables, etc • OS-specified handlers • Need to guarantee safety

  25. Xen I/O • Use ring structure to queue requests / responses • Enables batching, reordering • Virtual Network Interface • Rules used to correctly route packets • Avoids copying via page trading

  26. Oversubscribing Memory • “Hundreds” of OSes, each with 128MB of maximum memory • Need to efficiently allocate memory among OSes, effectively page to disk • Disk paging at VMM level can result in poor behavior

  27. Disk Disk Paging Policy Decisions at the VMM Level • VMM decides to take a page from the OS VMM Main Memory Guest OS Page A Page B Page C Page D

  28. Disk Disk Paging Policy Decisions at the VMM Level • VMM decides to take a page from the OS VMM Main Memory Guest OS Page A Page B Page C Page D

  29. Disk Disk Paging Policy Decisions at the VMM Level • VMM decides to take a page from the OS • OS decides to page to disk as well, picks same page VMM Main Memory Guest OS Page A Page B Page C Page D

  30. Disk Disk Paging Policy Decisions at the VMM Level • VMM decides to take a page from the OS • OS decides to page to disk as well, picks same page • VMM now needs to reload page from disk… VMM Main Memory Guest OS Page A Page B Page C Page D

  31. Disk Disk Paging Policy Decisions at the VMM Level • VMM decides to take a page from the OS • OS decides to page to disk as well, picks same page • VMM now needs to reload page from disk… • … solely so the Guest OS can write it back out to disk! VMM Main Memory Guest OS Page A Page B Page C Page D

  32. Using the OS paging algorithm • Lesson: The VMM is necessarily a poor estimator of which page to claim • Use OS paging algorithm instead • Balloon process

  33. Disk Using a Balloon Process “request memory” Guest OS VMM Balloon Process Main Memory Page A Page B Page C Page D

  34. Disk Using a Balloon Process “request memory” Guest OS VMM Balloon Process Main Memory Page A Page B Page C Page D “process needs pages badly!”

  35. Disk Using a Balloon Process “request memory” Guest OS VMM Balloon Process Main Memory Page A Page B Page C Page D “process needs pages badly!”

  36. Disk Using a Balloon Process “he gave me page c” Guest OS VMM Balloon Process Main Memory Page A Page B Page C Page D “take page c”

  37. Additional Memory Tricks • Still need a paging algorithm in case ballooning fails • Potentially many copies of the same page • Detect these, remap them with copy-on-write • VMWare: 7-30% memory savings in real world

  38. Performance

  39. Performance L: Native Linux, X: Xen, V: VMWare, U: User-Mode Linux

  40. Multi-OS Performance

  41. Xen Versus VMWare ESX (with a bucket of salt) From “A Performance Comparison of Commercial Hypervisors”, XenSource http://www.xensource.com/Documents/hypervisor_performance_comparison_1_0_5_with_esx-data.pdf

  42. Conclusions • Either approach works well in practice • Small but noticeable performance penalty • Becoming a nonissue • OS support for virtualization • Microsoft Windows (?!) • Hardware support

  43. The Future • Virtualization is probably going to become more commonplace • Hardware support will hopefully eliminate some issues • In a way, back to where we started • Resurrection of an old research idea to solve new problems

More Related