RHEL 4 Xen guest HOWTO Rik van Riel, Oct 5 2006 Currently the RHEL4 Xen paravirtualized kernels are ready, but there is no installer support yet. This temporary HOWTO describes how you can turn a fully virtualized RHEL4 guest into a paravirt Xen guest. WARNING: As of October 5 2006, there are a few KNOWN BUGS left in the RHEL4 Xen kernel. This HOWTO is FOR TESTING PURPOSES ONLY. Requirements: - FC6 or RHEL5 Beta dom0 as the host OS - a fully virtualized guest image, which can be created using - Xen with Intel VMX or AMD AMD-V CPU, or - qemu - the RHEL4 paravirtualized kernels from http://people.redhat.com/~jbaron/rhel4/RPMS.kernel/ 1) Install RHEL4 as a fully virtualized guest, using either Xen w/ HVM or qemu. 2) In your RHEL4 guest, modify /etc/modprobe.conf like this: $ cat /etc/modprobe.conf alias eth0 xennet alias scsi_hostadapter xenblk 3) Install the RHEL4 paravirtualized kernel RPM for your architecture. The modprobe.conf changes above should make sure that mkinitrd makes sure the xenblk driver is loaded on bootup. 4) Create a config file for your RHEL4 Xen guest in /etc/xen. If your fully virtualized system was a Xen guest too, you will want to keep the vif MAC address and the UUID the same as before. $ cat /etc/xen/rhel4 # My RHEL4 Xen guest name = "RHEL4" memory = "256" uuid = "13db28ea-8536-53dc-3646-1f20fcc1199b" disk = [ 'phy:/dev/VolGroup00/RHEL4,xvda,w' ] # disk = [ 'file:/path/to/disk/image,xvda,w' ] vif = [ 'bridge=xenbr0,mac=00:16:3e:xx:xx:xx' ] bootloader="/usr/bin/pygrub" # vcpus = 2 If your guest is file backed and not LVM backed, you will want to fill in the second "disk =" line and comment out the first one. If you want an SMP guest, comment out the "vcpus = 2" line, and set the number to however many vcpus you would like your guest to have. Please change the MAC address! If everybody uses the same MAC address, there will be network problems, guaranteed... However, the first 3 MAC address numbers (00:16:3e) should stay intact. That is the official Xen MAC address range. 5) Start your Xen guest. Make sure to choose the right kernel in the pygrub menu, because anything except the paravirtualized kernel will fail to boot. Use the following command, replacing "rhel4" with the name of your Xen guest configuration file. $ xm create -c rhel4 6) Found a bug? No surprise, as of October 5th 2006 there are still a few known bugs in the RHEL4 Xen kernel. Please check bugzilla to see if your bug has been filed already. If you found something new, please let us know and we will try to fix it. Gotchas: 1) You can only run i686 guests on i686 hosts, or x86-64 guests on x86-64 hosts. Do not try to mix & match, because that will not work. 2) In order to get better system call and NPTL performance on i686, you will want to upgrade your glibc to the RPMS in the glibc directory. This glibc adds the "nosegneg" variant, which avoids negative segment accesses for TLS. Use of this glibc variant has increased performance by double digit percentages for a number of workloads. 3) Herbert Xu's network segmentation offload could not be backported to RHEL4 without destabilizing the network layer for non-Xen kernels too, so network performance in RHEL4 Xen guests will not be as good as that in RHEL5. 4) If you use qemu to install, make sure the MAC address you put in your Xen config file matches what's in the guest in /etc/sysconfig/network-scripts/ifup-eth0, otherwise the initscripts will refuse to bring up the guest's network. Community: 1) Email: https://www.redhat.com/mailman/listinfo/nahant-list 2) IRC: irc.oftc.net #xen Success!