1 xen and the art of virtualization by paul barham, boris dragovic, stevan hand, tim harris, alex...

25
1 Xen and the Art of Xen and the Art of Virtualization Virtualization By Paul Barham, Boris Dragovic, Stevan By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Neugebauer, Ian Pratt, and Andrew Warfield. Warfield. Presented by Diana Carroll Presented by Diana Carroll

Upload: daniel-fields

Post on 23-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

11

Xen and the Art of Xen and the Art of VirtualizationVirtualization

By Paul Barham, Boris Dragovic, Stevan By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Hand, Tim Harris, Alex Ho, Rolf

Neugebauer, Ian Pratt, and Andrew Neugebauer, Ian Pratt, and Andrew Warfield.Warfield.

Presented by Diana CarrollPresented by Diana Carroll

Page 2: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

22

Virtual MachinesVirtual Machines One hardware system with memory, One hardware system with memory,

processors, I/O devices.processors, I/O devices. Multiple execution environments that each Multiple execution environments that each

map to an identical representation of the map to an identical representation of the physical system.physical system. An OS running on a virtual machine is not aware that it An OS running on a virtual machine is not aware that it

is sharing the machine.is sharing the machine. Virtual machines must be isolated from each other even Virtual machines must be isolated from each other even

though they share the same hardware.though they share the same hardware. The execution of one can’t stall or corrupt the others.The execution of one can’t stall or corrupt the others. The performance overhead needs to be acceptably small.The performance overhead needs to be acceptably small.

The virtual machines must share the hardware as The virtual machines must share the hardware as equally as possible.equally as possible.

A Virtual Machine Monitor is needed to A Virtual Machine Monitor is needed to accomplish this.accomplish this.

Page 3: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

33

Virtual Machine MonitorsVirtual Machine Monitors Also known as a hypervisor.Also known as a hypervisor. Provides an interface for multiple virtual Provides an interface for multiple virtual

machines to coexist together.machines to coexist together. Can run multiple operating systems on a Can run multiple operating systems on a

single computer.single computer. Provides stability, since even if one OS crashes, the rest Provides stability, since even if one OS crashes, the rest

of the machine remains functional.of the machine remains functional. Can eliminate the need for multiple machines dedicated Can eliminate the need for multiple machines dedicated

to different operating systems.to different operating systems. Provides isolation between operating system Provides isolation between operating system

instances and multiplexes physical resources instances and multiplexes physical resources across the running virtual machines.across the running virtual machines. Much like an OS does with processes.Much like an OS does with processes.

Page 4: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

44

XenXen Xen is a Virtual Machine Monitor (VMM).Xen is a Virtual Machine Monitor (VMM). Allows users to dynamically instantiate an operating Allows users to dynamically instantiate an operating

system.system. Hosts operating systems such as Linux and Windows.Hosts operating systems such as Linux and Windows.

Some source code modifications are necessary.Some source code modifications are necessary. In the paper, XenoLinux was complete, Windows XP and NetBSD In the paper, XenoLinux was complete, Windows XP and NetBSD

still in progress.still in progress. Now, NetBSD, Linux, FreeBSD, Plan9, and NetWare are complete. Now, NetBSD, Linux, FreeBSD, Plan9, and NetWare are complete.

WindowsXP port was successful, but licensing prohibitions prevent WindowsXP port was successful, but licensing prohibitions prevent it from being released. (1)it from being released. (1)

Multiple operating systems can run simultaneously Multiple operating systems can run simultaneously and perform different tasks.and perform different tasks.

Is completely software based and requires no special Is completely software based and requires no special hardware support.hardware support. Full virtualization, in which the virtual hardware is identical to Full virtualization, in which the virtual hardware is identical to

the underlying physical hardware, is virtually impossible on the the underlying physical hardware, is virtually impossible on the x86 architecture.x86 architecture.

Xen provides a similar, but not quite identical view of the Xen provides a similar, but not quite identical view of the hardware.hardware.

Page 5: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

55

Xen Design PrinciplesXen Design Principles Support unmodified application binaries.Support unmodified application binaries.

Necessary to ensure that it is useful for users.Necessary to ensure that it is useful for users. Support fully functional, multi-application Support fully functional, multi-application

operating systems a guests.operating systems a guests. Use paravirtualization to provide high Use paravirtualization to provide high

performance and good resource isolation.performance and good resource isolation. The guest operating system has to be modified to run on The guest operating system has to be modified to run on

