9b.ppt

30
Xen and the Art of Virtualization Paul Barham, Boris Dragovic, Keir Fraser, Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield Neugebauer, Ian Pratt, Andrew Warfield University of Cambridge Computer Laboratory University of Cambridge Computer Laboratory Presented by: Brandon Elting Presented by: Brandon Elting

Transcript of 9b.ppt

Page 1: 9b.ppt

Xen and the Art of Virtualization

Paul Barham, Boris Dragovic, Keir Fraser, Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew WarfieldNeugebauer, Ian Pratt, Andrew WarfieldUniversity of Cambridge Computer LaboratoryUniversity of Cambridge Computer Laboratory

Presented by: Brandon EltingPresented by: Brandon Elting

Page 2: 9b.ppt

Outline

• Why Virtualization?

• Overview of Xen

• Benchmark Results

• Xen Today

• Conclusion

Page 3: 9b.ppt

Outline

Why Virtualization?

• Overview of Xen

• Benchmark Results

• Xen Today

• Conclusion

Page 4: 9b.ppt

Why Virtualization?

•Problem Domain

•Virtualization

•Paravirtualization

Page 5: 9b.ppt

Problem Domain

• Need to execute a diverse range of applications and services• Need to support multiple OSes and configurations• Solution: Run multiple processes on a single

machine• Unfortunate configuration interactions

• Solution: Run separate OSes on different machines• Maintenance Issues• Keep machines busy

• Support Legacy Software on Modern Hardware

Page 6: 9b.ppt

Virtualization

• Present the illusion of many small Virtual Machines to run multiple instances of different Operating Systems concurrently• Virtual Machine exactly like physical machine

• Pros• Can run unmodified OSes in VM

• Cons• Performance• Uncooperative hardware

• Solution: binary rewriting

• Examples• VM/370, VMware, Disco

Page 7: 9b.ppt

Paravirtualization

• Present an idealized VM abstraction to guest OSes• Differs from underlying hardware interface

• Pros• Can deal with difficult to virtualize

architectures• Exposing both a virtual and real interface

leads to potential performance enhancements

• Cons• Must port existing OSes to run on

paravirtualized host

• Example• Denali

Page 8: 9b.ppt

Outline

Why Virtualization?Overview of Xen

• Benchmark Results

• Xen Today

• Conclusion

Page 9: 9b.ppt

Overview of Xen

• High-Performance, Paravirtualized Virtual Machine Monitor/Hypervisor

• Runs on 32-bit x86 Processors

• Provides an environment to execute up to 100 VM instances simultaneously

• Focus on Performance Isolation

• Attempts to minimize overhead associated with virtualization

• Supports Ported Guest Operating Systems• XenoLinux - Port of Linux 2.4• XenoXP - Port of Windows XP (in development)

Page 10: 9b.ppt

Machine Running Xen Hypervisor

H/W (SMP x86, physical memory, enet, SCSI/IDE)

Domain0ControlInterface

VirtualPhysicalMemory

Virtualx86 CPU

VirtualNetwork

VirtualBlockDev

GuestOS(XenoLinux)

ControlPlane

Software

Xeno-AwareDevice Drivers

GuestOS(XenoXP)

UserSoftware

Xeno-AwareDevice Drivers

GuestOS(XenoBSD)

UserSoftware

Xeno-AwareDevice Drivers

GuestOS(XenoLinux)

UserSoftware

Xeno-AwareDevice Drivers

Page 11: 9b.ppt

Virtual Machine Interface

• CPU

• Memory

• Device I/O

• Control Management

Page 12: 9b.ppt

Virtualized CPU

• CPU Execution• Non-Privileged Instructions can run directly on “bare

hardware”• Privileged operations must be marshaled by Xen

• Privilege Levels• x86 has four privileged levels (rings) 0-3 (0=more … 3=less)• Xen runs at ring0, Guest OS at ring1, apps at ring3

• Exception Handling• Guest provides virtual IDT• Most ISRs same as on real x86 hardware, page-fault is

special case

• Interrupts and Events• Handled via “event channels,” Xen upcalls into guest• Maskable, analogous to disabling interrupts• ‘Fast’ exception handler for Guest OS system-calls

Page 13: 9b.ppt

Memory Management 1

• Page Tables• Guests responsible for managing their own page tables• Updates to page tables must go through Xen• Guests have direct read access to page tables• Updates to page tables can be batched• Page frames contain reference count and type

• Translation Lookaside Buffer• x86’s hardware managed TLB complicates virtualization• Xen mapped to the top 64MB of each address space, saves

