Device Virtualization

Download Report

Transcript Device Virtualization

Device Virtualization
Scott Devine, VMware, Inc.
© 2010 VMware Inc. All rights reserved
Outline
 Types of Device Virtualization
• Direct Access
• Emulated
• Para-virtualized
 Storage Virtualization
• Copy-on-Write Disks
2
Computer System Organization
CPU
Memory
MMU
Controller
Local Bus
Interface
High-Speed
I/O Bus
NIC
Controller
Bridge
Frame
Buffer
LA
N
Low-Speed
CD-ROM
3
USB
I/O Bus
Device Virtualization
 Goals
• Isolation
• Multiplexing
• Speed
• Mobility
• Interposition
 Device Virtualization Strategies
• Direct Access
• Emulation
• Para-virtualization
4
Direct Access Device
VM
Guest
OS
CPU
Memory
MMU
Controller
Local Bus
Interface
High-Speed
I/O Bus
NIC
Controller
Bridge
Frame
Buffer
LAN
Low-Speed
CD-ROM
5
USB
I/O Bus
Memory Isolation w/ Direct Access Device
VM
Guest
OS
CPU
Memory
MMU
Controller
Local Bus
Interface
IOMMU
High-Speed
I/O Bus
NIC
Controller
Bridge
Frame
Buffer
LAN
Low-Speed
CD-ROM
6
USB
I/O Bus
Virtualization Enabled Device
VM2
VM1
Guest CPU Guest
OS
OS
Memory
MMU
Controller
Local Bus
Interface
IOMMU
High-Speed
I/O Bus
vNIC 2
vNIC 1
NIC
Controller
Bridge
Frame
Buffer
LA
N
Low-Speed
CD-ROM
7
USB
I/O Bus
Direct Access Device Virtualization
 Allow Guest OS direct access to underlying device
 Positives
• Fast
• Simplify monitor
• Limited device drivers needed
 Negatives
• Need hardware support for safety (IOMMU)
• Need hardware support for multiplexing
• Hardware interface visible to guest
• Limits mobility of VM
• Interposition hard by definition
8
Confidential
Emulated Devices
 Emulate a device in class
• Emulated registers
• Memory mapped I/O or programmed I/O
 Convert
• Intermediate representation
 Back-ends per real device
9
Serial Port Example
User App
Serial Chip
Guest
ABC
Emulation
Generic Serial
Layer
Serial
Chip
Host OS
ABC
Driver
Monitor
Serial
Chip
XYZ
10
LAN
Emulated Devices
 Positives
• Platform stability
• Allows interposition
• No special hardware support needed
• Isolation, multiplexing implemented by monitor
 Negatives
• Can be slow
• Drivers needed in monitor or host
11
Para-Virtualized Devices
 Guest passes requests to Monitor at a higher abstraction level
• Monitor calls made to initiate requests
• Buffers shared between guest / monitor
 Positives
• Simplify monitor
• Fast
 Negatives
• Monitor needs to supply guest-specific drivers
• Bootstrapping issues
12
Traditional Architecture
Linux
Linux (devel)
XP
Virtual Machine Monitor
Hardware
13
Vista
MacOS
Hosted Monitor Architecture
Guest OS (Linux)
User App
Kernel
Module
Host OS (Window XP)
Virtual Machine Monitor
Hardware
14
VMware ESX 2.0
Source: http://www.vmware.com/pdf/esx2_performance_implications.pdf
15
Hybrid Ex 2 - Xen 3.0

Para–virtualization
• Linux Guest

Hardware-supported virtualization
• Unmodified Windows

Isolated Device Drivers
Source: Ottawa Linux Symposium 2006 presentation.
http://www.cl.cam.ac.uk/netos/papers/
16
Hypervisor
 Hardware-supported single-use monitor
 Characteristics
• Small size
• Runs in a special hardware mode
User
• Guest OS runs in normal privilege level
Mode
 Uses
• Security
• System management
• Fault tolerance
Operating System
Kernel
Mode
Hypervisor
Monitor
Mode
Hardware
17
Virtual Disks
 File on file system
• Host file system
• Hypervisor file system
 Meta-data in file
• Maps disk blocks to file offsets
• Flat file
• Indexed file
• Allows disk to grow on demand
18
Copy-on-Write Disks
Win XP
+ SP1
19
+ SP2
+ SP2
IE 7
Copy-on-Write Disks
Win XP
+ SP1
20
+ SP2
+ SP2
IE 7
Read
s
Writes
Non-persistent Execution
Win XP
+ SP1
+ SP2
+ SP2
IE 7
Temp
21
Reads
Writes