the Virtual Machine Monitor.the Virtual Machine Monitor. Specifically, the guest OS can no longer execute in ring Specifically, the guest OS can no longer execute in ring

0, because that ring is now occupied by the VMM.0, because that ring is now occupied by the VMM. The guest OS has to be modified to run outside of ring 0.The guest OS has to be modified to run outside of ring 0.

Sometimes more correct behavior and Sometimes more correct behavior and better performance are achieved when the better performance are achieved when the resource virtualization is not completely resource virtualization is not completely hidden.hidden.

Page 6: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

66

Xen versus DiscoXen versus Disco Disco uses true virtualization (almost)Disco uses true virtualization (almost)

True virtualization does not require any modification of True virtualization does not require any modification of the guest OS.the guest OS.

The virtual machine is indistinguishable from the real The virtual machine is indistinguishable from the real hardware.hardware.

Xen uses paravirtualizationXen uses paravirtualization The guest OS has to be modified, or ported, onto the Xen The guest OS has to be modified, or ported, onto the Xen

hypervisor.hypervisor. Xen virtual machines resemble the real hardware but do Xen virtual machines resemble the real hardware but do

not attempt to be an exact match.not attempt to be an exact match. When appropriate, the guest OS makes calls to the When appropriate, the guest OS makes calls to the

hypervisor rather than to the hardware.hypervisor rather than to the hardware. e.g. For memory management and I/O.e.g. For memory management and I/O.

Solves the problem of architectures like the x86 that do Solves the problem of architectures like the x86 that do not support true virtualization.not support true virtualization.

The TLB is hardware managed rather than software The TLB is hardware managed rather than software managed.managed.

Page 7: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

77

The Virtual Machine The Virtual Machine InterfaceInterface

A paravirtualized version of the X86 interface.A paravirtualized version of the X86 interface. In this case, the x86 architecture is a worst-case environment.In this case, the x86 architecture is a worst-case environment.

Divided into memory management, CPU, and I/O.Divided into memory management, CPU, and I/O. Guest operating systems execute within domains.Guest operating systems execute within domains.

A domain is a running virtual machine.A domain is a running virtual machine.

Page 8: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

88

Memory ManagementMemory Management Guest OS’s are responsible for allocating and Guest OS’s are responsible for allocating and

managing the hardware page tables.managing the hardware page tables. Minimal involvement from Xen is required to ensure safety Minimal involvement from Xen is required to ensure safety

and isolation.and isolation. Necessary since x86 does not have a software-managed Necessary since x86 does not have a software-managed

TLB, which could be efficiently virtualized.TLB, which could be efficiently virtualized. Xen exists in a 64MB section at the top of each Xen exists in a 64MB section at the top of each

address space.address space. This avoids the TLB being flushed each time the execution This avoids the TLB being flushed each time the execution

path enters or leaves the hypervisor.path enters or leaves the hypervisor. Guest OS allocates and initializes a new page Guest OS allocates and initializes a new page

table from its own memory and then registers table from its own memory and then registers it with Xen.it with Xen. All subsequent updates must be validated by Xen.All subsequent updates must be validated by Xen. Updates can be batched to improve efficiency.Updates can be batched to improve efficiency.

Segment descriptors are also validated. They Segment descriptors are also validated. They must have lower privelege than Xen, and must have lower privelege than Xen, and cannot allow access to the Xen-reserved cannot allow access to the Xen-reserved portion of the address space.portion of the address space.

Page 9: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

99

Virtualizing the CPUVirtualizing the CPU Applications run at different privilege levels.Applications run at different privilege levels.

Typically, in x86, an OS runs at ring 0, as the most privileged Typically, in x86, an OS runs at ring 0, as the most privileged entity in the system.entity in the system.

Applications usually run at ring 3.Applications usually run at ring 3. With a virtualized CPU, the OS no longer runs at With a virtualized CPU, the OS no longer runs at

ring 0.ring 0. This privilege level is now reserved for the VMM.This privilege level is now reserved for the VMM. The guest OS must be modified to run at a lower privilege The guest OS must be modified to run at a lower privilege

level.level. Since most OS implementations do not use rings 1 and 2, the Since most OS implementations do not use rings 1 and 2, the

guest OS can be ported to ring 1.guest OS can be ported to ring 1. This prevents the guest OS from executing This prevents the guest OS from executing

privileged hypervisor code, but keeps it safely privileged hypervisor code, but keeps it safely isolated from applications that are still running isolated from applications that are still running in ring 3.in ring 3.