TLB flushes

• Segmentation• Handled in a similar manner as page tables

Page 14: 9b.ppt

Memory Management 2

• Physical Memory• Most Operating Systems expect contiguous memory

addresses• Illusion of contiguous physical memory provided

by physical-hardware map• Exposing both hardware and physical memory

addresses provides area for optimization• Cache locality

Page 15: 9b.ppt

Device I/O

• Xen exposes a set of clean and simple device abstractions

• I/O data transferred between guest and Xen via aync I/O Rings

• Network Device• VFR - Virtual Firewall-Router• VIF - Virtual Network Interface

• Disks• VBD - Virtual Block Devices

Page 16: 9b.ppt

Control Management

• Domain0• Created at Xen boot-time• Has access to Xen’s control interface

• Hosts application-level management software

• Provides separation of policy and mechanism

Page 17: 9b.ppt

Control Transfer

• Hypercalls• Synchronous communication between Hypervisor and Guest

• Analogous to system calls

• Events• Asynchronous notifications to domains• Used to notify domains of device driver interrupts

• Lightweight notification of important events• ie. Domain-termination requests

Page 18: 9b.ppt

Data Transfer

• I/O Rings• Mechanism to allow efficient moving of data vertically through system

• Based around two pairs of producer-consumer pointers

• Unique request ids allow reordering• Allows producer to enqueue multiple requests and defer notifying consumer

Page 19: 9b.ppt

Outline

Why Virtualization? Overview of XenBenchmark Results

• Xen Today

• Conclusion

Page 20: 9b.ppt

Benchmark Results

• Compare Linux to different Virtualization techniques

• XenoLinux compared against• Linux, VMWare, User-Mode Linux

• Benchmarks• SPEC: cpu intensive• Linux build: 7% of time spent in kernel• OSDB-IR/OLTP: OS intensive, many domain

transitions• Dbench: filesystem intensive• SPEC WEB99: good overall measure

Page 21: 9b.ppt

Performance

LL XX VV UU

SPEC INT2000 (score)SPEC INT2000 (score)

LL XX VV UU

Linux build time (s)Linux build time (s)

LL XX VV UU

OSDB-OLTP (tup/s)OSDB-OLTP (tup/s)

LL XX VV UU

SPEC WEB99 (score)SPEC WEB99 (score)

0.00.0

0.10.1

0.20.2

0.30.3

0.40.4

0.50.5

0.60.6

0.70.7

0.80.8

0.90.9

1.01.0

1.11.1

Benchmark suite running on Linux (L), Xen (X), VMware Workstation (V), and UML (U)Benchmark suite running on Linux (L), Xen (X), VMware Workstation (V), and UML (U)

Source: xen-lwe2005-short.ppt

Page 22: 9b.ppt

Concurrent VM

L X

2L X

4L X

8L X

16

0

200

400

600

800

1000

Simultaneous SPEC WEB99 Instances on Linux (L) and Xen(X)

Source: xen-lwe2005-short.ppt

Page 23: 9b.ppt

Additional Results

• Performance Isolation• Execute domains with “anti-social” processes• OSDB-IR and SPEC WEB99 only slightly

affected

• Scalability• Run up to 100 VMs concurrently• Only a loss of 7.5% throughput compared to

Linux

Page 24: 9b.ppt

Outline

Why Virtualization? Overview of Xen Architecture Benchmark ResultsXen Today

• Conclusion

Page 25: 9b.ppt

Xen Today

• Current Version: Xen 3.2 (Released Jan ‘08)

• Supports HW Virtualization Extensions (Intel IVT, AMD-V)• Runs unmodified OSes

• Supports SMP Virtualized Guest OSes

• Supported OSes: Windows, Linux, Solaris, BSD, …

• Virtualizes Architectures: x86, x86/64, IA64, PowerPC, …

• Live VM Relocation• Load balancing across a cluster

• Graphics Virtualization: Direct3D, OpenGL

Page 26: 9b.ppt

Outline

Why Virtualization? Overview of Xen Benchmark Results Xen TodayConclusion

Page 27: 9b.ppt

Conclusion

• Xen provides excellent platform for deploying a wide variety of differing applications

• Xen provides necessary protection and performance isolation

• Paravirtualization provides near native performance

Page 28: 9b.ppt

Outline

Why Virtualization? Overview of Xen Benchmark Results Xen Today Conclusion

Page 29: 9b.ppt

References

• www.xen.org

• www.cl.cam.ac.uk/research/srg/netos/xen

Page 30: 9b.ppt

Questions/Comments?