"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Xen 10th anniversary Status Report (at SELF 2013)
1. Russell Pavlicek
Xen Project Evangelist
Russell.Pavlicek@XenProject.org
Xen Project 10th Anniversary Status
@RCPavlicek
Skype: russpavlicek
2. • Linux user since 1995; Linux desktop since 1997
• Linux advocate before I ever saw the software
• Early advocate in DEC, Compaq
• Former columnist for Infoworld, Processor
• Former panelist on The Linux Show
• Wrote book, Embracing Insanity: Open Source Software Development
• Speaker at 40+ conferences
• Currently Xen Project Evangelist employed by Citrix
About the Speaker...
3. • Teams aka sub-projects
– Hypervisor
– XAPI
– ARM Hypervisor (for Servers as well as Mobile Devices)
– Mirage OS
• Governance : mixture between Linux Kernel and Apache
– Consensus decision making
– Sub-project life-cycle (aka incubator)
– PMC style structure for team leadership
News: Xen.org becomes XenProject.org
5. Xen is ready for business
• Enterprise-worthy scalability
• Solid track record (Amazon bets their AWS
business on us)
• Linux Foundation Project Partners:
–AMD, Amazon, Cisco, Citrix, Intel, Oracle,
Samsung, Verizon, and more
6. Xen contributor community is diversifying
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
2010 2011 2012
Citrix UPC
SUSE Amazon
University AMD
GridCentric Individual
NSA Intel
Fujitsu iWeb
Misc Oracle
Spectralogic University of British Columbia
• The number of “significant”
active vendors is increasing
• New feature development driving
new participation
7. Xen has the technology
• Top notch Hypervisor
• Live Migration of VMs: XenMotion (in XCP)
• Cloud-readiness: Xen Cloud Platform & XAPI
• High Availability: Remus
• Wide variety of Control Domains supported
• Even wider variety of Guest Domains
• Multiple virtualization modes improve performance
9. Hypervisor Architectures
Type 1: Bare metal Hypervisor
A pure Hypervisor that runs directly on the
hardware and hosts Guest OS’s.
Provides partition isolation + reliability,
higher security
Host HW
Memory CPUsI/O
HypervisorScheduler
MMUDevice Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
10. Hypervisor Architectures
Type 1: Bare metal Hypervisor
A pure Hypervisor that runs directly on the
hardware and hosts Guest OS’s.
Type 2: OS ‘Hosted’
A Hypervisor that runs within a Host OS and hosts
Guest OS’s inside of it, using the host OS services
to provide the virtual environment.
Provides partition isolation + reliability,
higher security
Low cost, no additional drivers
Ease of use & installation
Host HW
Memory CPUsI/O
Host HW
Memory CPUsI/O
HypervisorScheduler
MMUDevice Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
Host OS
Device Drivers
Ring-0 VM Monitor
“Kernel “
VMn
VM1
VM0
Guest OS
and Apps
User
Apps
User-level VMM
Device Models
11. Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor
Host HW
Memory CPUsI/O
HypervisorScheduler
MMUDevice Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
12. Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor
Host HW
Memory CPUsI/O
HypervisorScheduler
MMUDevice Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
Host HW
Memory CPUsI/O
Hypervisor
VMn
VM1
VM0
Guest OS
and Apps
Xen Architecture
Scheduler MMU
13. Xen: Type 1 with a Twist
Type 1: Bare metal Hypervisor
Host HW
Memory CPUsI/O
HypervisorScheduler
MMUDevice Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
Host HW
Memory CPUsI/O
Hypervisor
VMn
VM1
VM0
Guest OS
and Apps
Xen Architecture
Scheduler MMU
Control domain
(dom0)
Drivers
Device Models
Linux & BSD
14. Xen Project and Linux
• Xen Hypervisor is not in the Linux kernel
• BUT: everything Xen and Xen Guests need to run is!
• Xen packages are in all Linux distros (except RHEL6)
– Install Control Domain (Dom0) Linux distribution
– Install Xen package(s) or meta package
– Reboot
– Configure stuff: set up disks, peripherals, etc.
More info: wiki.xenproject.org/wiki/Category:Host_Install
15. Basic Xen Concepts
15
Control domain
(dom0)
Host HW
VMn
VM1
VM0
Guest OS
and Apps
Memory CPUsI/O
Console
• Interface to the outside world
Control Domain aka Dom0
• Dom0 kernel with drivers
• Xen Management Toolstack
Guest Domains
• Your apps
Driver/Stub/Service Domain(s)
• A “driver, device model or control
service in a box”
• De-privileged and isolated
• Lifetime: start, stop, kill
Dom0 Kernel
HypervisorScheduler MMU XSM
Trusted Computing Base
16. Basic Xen Concepts
16
Control domain
(dom0)
Host HW
VMn
VM1
VM0
Guest OS
and Apps
Console
Memory CPUsI/O
Dom0 Kernel
Toolstack
HypervisorScheduler MMU XSM
Console
• Interface to the outside world
Control Domain aka Dom0
• Dom0 kernel with drivers
• Xen Management Toolstack
Guest Domains
• Your apps
Driver/Stub/Service Domain(s)
• A “driver, device model or control
service in a box”
• De-privileged and isolated
• Lifetime: start, stop, kill
Trusted Computing Base
17. Basic Xen Concepts
17
Control domain
(dom0)
Host HW
VMn
VM1
VM0
Guest OS
and Apps
Console
Memory CPUsI/O
One or more
driver, stub or
service domains
Dom0 Kernel
Toolstack
HypervisorScheduler MMU XSM
Console
• Interface to the outside world
Control Domain aka Dom0
• Dom0 kernel with drivers
• Xen Management Toolstack
Guest Domains
• Your apps
Driver/Stub/Service Domain(s)
• A “driver, device model or control
service in a box”
• De-privileged and isolated
• Lifetime: start, stop, kill
Trusted Computing Base
19. Single Host
Basic Functions
Multiple Hosts
Additional Functionality
19
Xen Variants for Server & Cloud
Increased level of functionality and integration with other components
Default / XL (XM)Toolstack / Console Libvirt / VIRSH XAPI / XE
Hypervisor
Single Host
Additional Functionality
Xen Hypervisor
20. Single Host
Basic Functions
Multiple Hosts
Additional Functionality
Xen Variants for Server & Cloud
Increased level of functionality and integration with other components
Default / XL (XM)Toolstack / Console Libvirt / VIRSH XAPI / XE
Hypervisor
Single Host
Additional Functionality
Xen Hypervisor
21. 21
Xen Variants for Server & Cloud
Increased level of functionality and integration with other components
Default / XL (XM)Toolstack / Console Libvirt / VIRSH
Products Oracle VM Huawei UVP Citrix XenServer
Project
XAPI / XE
Xen Hypervisor
22. 22
Xen Variants for Server & Cloud
Increased level of functionality and integration with other components
Default / XL (XM)Toolstack / Console Libvirt / VIRSH
Used by …
Project
XAPI / XE
Products Oracle VM Huawei UVP Citrix XenServer
Xen Hypervisor
24. Xen Virtualization Vocabulary
• PV – Paravirtualization
– Hypervisor provides API used by the OS of the Guest VM
– Guest OS needs to be modified to provide the API
• HVM – Hardware-assisted Virtual Machine
– Uses CPU VM extensions to handle Guest requests
– No modification to Guest OS
– But CPU must provide VM extensions
• FV – Full Virtualization (another name for HVM)
25. Xen Virtualization Vocabulary
• PVHVM – PV on HVM drivers
– Allows H/W virtualized guests to use PV disk and I/O drivers
– No modifications to guest OS
– Better performance than straight HVM
• PVH – PV in HVM Container (coming in 4.4)
– Almost fully PV
– Uses HW extensions to eliminate PV MMU
– Possibly best mode for CPUs with virtual H/W extensions
26. 26
Xen Hypervisor
Control domain
(dom0)
Host HW
Guest VMn
Apps
Memory CPUsI/O
Technology:
• Paravirtualization
Linux PV guests have limitations:
• Limited to a subset of set of virtual H/W
Advantages
• Fast
• Works on any system
(even without CPU virtual extensions)
HW Drivers
PV Back Ends PV Front Ends
Guest OSDom0 Kernel
Paravirtualization (PV) Domains
27. 27
Xen Hypervisor
Control domain
(dom0)
Host HW
Guest VMn
Apps
Memory CPUsI/O
Technology:
• Paravirtualization
Linux PV guests have limitations:
• Limited to a subset of virtual H/W
Advantages
• Fast
• Works on any system
(even without CPU virtual extensions)
Driver Domains (Disaggregation)
• Security
• Isolation
• Reliability and Robustness
HW Drivers
PV Back Ends PV Front Ends
Driver Domain
e.g.
• Disk
• Network
HW Driver
PV Back End
Dom0 Kernel*
*) Can be MiniOS
Guest OSDom0 Kernel
PV Domains & Driver Domains
28. 28
Xen Hypervisor
Dom0
Host HW
Guest VMn
Technology:
• Shows emulation using QEMU/Device
Model (SW Virtualization)
• In other situation H/W can be used
Disadvantages
• Emulation slower than PV
(mainly I/O devices)
Advantages
• No kernel support needed
Device Model
IO Emulation
IO Event
VMEXITDom0 Kernel
H/W Virtual Machine (HVM) & Stub Domains
Memory CPUsI/O
29. 29
Xen Hypervisor
Dom0
Host HW
Guest VMn
Technology:
• Shows emulation using QEMU/Device
Model (SW Virtualization)
• In other situation H/W can be used
Disadvantages
• Emulation slower than PV
(mainly I/O devices)
Advantages
• No kernel support needed
Stub Domains
• Security
• Isolation
• Reliability and Robustness
Device Model
IO Emulation
IO Event
VMEXIT
Stubdomn
Device Model
Mini OS
Guest VMn
IO Emulation
IO Event
VMEXITDom0 Kernel
H/W Virtual Machine (HVM) & Stub Domains
Memory CPUsI/O
30. The Virtualization Spectrum
Fully Virtualized (FV) VS VS VS VH
FV with PV for disk & network P VS VS VH
PVHVM P P VS VH
PVH P P P VH
Fully Paravirtualized (PV) P P P P
VH Virtualized (HW)
P Paravirtualized
VS Virtualized (SW)
HVM mode/domain
PV mode/domain
Xen 4.4
31. The Virtualization Spectrum
Fully Virtualized (FV) VS VS VS VH
FV with PV for disk & network P VS VS VH
PVHVM P P VS VH
PVH P P P VH
Fully Paravirtualized (PV) P P P P
Scope for improvement
Poor performance
Optimal performance
HVM mode/domain
Xen 4.4
PV mode/domain
32. The Virtualization Spectrum
Fully Virtualized (FV) VS VS VS VH
FV with PV for disk & network P VS VS VH
PVHVM P P VS VH
PVH P P P VH
Fully Paravirtualized (PV) P P P P
Scope for improvement
Poor performance
Optimal performance
HVM mode/domain
Xen 4.4
PV mode/domain
Important: Xen automatically picks the best
option based on HW & OS capabilities and
available drivers.
As a Xen user I chose a HVM or PV domain.
34. Single Host
Basic Functions
Multiple Hosts
Additional Functionality
XAPI, XCP and XCP-XAPI : What is it?
Increased level of functionality and integration with other components
Default / XL (XM)Toolstack / Console Libvirt / VIRSH XAPI / XE
Hypervisor
Single Host
Additional Functionality
Xen Hypervisor
35. XAPI : What do I get?
Multiple Hosts
Additional Functionality
XAPI / XE
Xen Hypervisor
• VM lifecycle: live snapshots, checkpoint, migration
• Storage XenMotion: Migrate VMs between hosts or pools
without shared storage (while the VM is running)
• Resource pools: flexible storage and networking
• Event tracking: progress, notification
• Upgrade and patching capabilities
• Real-time performance monitoring and alerting
• Templates for Windows and Linux guests
• Open vSwitch support built-in (default)
More info: wiki.xenproject.org/wiki/XCP_Release_Features
40. System characteristics cloud users care about:
“Robustness, Performance, Scalability & Security”
Results XCP User Survey 2012 – 90% of users quoted these as most important attributes
41. Split Control Domain into Driver,
Stub and Service Domains
– See: ”Breaking up is hard to do” @ Xen Papers
– See: “Domain 0 Disaggregation for XCP and XenServer”
Used today by Qubes OS and Citrix XenClient XT
Prototypes for XAPI
Disaggregation
See qubes-os.org
Different windows run
in different VMs
42. More Security
Increased serviceability and flexibility
Better Robustness
Better Performance
Better Scalability
Benefits of Disaggregation
Ability to safely restart parts of the system
(e.g. just 275ms outage from failed Ethernet driver)
44. CPUCPU
RAM RAMNIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
RAID
Xen
Dom0Network
drivers
NFS/
iSCSI
drivers
Qemu xapi Local
storage
drivers
NFS/
iSCSI
drivers
Network
drivers
Qemu
eth eth eth eth scsi
User VM User VM
NB gntdev NB
NF BF NF BF
qemu qemu
xapi
vswitch
networkd
tapdisk
blktap3
storaged
syslogd
vswitch
networkd
tapdisk
blktap3
storaged
tapdisk
blktap3
storaged
gntdev gntdev
Dom0
xenopsd
libxl
healthd
Domain
manager
Dom0
.
.
.
.
Xen
xapi
45. CPUCPU
RAM RAMNIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
RAID
Dom0 Network
driver
domain
NFS/
iSCSI
driver
domain
Qemu
domain
xapi
domain
Logging
domain
Local
storage
driver
domain
NFS/
iSCSI
driver
domain
Network
driver
domain
User VM User VM
NB gntdev NB
NF BF NF BF
dbus over v4v
qemu
xapi
xenopsd
libxl
healthd
Domain
manager
vswitch
networkd
tapdisk
blktap3
storaged
syslogd vswitch
networkd
tapdisk
blktap3
storaged
tapdisk
blktap3
storaged
gntdev gntdev
eth eth eth eth scsi
Xen Xen
D
o
m
0
dbus over v4v
.
.
.
46. 46
Xen Security Advantages
• Even without Advanced Security Features
– Well-defined trusted computing base (much smaller than on type-2 HV)
– Minimal services in hypervisor layer
• Xen Security Modules (or XSM) and FLASK
– XSM is Xen equivalent of LSM
– FLASK is Xen equivalent of SELinux
– Developed, maintained and contributed to Xen by NSA
– Compatible with SELinux (tools, architecture)
– XSM object classes maps onto Xen features
More info: http://www.slideshare.net/xen_com_mgr/
a-brief-tutorial-on-xens-advanced-security-features
47. CPUCPU
RAM RAMNIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
NIC
(or SR-
IOV VF)
RAID
Xen
Dom0 Network
driver
domain
NFS/
iSCSI
driver
domain
Qemu
domain
xapi
domain
Logging
domain
Local
storage
driver
domain
NFS/
iSCSI
driver
domain
Network
driver
domain
eth eth eth eth scsi
User VM User VM
NB gntdev NB
NF BF NF BF
qemu
xapi
xenopsd
libxl
healthd
Domain
manager
vswitch
networkd
tapdisk
blktap3
storaged
syslogd vswitch
networkd
tapdisk
blktap3
storaged
tapdisk
blktap3
storaged
gntdev gntdev
FLASK policy
restricting access
D
o
m
0
.
.
.
dbus over v4v dbus over v4v
Xen
49. Fully functional for ARM v7 & v8
ARM v7: Versatile Express, Arndale &
Samsung Chromebook
ARM v8: Fast Model
Xen 4.3 for ARM Servers
50. ARM SOC
Xen + ARM = a perfect Match
ARM Architecture Features for Virtualization
Hypervisor mode : EL2
Kernel mode : EL1
User mode : EL0
GIC
v2
GT
2 stage
MMU
I/O
Device Tree describes …
Hypercall Interface HVC
51. ARM SOC ARM Architecture Features for Virtualization
EL2
EL1
EL0
GIC
v2
GT
2 stage
MMU
I/O
Device Tree describes …
HVC
Xen + ARM = a perfect Match
Xen Hypervisor
52. ARM SOC ARM Architecture Features for Virtualization
EL2
EL1
EL0
GIC
v2
GT
2 stage
MMU
I/O
Device Tree describes …
HVC
Xen + ARM = a perfect Match
Xen Hypervisor
Any Xen Guest VM (including Dom0)
Kernel
User Space
HVC
53. ARM SOC ARM Architecture Features for Virtualization
EL2
EL1
EL0
GIC
v2
GT
2 stage
MMU
I/O
Device Tree describes …
HVC
Xen + ARM = a perfect Match
Xen Hypervisor
Dom0
only
Any Xen Guest VM (including Dom0)
Kernel
User Space
I/O
PV
back
PV
frontI/O
HVC
54. One mode to rule them all
x86: PVHVM P P VS VH
x86: PVH P P P VH
ARM v7 & v8 P VH VH VH
Scope for improvement
Optimal performance
HVM mode/domain
PV mode/domain
55. Code Size of x86 and ARM Hypervisors
X86 Hypervisor 100K -120K LOC Any x86 CPU
ARM Hypervisor for
mobile Devices
60K LOC ARM v5 – v7
(no virtual extensions)
(extra code for RT)
ARM Hypervisor for
Servers
17K LOC ARM v7+
(w/ virtual extensions)
57. Application stacks only running on Xen APIs
Works on any Xen based cloud or hosting service
Examples
– ErlangOnXen.org : Erlang
– HalVM : Haskell
– Mirage OS : Ocaml
Benefits:
– Small footprint
– Low startup latency
– Extremely fast migration of VMs
Library Operating Systems
Xen
Control domain
(dom0)
Host HW
Guest VMn
Apps
HW Drivers
PV Back Ends
Library OS
embedded
in Language
run-time
Dom0 Kernel
58. • Recently added to Xen Project incubator
• In beta stage: first release on its way
• Clean-slate protocols implementations, e.g.
– TCP/IP, DNS, SSH, Openflow (switch/controller), HTTP, XMPP, ...
– New applications using next generation XAPI
(disaggregated XAPI architecture)
Mirage OS
More info: http://www.slideshare.net/xen_com_mgr/
mirage-extreme-specialisation-of-virtual-appliances
60. • Release Candidate 4 Test Day on 6/12
• Xen ARM for Servers
• Extend scope of Xen Security Modules
• qxl Spice support for 3d acceleration
• Updated and improved libvirt drivers for Xen
• Lots of other stuff:
– scalability, performance, better NUMA support, …
Coming in Xen 4.3 (June 2013)
More info: http://wiki.xenproject.org/wiki/Xen_Roadmap/4.3
61. • Establish a shared test infrastructure
– Most major contributors are duplicating effort
– Mirage OS provides interesting opportunities
• Usability and better distribution integration
– Example: Xen + XAPI in CentOS 6.4
• More focus on downstreams
– Examples: OpenStack and Xen Orchestra
• Disaggregation in Xen toolstacks (e.g XAPI)
• Better Libvirt and virt-manager integration
– Embed Xen more into the Linux ecosystem and provide benefits for the
wider Linux community
What’s next (and already happening)
62. • Document Days (monthly)
• Test Days (prior to release)
• Mailing Lists and IRC
• XenProject.org (sign up, it’s free!)
Getting Started with Xen Project
Xen Hackathon & Developer Summit (annually;
vote for next year’s location in the Q&A section
of XenProject.org until June 14, 2013)
63. Thank You!
Slides available under CC-BY-SA 3.0
From www.slideshare.net/xen_com_mgr
@RCPavlicek
Skype: russpavlicek
• News: blog.XenProject.org
• Web: XenProject.org
– Help for IRC, Lists, …
– Stackoverflow like Q&A
• Wiki: wiki.XenProject.org
• Presentations: slideshare.net/xen_com_mgr
• Videos: vimeo.com/channels/xen