Page 10: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1010

CPU virtualization CPU virtualization continuedcontinued

Privileged instructions are required to be Privileged instructions are required to be validated and executed within Xen.validated and executed within Xen. e.g. Installing a new page table or yielding the processor.e.g. Installing a new page table or yielding the processor. Attempts to execute a privileged instruction fails since Attempts to execute a privileged instruction fails since

only Xen operates at the highest privilege level.only Xen operates at the highest privilege level. Exceptions are managed using a table of Exceptions are managed using a table of

exception handlers.exception handlers. Page fault handler is the only one that has to be modified Page fault handler is the only one that has to be modified

to read from an extended stack frame instead of a to read from an extended stack frame instead of a register.register.

System calls allow each guest OS to register a ‘fast’ System calls allow each guest OS to register a ‘fast’ exception handler, since it is not necessary for it to run in exception handler, since it is not necessary for it to run in ring 0.ring 0.

All exception handlers are validated by Xen.All exception handlers are validated by Xen. Checked to ensure that the handler code does not Checked to ensure that the handler code does not

specify execution in ring 0.specify execution in ring 0.

Page 11: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1111

I/OI/O Xen uses a set of device abstractions Xen uses a set of device abstractions

instead of emulating existing instead of emulating existing hardware devices.hardware devices. I/O data is transferred to and from each I/O data is transferred to and from each

domain via Xen.domain via Xen. ““Shared memory, asynchronous buffer-Shared memory, asynchronous buffer-

descriptor rings” are used to pass I/O buffer descriptor rings” are used to pass I/O buffer information vertically through the system.information vertically through the system.

Asynchronous notifications of I/O Asynchronous notifications of I/O events are made to a domain.events are made to a domain. Made by updating a bitmap of pending event Made by updating a bitmap of pending event

types, and possible calling an event handler as types, and possible calling an event handler as specified by its OS.specified by its OS.

Page 12: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1212

Porting an OS to XenPorting an OS to Xen Requires less than 2% of the total lines of Requires less than 2% of the total lines of

code to be modified.code to be modified.

The User Software The User Software runs on the Guest OS runs on the Guest OS without requiring without requiring modification.modification.

Page 13: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1313

Separating Policy from Separating Policy from MechanismMechanism

The hypervisor only provides basic control The hypervisor only provides basic control operations.operations. Authorized domains can export these operations through a Authorized domains can export these operations through a

control interface.control interface. An initial domain, Domain0, is created at boot time and can An initial domain, Domain0, is created at boot time and can

access the control interface.access the control interface. It can then use the control interface to create and manage It can then use the control interface to create and manage

additional domains.additional domains. Responsible for building the domain and initial structures to Responsible for building the domain and initial structures to

support each guest OS.support each guest OS. Can be specialized to handle the varying requirements of Can be specialized to handle the varying requirements of

different OSes.different OSes. The control interface also supports virtual I/O devices.The control interface also supports virtual I/O devices.

Virtual Network Interfaces (VIF) and Virtual Block Devices (VBD).Virtual Network Interfaces (VIF) and Virtual Block Devices (VBD). Additional administrative tools may be added to Domain0 in the Additional administrative tools may be added to Domain0 in the

future.future.

Page 14: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1414

Control TransferControl Transfer Hypercalls are made from a domain to Hypercalls are made from a domain to

Xen.Xen. A synchronous software trap into the hypervisor.A synchronous software trap into the hypervisor.

e.g. to request a set of page-table updates or other e.g. to request a set of page-table updates or other privileged operation.privileged operation.

Control is returned to the calling domain when the Control is returned to the calling domain when the call is completed.call is completed.

Notifications from Xen to a domain are Notifications from Xen to a domain are made using an asynchronous event made using an asynchronous event mechanism.mechanism. Replaces the delivery mechanism for device Replaces the delivery mechanism for device

interrupts.interrupts. Allows lightweight notification of events.Allows lightweight notification of events. Similar to Unix signals.Similar to Unix signals.

Page 15: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1515

Device TransferDevice Transfer The virtual memory The virtual memory

manager is an extra manager is an extra protection domain protection domain between guest OS and I/O between guest OS and I/O device.device. Data needs to be transferred from Data needs to be transferred from

I/O device to OS with as little I/O device to OS with as little overhead as possible.overhead as possible.

