Virtual Machine Monitors: Technology and Trends - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

Virtual Machine Monitors: Technology and Trends

Description:

Allow users to run multiple commodity OSes on a single piece of ... Reducing need for dual-booting. VMM Organizational Types. Exokernel-like layer (Type I) ... – PowerPoint PPT presentation

Number of Views:117
Avg rating:3.0/5.0
Slides: 44
Provided by: jonatha315
Category:

less

Transcript and Presenter's Notes

Title: Virtual Machine Monitors: Technology and Trends


1
Virtual Machine MonitorsTechnology 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 doesnt 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
VMM Organizational Types
App
App
App
App
App
App
App
App
GuestOS
GuestOS
GuestOS
GuestOS
GuestOS
VM
VM
VM
VM
VM
VMM
App
VMM
HostOS
Hardware
Hardware
  • Exokernel-like layer (Type I)
  • Multiplexes and manages hardware through virtual
    layer
  • Layered on Host OS (Type II)
  • Use HostOS to interface with 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 doesnt 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
  • coughWindowscough
  • Legacy apps compatible with older OSes
  • Can be reasonably fast?

19
Design Decisions
Para-Virtualized Binary Translation
Exokernel Xen VMWare ESX
Hosted VMWare WS (sort of)
20
An example Page Tables
Application
OS
VMWare
Shadow Table
Page Table
  • VMWare Keeps a shadow copy of page table

21
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
Xen
Add page 10
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 Paging Policy Decisions at the VMM Level
  • VMM decides to take a page from the OS

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

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

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

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

VMM
Guest OS
Main Memory
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
Using a Balloon Process
request memory
Guest OS
VMM
Balloon Process
Main Memory
Page A
Page B
Page C
Page D
34
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
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
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/D
ocuments/hypervisor_performance_comparison_1_0_5_w
ith_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
Write a Comment
User Comments (0)
About PowerShow.com