Top Banner
GGF Brussels 20 September 2004 Virtualization Steve Hand Keir Fraser, Ian Pratt, Christian Limpach, Dan Magenheimer (HP), Mike Wray (HP), R Neugebauer (Intel), M Williamson (Intel) Computer Laboratory
28

Steve Hand

Jan 11, 2016

Download

Documents

Xen and the Art of Virtualization. Steve Hand Keir Fraser, Ian Pratt, Christian Limpach, Dan Magenheimer (HP), Mike Wray (HP), R Neugebauer (Intel), M Williamson (Intel). - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Steve Hand

GGF Brussels 20 September 2004

Xen and the Art of

Virtualization

Steve HandKeir Fraser, Ian Pratt, Christian Limpach, Dan Magenheimer (HP), Mike Wray (HP), R Neugebauer (Intel), M Williamson (Intel)

Computer Laboratory

Page 2: Steve Hand

Talk Outline

Background: XenoServers The Xen Virtual Machine Monitor

Architectural EvolutionSystem PerformanceSubsystem Details…

Status & Future Work

Page 3: Steve Hand

XenoServers

Global services and apps Exploit network topology Open, commercial infra.

Incremental rollout Flexible platform Unified management

XenoServer

Deploy

Client

XenoCorp

Page 4: Steve Hand

Architecture components

Brokers (e.g. XenoCorp) Intermediary between user and merchant

Resource search services (e.g. XenoSearch) Suggest ‘best’ XenoServer(s) for a job

Other high-level services and libraries Distributed file systems, control interface,

resource management wrappers

Execution platform (XenoServer) Securely partition and account resource usage

Page 5: Steve Hand

Architecture components

And don’t mandate single OS image… And use commodity (viz. x86) hardware… But retain high performance!

These goals led to the design and implementation of the Xen hypervisor

Execution platform (XenoServer) Securely partition and account resource usage

Page 6: Steve Hand

XenoServers vs. GRID

Grids XenoServers

Resource

IsolationApplication level Xen VMM

QoS isolation None, so far Xen VMM

Supported codeSpecific OS or prog.

languageAny OS(*)

Topology Hidden Exploited

Businessmodel

Free,non-profitable

Commercial,

self-funded

Users Co-operative scientists Competing customers

Page 7: Steve Hand

Requirements

Isolation for competing services: Secure protection Strong resource isolation and QoS

• CPU, memory, disk space and b/w, network b/w Accounting and logging

Flexible execution environment Linux, NetBSD, Windows XP, …

Support many services per machine Only limited by the service’s resource needs

Service-based management incl. migration

Page 8: Steve Hand

Virtualization Options

Single OS image: Ensim, Vservers, CKRM Group user processes into resource containers Hard to get strong isolation

Full virtualization: VMware, VirtualPC Run multiple unmodified guest OSes Hard to efficiently virtualize x86

Para-virtualization: UML, Xen Run multiple guest OSes ported to special arch Arch xen/x86 is very close to normal x86

Page 9: Steve Hand

Xen 2.0 Features

Secure isolation between VMs Resource control and QoS Only guest kernel needs to be ported

All user-level apps and libraries run unmodified Linux 2.4/2.6, NetBSD, FreeBSD, WinXP

Execution performance is close to native Live Migration of VMs between Xen nodes Xen hardware support:

SMP; x86 / x86_64 / ia64; all Linux drivers

Page 10: Steve Hand

Xen 1.2 Architecture

Unmodified User-Level Application

Software

Ported ‘Guest’ Operating Systems

Xen Hypervisor

Hardware

Domain 0 Domain 1 Domain 2 Domain 3

Page 11: Steve Hand

Xen 2.0 Architecture

Unmodified User-Level Application

Software

Ported ‘Guest’ Operating Systems

Xen Hypervisor

Hardware

Domain 0 Domain 1 Domain 2 Domain 3

Page 12: Steve Hand

System Performance

L X V U

SPEC INT2000 (score)

L X V U

Linux build time (s)

L X V U

OSDB-OLTP (tup/s)

L X V U

SPEC WEB99 (score)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

1.1

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

Page 13: Steve Hand

Xen Para-Virtualization

Arch xen/x86 – like x86, but replace privileged instructions with Xen hypercalls Avoids binary rewriting and fault trapping For Linux 2.6, only arch-dep files modified

Modify OS to understand virtualised env. Wall-clock time vs. virtual processor time

• Xen provides both types of alarm timer