I/O descriptor rings are a I/O descriptor rings are a circular queue of circular queue of descriptors that hold descriptors that hold producer/consumer producer/consumer pointer pairs.pointer pairs. Descriptors are allocated by Descriptors are allocated by

a domain, but accessible a domain, but accessible from within Xen.from within Xen.

Access to the ring is Access to the ring is controlled by two pairs of controlled by two pairs of pointers.pointers.

Domains produce requests Domains produce requests and advance the request and advance the request producer pointer.producer pointer.

Xen removes requests and Xen removes requests and advances the request advances the request consumer pointer.consumer pointer.

Xen produces responses and Xen produces responses and advances the response advances the response producer pointer.producer pointer.

Domains remove responses Domains remove responses and advance the response and advance the response consumer pointer.consumer pointer.

Page 16: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1616

Virtualization of System Virtualization of System ComponentsComponents

CPU scheduling is done using the Borrowed Virtual CPU scheduling is done using the Borrowed Virtual Time algorithm. Time algorithm. Thread execution is monitored in terms of virtual time.Thread execution is monitored in terms of virtual time.

The scheduler selects the thread with the earliest effective virtual The scheduler selects the thread with the earliest effective virtual time.time.

A thread can borrow virtual time by warping back to appear earlier A thread can borrow virtual time by warping back to appear earlier and gain dispatch priority.and gain dispatch priority.

But it then goes to the end of the line after execution. But it then goes to the end of the line after execution. Protects against low-latency threads using excessive Protects against low-latency threads using excessive

processing cycles.processing cycles. CPU resources are allocated dynamically, no need to predict CPU resources are allocated dynamically, no need to predict

processing requirements in advance.processing requirements in advance. Guest OSes are given three ways of interpreting Guest OSes are given three ways of interpreting

time.time. Virtual time only advances while the domain is executing.Virtual time only advances while the domain is executing. Real time is the time in nanoseconds since the machine boot Real time is the time in nanoseconds since the machine boot

(can be locked to an external time source).(can be locked to an external time source). Wall-clock time is real-time + offset. Wall-clock time is real-time + offset.

Page 17: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1717

Components Continued: Components Continued: Virtual Address TranslationVirtual Address Translation

The x86 architecture uses hardware page The x86 architecture uses hardware page tables, which makes memory virtualization tables, which makes memory virtualization more difficult.more difficult.

Xen only deals with page table updates.Xen only deals with page table updates. Guest OS page tables are registered directly with the MMU.Guest OS page tables are registered directly with the MMU. Guest OSes have read-only access.Guest OSes have read-only access. No need to use shadow page tables.No need to use shadow page tables.

A guest OS passes Xen its page table updates A guest OS passes Xen its page table updates using a hypercall.using a hypercall. Requests are validated, and then applied.Requests are validated, and then applied. A type and reference count are kept for each machine A type and reference count are kept for each machine

page frame, and are used to validate updates.page frame, and are used to validate updates. Frames that have already been validated are marked so they Frames that have already been validated are marked so they

do not have to be revalidated.do not have to be revalidated. Hypercall requests can be batched to improve Hypercall requests can be batched to improve

performance.performance.

Page 18: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1818

Physical Memory and Physical Memory and DiskDisk

Each domain receives an initial reservation of memory.Each domain receives an initial reservation of memory. Memory is statically divided between domains.Memory is statically divided between domains.

A domain may claim additional memory pages up to its reservation A domain may claim additional memory pages up to its reservation limit.limit.

A domain may also release pages back to Xen.A domain may also release pages back to Xen. A balloon driver passes memory pages from Xen to the guest OS’s A balloon driver passes memory pages from Xen to the guest OS’s

page allocator.page allocator. Mapping from physical to hardware addresses is left to the OS.Mapping from physical to hardware addresses is left to the OS. Xen provides a shared translation array that is readable by all Xen provides a shared translation array that is readable by all

domains. Updates are validated by Xen first.domains. Updates are validated by Xen first. Only Domain0 has direct access to all physical drives. Only Domain0 has direct access to all physical drives.

All other domains access a virtual block device (VBD)All other domains access a virtual block device (VBD) Domain0 manages the virtual block devices, using the I/O ring Domain0 manages the virtual block devices, using the I/O ring

queuing mechanism to control access.queuing mechanism to control access. A VBD is composed of a list of extents with associated ownership A VBD is composed of a list of extents with associated ownership

and access control information.and access control information. To a guest OS, the VBD behavior is very similar to that of a SCSI To a guest OS, the VBD behavior is very similar to that of a SCSI

