Xen
is now
Donald Gordon
don@dis.org.nz
Hastily-writing-up MSc Student, VUW
Overview
- Virtualisation
- Xen
- Using Xen
Virtualisation
- One physical machine
- Several smaller virtual machines
- VMs appear like real physical machines
- Share disk, CPU, network, ...
- Not emulation — partitioning
- Hard on x86
- This is not new
- VM
- MacOnLinux (PowerPC)
- kqemu
- VMWare
Why?
- Virtual hosting
- Server sharing
- Server consolidation: space, power, hardware savings
- Low deployment time
Paravirtualisation
- Virtualisation is hard on x86
- Hardware emulation is slow
- Why does a virtual machine have to provide an identical environment to a physical machine?
- Make available an API that provides operations similar to those that are hard to virtualise
- Throw in some virtual I/O devices
- Modify guest OS kernels
- Like a386, User Mode Linux
Xen
- Paravirtualisation on x86, AMD64
- Developed by University of Cambridge's Systems Research Group
- Free, open source
- Good performance
- Migration
- Kernel patches
- Linux
- NetBSD
- FreeBSD, Plan 9 in the works
What about Windows?
- Windows XP patches developed, but unavailable
- CPU manufacturers to the rescue!
- AMD Pacifica, Intel Vanderpool
- Xen3 supports these
Core Concepts
- Domains
- Virtual network interfaces
- Virtual block devices
- Real PCI devices
make world
make world
cd linux-*-xen0; make ARCH=xen menuconfig; cd ..
cd linux-*-xenU; make ARCH=xen menuconfig; cd ..
make
cd dist; checkinstall ./install.sh
$EDITOR /boot/grub/menu.lst
reboot
Boot Process
- GRUB
- Xen hypervisor
- Dom0
- init scripts bring up more domains
$EDITOR /etc/xen/auto/vmname
kernel = "/boot/vmlinuz-2.6.11-xenU"
memory = 256
# name must be unique
name = "vmname"
nics = 1
vif = [ 'mac=00:60:b0:28:78:84, bridge=xen-cust' ]
disk = ['phy:vg0/vmname_root,sda1,w',
'phy:vg0/vmname_swap,sda2,w',
'phy:vg0/modules,sda3,r']
root = "/dev/sda1 ro"
- xm create -f /etc/xen/auto/vmname
- xm console vmname
A running system
root@greebo:~# xm list
Name Id Mem(MB) CPU State Time(s) Console
Domain-0 0 59 0 r---- 11015.9
hex 1 255 0 -b--- 17024.3 9601
tepidmail 2 127 0 -b--- 3123.5 9602
thinfaw 3 63 0 -b--- 14682.4 9603
visit 4 255 0 -b--- 3658.6 9604
william 5 127 0 -b--- 1246.1 9605
root@greebo:~#
- 1.38% cpu utilisation over 42 days
- Much more reliable than the old machines it replaced
Questions?
- I must have missed something
Resources
- http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
- http://www.cl.cam.ac.uk/Research/SRG/netos/xen/readmes/user/user.html
- Binaries: http://www.xensource.com/xen/downloads/
- Source: http://wiki.xensource.com/xenwiki/XenDownloads
- This talk: http://www.dis.org.nz/talks/xen/