OS Virtualization Principles
Principles
- Run multiple instances of OSes simultaneously
- Multitasking at the OS level
- Garantee isolation between OSes
- Provide controlled resources sharing
Applications of OS Virtualization
Wide range of use cases:
- Server consolidation
- Colocation of services
- Security, isolation, maintainance
- Regression tests
- ...
Virtual Machines and Hardware
Ideally virtualization is transparent to guest OSes
- Common principle in mainframe design
- Nearly impossible with i386 design
- Running unmodified OSes is horribly tricky
- Trapping priviledged calls
- Dynamic code rewrite
- Those tricks kills performances in some scenarii
Paravirtualization and Xen
Xen comes from the University of Cambridge
Do not hide the virtualization from the guest OSes
- Port the OS to work with Xen
- Reuse the OS drivers, but monitor hardware access
- Linux, NetBSD. FreeBSD, OpenSolaris and Plan9 worked on.
Xen's performances
Borrowed from their paper at SOSP
Example of use
ISP server consolidation
- One VM per customer
- Dynamic creation of VM
- Migration of VM in a cluster
Smooth upgrades of critical servers
Xen for Linux
Xen is been integrated in Linux upstream
- this is a separate architecture (ARCH=xen)
- Xen runs as an hypervisor
- kernel instances call the hypervisor for resources
- the hypervisor uses linux for the drivers
Xen Architecture
Xen in Fedora
This is a work in progress
- Fedora Core 4 has the basics
- Package xen-2:
- Control command xm/xend
- performance CLI tools
- Python bindings and libraries
- /boot/xen
- Package kernel-xen0 (2.6.11...)
Booting Xen
From grub.conf:
title Fedora Core Xen (2.6.11-1.1369_FC4xen0)
root (hd0,0)
kernel /boot/xen.gz
module /boot/vmlinuz-2.6.11-1.1369_FC4xen0 ro root=LABEL=/12 rhgb quiet selinux=0
module /boot/initrd-2.6.11-1.1369_FC4xen0.img
Xen runs in ring 0 (approx 32MB)
Linux runs in ring 2/3
Current state (FC4)
It works with basic core tools
- Start up/Stop a domain "xm create/shutdown ..."
- Basic resource control "xm baloon/maxmem/pincpu ..."
- Saving/restarting domains
Future tools
Higher level tools
- /etc/xen profiles maintainance
- Integration with anaconda/yum
- Freeze/migration of domains
- Web front-end
Xen limitations
This is a relatively new technology
Some limitations are being worked on
- Non-SMP guests
- architecture: i386 only, x86_64 in i386 mode
- x86_64 actively worked on
Xen Research
Work being done for Xen 3.0
- Migration and clustering
- Debugging and fault tolerance
- Security
- Performances aspects
- Intel hardware virtualization support
Useful Links
Fedora Xen Kickstart
Xen FAQ Wiki
Cambridge Lab. Xen page
XenSource