The lastest version of Xen as of this writing is 4.0 but there's been some issues with blktap2 and other things with it so I'm still holding onto Xen 3.4. This tutorial shows how to upgrade a CentOS/RHEL 5 system to Xen 3.4. As soon as Xen 4.0 is as mature as I want it I'll update it again. I'm also retesting all of this as I'm not sure I had the problems with upgrading to 3.4 that I had with 3.3. I'll update it as soon as I'm done testing.
1. First we need to download the YUM repository file for the updated Xen. Then uninstall the old Virtualization group and reinstall it. This will upgrade the packages.
wget http://www.gitco.de/linux/x86_64/centos/5/CentOS-GITCO.repo -O /etc/yum.repos.d/gitco.repo
yum groupremove Virtualization
yum update
yum clean all
yum groupinstall -y Virtualization
Yum will probably want to upgrade some other files along with the ones we've chosen.
Warning! If you get an error message from grubby this is bad!
Installing: kernel-xen ####################### [ 9/13]
grubby fatal error: unable to find a suitable template
This means that your grub.conf file couldn't be written to for whaterver reason so you won't be able to successfully reboot. If you get this message you need to edit your /boot/grub/grub.conf file and make the kernel lines match the kernel you installed.
Get your installed kernel version:
[ root@vs / ] rpm -q kernel-xen
kernel-xen-2.6.18-128.4.1.el5
Now edit your /boot/grub/grub.conf to match this
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/vgsys/lvroot
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.4.1.el5xen)
root (hd0,0)
kernel /xen.gz-3.4.0
module /vmlinuz-2.6.18-128.4.1.el5xen ro root=/dev/vgsys/lvroot rhgb quiet
module /initrd-2.6.18-128.4.1.el5xen.img
4. Reboot - no really I mean it.
5. Try it out by using the xm dmesg command
[ root@vs ~ ] xm dmesg
__ __ _____ _ _ ___
\ \/ /___ _ __ |___ /| || | / _ \
\ // _ \ '_ \ |_ \| || |_| | | |
/ \ __/ | | | ___) |__ _| |_| |
/_/\_\___|_| |_| |____(_) |_|(_)___/
(XEN) Xen version 3.4.0 (This email address is being protected from spambots. You need JavaScript enabled to view it.) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) Fri May 29 21:39:26 CEST 2009
That's about all. If you have any questions drop a comment here.