Expose real resource availability• Enables OS to optimise behaviour

Page 14: Steve Hand

x86 CPU virtualization

Xen runs in ring 0 (most privileged) Ring 1/2 for guest OS, 3 for user-space

GPF if guest attempts to use privileged instr Xen lives in top 64MB of linear addr space

Segmentation used to protect Xen as switching page tables too slow on standard x86

Hypercalls jump to Xen in ring 0 Guest OS may install ‘fast trap’ handler

Direct ring user-space to guest OS system calls MMU virtualisation: shadow vs. direct-mode

Page 15: Steve Hand

MMU Virtualizion : Shadow-Mode

MMU

Accessed &dirty bits

Guest OS

VMM

Hardware

guest writes

guest reads Virtual → Pseudo-physical

Virtual → Machine

Updates

Page 16: Steve Hand

MMU Virtualization : Direct-Mode

MMU

Guest OS

Xen VMM

Hardware

guest writes

guest reads

Virtual → Machine

Page 17: Steve Hand

Para-Virtualizing the MMU

Guest OSes allocate and manage own PTs Hypercall to change PT base

Xen must validate PT updates before use Updates may be queued and batch processed

Validation rules applied to each PTE:1. Guest may only map pages it owns*2. Pagetable pages may only be mapped RO

Xen tracks page ownership and current use L4/L3/L2/L1/Normal (plus ref count)

Page 18: Steve Hand

MMU Micro-Benchmarks

L X V U

Page fault (µs)

L X V U

Process fork (µs)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

1.1

lmbench results on Linux (L), Xen (X), VMWare Workstation (V), and UML (U)

Page 19: Steve Hand

I/O Architecture

Xen IO-Spaces delegate guest OSes protected access to specified h/w devices Virtual PCI configuration space Virtual interrupts

Devices are virtualised and exported to other VMs via Device Channels Safe asynchronous shared memory transport ‘Backend’ drivers export to ‘frontend’ drivers Net: use normal bridging, routing, iptables Block: export any blk dev e.g. sda4,loop0,vg3

Page 20: Steve Hand

Device Channel Interface

Page 21: Steve Hand

TCP results

L X V U

Tx, MTU 1500 (Mbps)L X V U

Rx, MTU 1500 (Mbps)L X V U

Tx, MTU 500 (Mbps)L X V U

Rx, MTU 500 (Mbps)

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0

1.1

TCP bandwidth on Linux (L), Xen (X), VMWare Workstation (V), and UML (U)

Page 22: Steve Hand

Isolated Driver VMs

0

50

100

150

200

250

300

350

0 5 10 15 20 25 30 35 40

time (s)

Page 23: Steve Hand

Live migration for clusters Pre-copy approach: VM continues to run ‘lift’ domain on to shadow page tables

Bitmap of dirtied pages; scan; transmit dirtied Atomic ‘zero bitmap & make PTEs read-only’

Iterate until no forward progress, then stop VM and transfer remainder

Rewrite page tables for new MFNs; Restart Migrate MAC or send unsolicited ARP-

Reply Downtime typically 10’s of milliseconds

(though very application dependent)

Page 24: Steve Hand

Scalability

Scalability principally limited by Application resource requirements several 10’s of VMs on server-class machines

Balloon driver used to control domain memory usage by returning pages to Xen Normal OS paging mechanisms can deflate

quiescent domains to <4MB Xen per-guest memory usage <32KB

Additional multiplexing overhead negligible

Page 25: Steve Hand

Scalability

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)

Page 26: Steve Hand

Resource Differentation

2 4 8 8(diff)OSDB-IR

2 4 8 8(diff)OSDB-OLTP

0.0

0.5

1.0

1.5

2.0

Simultaneous OSDB-IR and OSDB-OLTP Instances on Xen

Ag

gre

gate

th

rou

gh

pu

t re

lati

ve t

o o

ne in

stan

ce

Page 27: Steve Hand

On-Going Work

xend web control interface Cluster management tools

Load balancing SMP guest OSes (have SMP hosts

already) Support for Intel VT/LT x86 extensions

Will enable full virtualization VM Checkpointing

Debugging and fault tolerance

Page 28: Steve Hand

Conclusions

Xen is a complete and robust GPL VMM Outstanding performance and scalability Excellent resource control and protection Late “RC” of 2.0 out now:

Linux 2.4.27 & 2.6.8.1, NetBSD 2.0 CPU, memory, network isolation Basic support for ballooning, migration

http://xen.sf.net