disk.disk. Xen keeps the translation table, and my reorder requests or process Xen keeps the translation table, and my reorder requests or process

them in batches.them in batches.

Page 19: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

1919

PerformancePerformanceFive implementations compared in total.Five implementations compared in total.

Compared 3 VMM’sCompared 3 VMM’s Vmware workstation 3.2Vmware workstation 3.2 User-Mode Linux (runs the Linux OS in user-mode on a Linux User-Mode Linux (runs the Linux OS in user-mode on a Linux

host)host) Xen with XenoLinux portXen with XenoLinux port

Also Native LinuxAlso Native Linux All used Redhat 2.0 with the Linux 2.4.21 All used Redhat 2.0 with the Linux 2.4.21

kernel, i686 architecture, ext3 file system.kernel, i686 architecture, ext3 file system. All used Dell 2650 dual processor 2.4GHz All used Dell 2650 dual processor 2.4GHz

systems, 2GB RAM, gigabit Ethernet, and systems, 2GB RAM, gigabit Ethernet, and 146GB SCSI drive. Hyperthreading disabled.146GB SCSI drive. Hyperthreading disabled.

Also tested the ESX server, which replaces the Also tested the ESX server, which replaces the guest OS with a dedicated kernel on VMware, guest OS with a dedicated kernel on VMware, but unable to report the results (EULA but unable to report the results (EULA restrictions).restrictions).

Page 20: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2020

Performance ResultsPerformance Results

Cluster 1: SPEC CPU suite.Cluster 1: SPEC CPU suite. Computationally intensive application, very little I/O and OS interaction.Computationally intensive application, very little I/O and OS interaction.

Cluster 2: Time taken to build a default configuration of the Linux 2.4.21 Cluster 2: Time taken to build a default configuration of the Linux 2.4.21 kernel with gcc v2.96.kernel with gcc v2.96.

Cluster 3: Open Source Database Benchmark suite in default configuration.Cluster 3: Open Source Database Benchmark suite in default configuration. Information retrieval shown in tuples per second.Information retrieval shown in tuples per second.

Cluster 4: Open Source Database Benchmark suite in default configuration.Cluster 4: Open Source Database Benchmark suite in default configuration. Online Transaction Processing workloads shown in tuples per second.Online Transaction Processing workloads shown in tuples per second.

Cluster 5: dbench program emulating load placed on a file server.Cluster 5: dbench program emulating load placed on a file server. Cluster 6: SPEC Web99 is a web server benchmark.Cluster 6: SPEC Web99 is a web server benchmark.

Page 21: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2121

Operating System Operating System BenchmarksBenchmarks

Measured using the lmbench Measured using the lmbench program, version 3.0-a3program, version 3.0-a3 L-UP is native Linux uniprocessor.L-UP is native Linux uniprocessor. L-SMP is native Linux multiprocessor.L-SMP is native Linux multiprocessor. Xen is running XenoLinux, their port of Xen is running XenoLinux, their port of

the Linux OS.the Linux OS. VMW is VMware.VMW is VMware. UML is user-mode Linux.UML is user-mode Linux.

Page 22: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2222

Further Performance Further Performance MeasuresMeasures

Multiple instances of PostreSQL in separate domainsMultiple instances of PostreSQL in separate domains OSDB-IR = Open Source Database Benchmark Information Retrieval.OSDB-IR = Open Source Database Benchmark Information Retrieval. OSDB-OLTP = Open Source Database Benchmark On-line Transaction Processing.OSDB-OLTP = Open Source Database Benchmark On-line Transaction Processing.

Performance IsolationPerformance Isolation They couldn’t find another OS-based implementation of performance isolation to They couldn’t find another OS-based implementation of performance isolation to

compare it with.compare it with. They tested Xen using 4 domains running with equal resource allocations.They tested Xen using 4 domains running with equal resource allocations.

2 domains running previously-measured workloads.2 domains running previously-measured workloads. 2 domains running disruptive processes (e.g. disk bandwidth hog, fork bomb, memory 2 domains running disruptive processes (e.g. disk bandwidth hog, fork bomb, memory

grabber).grabber). The impact of the disruptive processes was only a 2-4% decrease in performance The impact of the disruptive processes was only a 2-4% decrease in performance

.. Same processes effectively shut down a native Linux system.Same processes effectively shut down a native Linux system.

Page 23: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2323

