Thursday, October 23 2008 @ 01:44 AM BST Views: 10,420
I decided it was time to sort out my xen box (a quad core, 8GB machine I use to run several virtual machines under xen).
It was previously running CentOS 5.2 with xen 3.1.2 that I built myself from Fedora RPMS; I decided it was time to do a fresh install and to upgrade to xen 3.3.
This proved to be remarkably trivial, having found the gitco repository, which has x86_64 RPMs for xen 3.3 and libvirt 0.4.4. Simply do a minimal CentOS 5.2 install, including the xen kernel, add the gitco repository to your yum config, and install:
yum install xen xen-libs libvirt python-libvirt python-virtinst
There was one small gotcha - the install process doesn't modify the grub config to boot from the correct xen kernel image. The symptoms are that xend won't start (you see permission denied errors) and virsh list results in errors in /var/log/xen/xend-debug.log like:
sysctl operation failed -- need to rebuild the user-space tool set?
Exception starting xend: (13, 'Permission denied')
Once you've realised what the problem is, the fix is straight-forward. This link was helpful. So, simply modify /boot/grub/grub.conf, changing the kernel line to boot the correct xen kernel image, e.g.:
title CentOS (2.6.18-92.1.13.el5xen) + xen 3.3
kernel /xen.gz-3.3.0 dom0_mem=384M
module /vmlinuz-2.6.18-92.1.13.el5xen ro root=/dev/vg_virt01/lv_root
This could also be done using a script like this:
perl -pi -e 's/([^#]\s+kernel).*$/$1 \/xen.gz-3.3.0 dom0_mem=384M/' /boot/grub/grub.conf
dom0_mem=384M sets the size of memory used by dom0, and is not strictly necessary.
Reboot and all should be working.