Installing XenServer on a Hetzner root server is not straightforward:

  • Hetzner's gateway setup requires special network settings (all XenServer releases)
  • the XenServer 5.6 unattended installation has a bug so the installed system will not boot
  • XenServer 5.6 FP1 has a problem with the RealTek 8169 NIC which are used in Hetzner's servers

This article explains how to circumvent these problems. Some workarounds are needed even when installing from a physical CD (by using Hetzner's LARA console).

This How-To also works for XenServer 5.61 SP2

Copy contents of the installation CD to a directory on a webserver

Copy the contents of the Citrix XenServer installation CD to a directory on a web server. This directory must be accessible by ip address (in this example it is http://192.168.1.141/download/xenserver), so you might need to set up a default virtual host.

# mount -o loop XenServer-5.6.1-fp1-install-cd.iso /mnt
# cp -a /mnt xenserver

Create answerfile

In the xenserver directory, create a new file xenserver.xml containing the following XML code. Make sure to enter your own hostname, root password, ip address, subnet mask, gateway and name server ip addresses. The source URL is of course the URL to the installation directory you have just created. It must contain the ip address, not the domain name.

<installation mode="fresh" srtype="lvm">
 <bootloader>grub</bootloader>
 <primary-disk gueststorage="yes">sda</primary-disk>
 <keymap>de</keymap>
 <hostname>server00</hostname>
 <root-password>topsecret</root-password>
 <source type ="url">http://192.168.1.141/download/xenserver</source>
 <!-- No Post install scripts configured -->
 <admin-interface name="eth0" proto="static">
 <ip>192.168.1.76</ip>
 <subnet-mask>255.255.255.192</subnet-mask>
 <gateway>192.168.1.65</gateway>
 </admin-interface>
 <nameserver>213.133.98.98</nameserver>
 <nameserver>213.133.99.99</nameserver>
 <nameserver>213.133.100.100</nameserver>
 <timezone>Europe/Berlin</timezone>
 <time-config-method>ntp</time-config-method>
 <ntp-servers>ntp</ntp-servers>
 <ntpservers>192.53.103.108</ntpservers>
 <ntpservers>129.69.1.153</ntpservers>
 <ntpservers>134.34.3.18</ntpservers>
</installation>

Configure new server for unattended installation

The new XenServer host must be initialized with an arbitrary Linux system. Its only purpose is to boot a special XenServer kernel, which in turn will start the actual installation process by downloading the answerfile and the installation packages from the web server.

When installing the Linux system, do not use a software raid. There seems to be a bug in the XenServer 5.6 installer: if the Linux system used to boot the XenServer installer had software raid turned on, the installed XenServer system was corrupt. Files were missing or had binary data in them.

To install the initial Linux system, do the following for a Hetzner root server:

  1. boot the server in the rescue console

  2. wipe all disks so that they do not have partitions of type 0xfd (Linux raid autodetect):
    # dd if=/dev/zero of=/dev/sda count=256
    # dd if=/dev/zero of=/dev/sdb count=256
    
    Note that this will destroy all data on your disks.

  3. install Linux using the installimage command. I was using CentOS 5.5 32bit with good success. Remember to turn off the software raid option, this is done by editing the configuration to SW RAID = 0.

  4. After installing Linux, mount the boot partition:
    # mount /dev/sda3 /mnt
    # mount /dev/sda2 /mnt/boot
    

  5. Replace the file /mnt/boot/grub/menu.lst with the following content:
    timeout 5
    default 0
    
    title Install Xenserver
    root (hd0,1)
    kernel /boot/xen.gz dom0_mem=752M acpi=off nosmp noapic noirqbalance
    module /boot/vmlinuz answerfile=http://192.168.1.141/download/xenserver/xenserver.xml install
    module /boot/install.img
    
    Note that the file references the answerfile created earlier. The URL must contain the ip address, a domain name will not work.

  6. if there is a file grub.conf, copy menu.lst to it

  7. some files must be copied from the XenServer installation directory into the /boot directory. On the server containing the XenServer installation files (the web server), do the following:
    scp xenserver/install.img xenserver/boot/vmlinuz xenserver/boot/xen.gz newserver.mydomain:/mnt/boot
    root@newserver.mydomain's password: ********
    install.img     100%   26MB  12.9MB/s   00:02
    vmlinuz         100% 2058KB   2.0MB/s   00:00
    xen.gz          100%  585KB 585.2KB/s   00:00
    

  8. to see whether the XenServer installer actually retrieves the files from the web server, run the tail command:
    # tail -f access_log.2011-04-16-00_00_00  | grep xenserver
    192.168.1.76 - - [16/Apr/2011:11:36:11 +0200] "GET /download/xenserver/xenserver.xml HTTP/1.1" 200 871 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/XS-REPOSITORY-LIST HTTP/1.1" 200 21 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/XS-REPOSITORY HTTP/1.1" 404 230 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/XS-PACKAGES HTTP/1.1" 404 228 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/packages/XS-REPOSITORY HTTP/1.1" 404 239 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/packages/XS-PACKAGES HTTP/1.1" 404 237 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/packages.main/XS-REPOSITORY HTTP/1.1" 200 145 "-" "Python-urllib/2.4"
    192.168.1.76 - - [16/Apr/2011:11:36:23 +0200] "GET /download/xenserver/packages.main/XS-PACKAGES HTTP/1.1" 200 3720 "-" "Python-urllib/2.4"
    ...
    

  9. if you want to install XenServer 5.5, you can now restart the server. You should see the XenServer installer accessing the installation files a couple of minutes later. After the automatic reboot you should be able to connect to the new server via XenCenter

  10. if you are installing XenServer 5.6, the configuration must be modified before the reboot. Otherwise XenServer will hang during reboot and there is no chance to log in and fix the settings. therefore the Hetzner rescue system must be set up before the XenServer installation finishes. The easiest way to do this is: log into the Hetzner server administration, restart the server, and right after you see the installer accessing the packages from the web server, turn on the rescue system for this server. This way, when the freshly installed XenServer reboots after the installation has finished, it will boot into the rescue mode.

  11. in the rescue console, mount the disks again. In the file /etc/rc.sysinit, find the following line and comment it out:
    # [ -x /sbin/nash ] && echo "raidautorun /dev/md0" | nash --quiet
    

  12. After that, edit /etc/modprobe.conf and add the line
    options r8169 use_dac=1
    

  13. Finally, reboot. The new XenServer 5.6 FP1 system should now be accessible from XenCenter

Network changes

(later, for now see XenServer 5.5 auf Hetzner Server installieren )

11 Comments

  1. Anonymous

    Arne, are you sure about FP2? Shouldn't it be SP2?

    The filename is: XenServer-5.6.100-SP2-install-cd.iso

    Btw, thanks for your great manuals!

    1. You are right, I have fixed it now.

  2. Anonymous

    Ty Arne for the nice post.

    I have a small suggestion.

    Instead of copying via scp you can download the content from your webserver in the step 7.

    It would look like these

    wget 192.168.1.141/download/xenserver/boot/vmlinuz" class="external-link" rel="nofollow">http://192.168.1.141/download/xenserver/boot/vmlinuz -O /mnt/boot/vmlinuz

    wget 192.168.1.141/download/xenserver/boot/xen.gz" class="external-link" rel="nofollow">http://192.168.1.141/download/xenserver/boot/xen.gz -O /mnt/boot/xen.gz

    wget 192.168.1.141/download/xenserver/install.img" class="external-link" rel="nofollow">http://192.168.1.141/download/xenserver/install.img -O /mnt/boot/install.img

    Keep on good the good work.

    wget http://92.42.227.242/xenserver/boot/vmlinuz -O /mnt/boot/vmlinuz
    wget http://92.42.227.242/xenserver/boot/xen.gz -O /mnt/boot/xen.gz
    wget http://92.42.227.242/xenserver/install.img -O /mnt/boot/install.img

  3. Anonymous

    Thank you for this Arne.. it's much appreciated!

  4. Anonymous

    Just install XenServer 6 on a quite old DS5000... and it works ... even without applying 11. and 12.

    Thanks a lot!!!

     

  5. Anonymous

    Habe Probleme einen grub2 menuentry zu erstellen. Ich weiß nicht genau wie ich den Grub Eintrag umschreiben muss:

    title Install Xenserver
    root (hd0,1)
    kernel /boot/xen.gz dom0_mem=752M acpi=off nosmp noapic noirqbalance
    module /boot/vmlinuz answerfile=http://192.168.1.141/download/xenserver/xenserver.xml install
    module /boot/install.img

    So funktioniert es bei mir nicht:

    menuentry "xs install" {
        set root='(hd0,1)'
        kernel /boot/xen.gz dom0_mem=752M acpi=off nosmp noapic noirqbalance
        module /boot/vmlinuz answerfile=http://192.168.178.73/XCP/xen.xml install
        module /boot/install.img
    }

    Bekomme folgende Fehlermeldung beim Boot:

    error: unknown command `kernel`
    ...
    ...

    1. Ich würde irgendeine andere Distribution installieren, die grub (und nicht grub2) verwendet.

      Nach dem Booten wird die Distribution sowieso durch XenServer ersetzt.

      1. Anonymous

        Hi Arne,

        ich bedanke mich für die zahlreichen Infos.
        Dennoch habe ich ein Problem: bei mir auf einem Hetzner EX4 und Ubuntu 12.04 minimal funktioniert es nur soweit, dass die Installation nach Reboot beginnt. (Kann ich über tail -f sehen).

        Anschließend bootet der Server neu und fängt wieder die Installation an. Ergo habe ich eine Schleife!? Bin nach dem hier und Deinem vorgegangen:
        http://wiki.hetzner.de/index.php/Xenserver_6.0:_Automatische_Installation,_SW_RAID1,_lokale_ISO_Library,_IPv6_und_r8168_Treibertausch

        Was könnte ich übersehen haben? Danke.

        Cheers

        axel

  6. Anonymous

    problem with nash was solved in XenServer 5.6 SP2
    I successfully installed without commenting [ -x /sbin/nash ] && echo "raidautorun /dev/md0" | nash --quiet
    and then moved to software raid.

  7. Anonymous

    Hallo,

    ich bekomme vom XenServer Installer immer die Meldung "unable to access repository" ?
    An die install.img, vmlinuz, xen.xml... kommt der Rootserver ran, aber die Installation wird nach dem Initialisieren der Netzwerkkarte abgebrochen. Im Log des Apache Webservers:

    [06/Dec/2012:23:10:41 +0100] 2180 0 1.2.3.4 domain.de "GET /xen/xen.xml HTTP/1.1" 200
    [06/Dec/2012:23:10:41 +0100] 2177 0 1.2.3.4 domain.de "GET /xen/XS-REPOSITORY-LIST HTTP/1.1" 200
    [06/Dec/2012:23:10:41 +0100] 27382 0 1.2.3.4 domain.de "GET /xen/XS-REPOSITORY HTTP/1.1" 200
    [06/Dec/2012:23:10:41 +0100] 2171 0 1.2.3.4 domain.de "GET /xen/XS-PACKAGES HTTP/1.1" 200
    [06/Dec/2012:23:10:41 +0100] 2174 0 1.2.3.4 domain.de "GET /xen/XS-REPOSITORY HTTP/1.1" 200

    Eine Idee, was das soll?

     

    Gruß axel...

    1. Anonymous

      Hmm, in der xen.xml den <source-type> auf "nfs" geändert und dann funktioniert es von einem nfs-server zu installieren. Per "url" vom Webserver ging nicht... ? ! ?