Rate this page del.icio.us  Digg slashdot StumbleUpon

How-To: Xen Guest for Red Hat Enterprise Linux 4

by the editorial team

This how-to article was edited and republished from the original source.

by Rik van Riel

Caution

This HOWTO is for testing purposes only.

The RHEL4 Xen paravirtualized kernels are ready, but there is no installer support yet. This temporary HOWTO describes how to turn a fully virtualized RHEL4 guest into a paravirt Xen guest. Proper installation of RHEL4 guests will be available in Anaconda sometime around the end of April 2007.

Requirements:

Procedure

  1. Install RHEL4 as a fully virtualized guest, using either Xen w/ HVM or QEMU.
  2. In the RHEL4 guest, modify /etc/modprobe.conf so it only contains:
    alias eth0 xennet
    alias scsi_hostadapter xenblk
    	    
  3. Install the RHEL4 paravirtualized kernel RPM for the system’s architecture. The changes in modprobe.conf ensure that mkinitrd checks that the xenblk driver is loaded on bootup.
  4. Create a config file for the RHEL4 Xen guest in /etc/xen. If the fully virtualized system was a Xen guest too, 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 the guest is file backed and not LVM backed, fill in the second disk = line and comment out the first one.

    To make an SMP guest, comment out the vcpus = 2 line, and set the number to the number of vcpus the guest needs.

    Note

    Change the MAC address from the one used in this example.

    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 the Xen guest. Make sure to choose the correct 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 the Xen guest configuration file:

    xm create -c rhel4
    	    
  6. Found a bug? Please check bugzilla to see if a bug has been filed already. If the bug is new, please file the bug and the development team will try to fix it.

Important Notes

  1. Only i686 guests run on i686 hosts, or x86-64 guests on x86-64 hosts. Do not try to mix and match, it does not work.
  2. In order to get better system call and NPTL performance on i686, upgrade the glibc to the RPMS in the directory http://people.redhat.com/riel/glibc/. This glibc adds the nosegnegc 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 QEMU is used to install, make sure the MAC address that is put into the Xen config file matches what is in the guest in /etc/sysconfig/network-scripts/ifup-eth0, otherwise the initscripts refuse to bring up the guest’s network.

More resources

Email: https://www.redhat.com/mailman/listinfo/nahant-list

RC: irc.oftc.net, #xen

About the author

Rik van Riel is a Linux kernel developer by day and an anti-spam activist by night. For some values of “day” and “night,” Rik works as a senior software engineer at Red Hat, Inc.

Copyright (C) 2006, 2007 by Rik van Riel and others. This article is licensed under a Creative Commons Attribution-ShareAlike 2.0 License (CC BY-SA). Attribution must include a link to the original source at http://people.redhat.com/riel/RHEL4-Xen-HOWTO.

Leave a reply