Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07.

Similar presentations


Presentation on theme: "Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07."— 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 Server A Why a VMM? Application A Server B Application B Client (Windows) Client (Linux) OS AOS B

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

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

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

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

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

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

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

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

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

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 Para-VirtualizedBinary Translation ExokernelXenVMWare ESX HostedVMWare WS (sort of)

20 An example: Page Tables VMWare: Keeps a shadow copy of page table ApplicationOSVMWare Page Table Shadow Table

21 An example: Page Tables 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 ApplicationOSVMWare Page Table Shadow Table “Add page 10” “Add page 52”

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

23 An example: Page Tables 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 ApplicationOSXen Page Table “Add page 10”

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 Paging Policy Decisions at the VMM Level VMM decides to take a page from the OS Guest OS Page A Page B Page C Page D VMM Main Memory Disk

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

29 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 Guest OS Page A Page B Page C Page D VMM Main Memory Disk

30 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… Guest OS Page A Page B Page C Page D VMM Main Memory Disk

31 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! Guest OS Page A Page B Page C Page D VMM Main Memory Disk

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 Using a Balloon Process Guest OS Page A Page B Page C Page D VMM Main Memory Disk Balloon Process “request memory”

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

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

36 Using a Balloon Process Guest OS Page A Page B Page C Page D VMM Main Memory Disk Balloon Process “he gave me page c” “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 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


Download ppt "Virtual Machine Monitors: Technology and Trends Jonathan Kaldor CS614 / F07."

Similar presentations


Ads by Google