ScalabilityScalability Xen’s target wasXen’s target was to scale to 100 to scale to 100 domains.domains. They were ableThey were able to configure a to configure a guest OS for guest OS for server server functionality, functionality, running a memoryrunning a memory of only 4MB with swap.of only 4MB with swap.

When an incoming request was received, it could request more When an incoming request was received, it could request more memory from Xen.memory from Xen.

Compared to native Linux, they found a tradeoff Compared to native Linux, they found a tradeoff situation.situation. Long time slices gives the highest throughput, but less Long time slices gives the highest throughput, but less

responsiveness. Xen running with 50ms time slices had similar responsiveness. Xen running with 50ms time slices had similar throughput to Linux.throughput to Linux.

Short time slices lowered throughput but improved responsiveness.Short time slices lowered throughput but improved responsiveness. With 128 domains running, Xen still provided a response time of 5.4ms. With 128 domains running, Xen still provided a response time of 5.4ms. 5ms time slices resulted in 7.5% lower throughput.5ms time slices resulted in 7.5% lower throughput.

Page 24: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2424

ConclusionConclusion Xen is a software based Virtual Machine Monitor Xen is a software based Virtual Machine Monitor

(hypervisor).(hypervisor). Allows multiple OSes to be hosted simultaneously on the same Allows multiple OSes to be hosted simultaneously on the same

machine.machine. Requires the OS to be modified (ported) in order to run on the VMM.Requires the OS to be modified (ported) in order to run on the VMM. Provides the protection of performance isolation between domains.Provides the protection of performance isolation between domains.

Xen today…Xen today… Open-source project published under the GPL.Open-source project published under the GPL.

Currently on version 3.0.Currently on version 3.0. NetBSD, Linux (several distros, including SuSE, Fedora, RHEL, Mandrake), NetBSD, Linux (several distros, including SuSE, Fedora, RHEL, Mandrake),

FreeBSD, Plan9, and NetWare are complete. WindowsXP port was FreeBSD, Plan9, and NetWare are complete. WindowsXP port was successful, but licensing prohibitions prevent it from being released.successful, but licensing prohibitions prevent it from being released.

Hardware support for virtualizationHardware support for virtualization Intel is releasing a new line of processors that support Intel is releasing a new line of processors that support

virtualization.virtualization. 2 forms of CPU operation. 2 forms of CPU operation.

In addition to levels 0-3, there is also a root level where the VMM can In addition to levels 0-3, there is also a root level where the VMM can run.run.

Guest OSes still can run at level 0, so porting is no longer required.Guest OSes still can run at level 0, so porting is no longer required. Virtual Machine Control Structure (VMCS) manages VM entries and Virtual Machine Control Structure (VMCS) manages VM entries and

exits.exits.

Page 25: 1 Xen and the Art of Virtualization By Paul Barham, Boris Dragovic, Stevan Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, and Andrew Warfield

04/19/2304/19/23 Xen and the Art of VirtualizationXen and the Art of VirtualizationDiana CarrollDiana Carroll

2525

ReferencesReferences University of Cambridge Xen pageUniversity of Cambridge Xen page

http://www.cl.cam.ac.uk/Research/SRG/netos/xen/http://www.cl.cam.ac.uk/Research/SRG/netos/xen/

Wikipedia entry for XenWikipedia entry for Xen http://en.wikipedia.org/wiki/Xen_%28virtual_machine_monitorhttp://en.wikipedia.org/wiki/Xen_%28virtual_machine_monitor

%29%29

Intel Virtualization Technology, by Rich Uhlig, Gil Intel Virtualization Technology, by Rich Uhlig, Gil Neiger, Dio Rodgers, Amy Santoni, Fernando Neiger, Dio Rodgers, Amy Santoni, Fernando Martins, Andrew Anderson, Steven Bennett, Alain Martins, Andrew Anderson, Steven Bennett, Alain Kagi, Felix Leung, and Larry Smith. Kagi, Felix Leung, and Larry Smith. Published in Published in Computer Computer magazine, May 2005 (Vol. 38, No. 5) magazine, May 2005 (Vol. 38, No. 5)

ISSN: 0018-9162 ISSN: 0018-9162 Borrowed-Virtual-Time (BVT) scheduling: Supporting Borrowed-Virtual-Time (BVT) scheduling: Supporting

Latency-sensitive Threads in a General-purpose Latency-sensitive Threads in a General-purpose SchedulerScheduler Kenneth J. Duda and David R. CheritonKenneth J. Duda and David R. Cheriton