Using FAI to set up XEN domains

From FAIWiki
Revision as of 18:41, 3 January 2006 by Michael (talk | contribs)
Jump to navigation Jump to search

This section provides short guidelines on how to set up XEN base systems (aka domain-0) and virtual machines (dom-U) using FAI. Henning Glawe (http://www.physik.fu-berlin.de/~glaweh/) provided many ideas an some scripts - thanks!

Apart from configuring FAI, the following things need to be considered:

  • Which XEN packages should be used?
  • XEN kernel images need to be built
  • Find a partitioning scheme and figure out whether you want to use LVM, native partitions or files


Preparing FAI:

For the domain-0 only the kernel-image must be set correctly. As I'm using LVM for the unpriveledged domains and FAI can't do that yet, I wrote a little script to set up all of them later (it failed when I tried to do it during the FAI installation, should debug that).

The more interesting part is the preparation of unpriveledged domains. As these require no partitioning during installation a hook must be created:

partition.XENU:

[ -f $LOGDIR/our.skip.partition ] && exit 0

for our_cl in $classes; do
  [ $our_cl = "XENU" ] && continue
  [ -f $FAI/hooks/partition.$our_cl ] && exit 0
done

mke2fs -j /dev/hda1 > /dev/null
mkswap /dev/hda2 > /dev/null
mke2fs -j /dev/hda3 > /dev/null
mke2fs -j /dev/hda4 > /dev/null
mke2fs -j /dev/hda5 > /dev/null

cat > /tmp/fai/fstab <<EOF
/dev/hda1 / ext3 defaults 0 0
/dev/hda2 none swap sw 0 0
/dev/hda3 /tmp ext3 defaults 0 0
/dev/hda4 /usr ext3 defaults 0 0
/dev/hda5 /var ext3 defaults 0 0
EOF

echo "#!" > $diskvar
touch $LOGDIR/skip.partition