Blog

Posted 2007/04/02

Adding a Xen domU to Lister

There are four stages to adding a new domU. Allocate the storage, install and configure the new OS (from within Lister), create the Xen configuration file for the new domU and then boot the domU and do final configurations.

1) Allocating storage

Storage is managed using LVM on Lister. Either create a brand new logical volume (to start from scratch) or if the domU will use Debian Etch create a new snapshot of the Debian Etch master.

In these examples make sure you alter the volume names to reflect the domU you are creating.


# Create a brand new logical volume
lvcreate -L4096M -n master_debian-etch vg
mkfs -t ext3 /dev/vg/master_debian-etch


# Create a snapshot of the existing Debian Etch install
lvcreate -s -L4096M -n clone_debian-etch_dom01 /dev/vg/master_debian-etch

Then allocate swap.


lvcreate -L1024M -n swap_dom01 vg
mkswap /dev/vg/swap_dom01

2) Install and configure the domU OS

For a non Debian Etch domU, mount the new volume and install the operating system. For all new domUs copy /etc/hosts from Lister. Network is via DHCP. Most other configuration settings can be derived from an existing domU - such as dom01. Make sure the hostname is set correctly in the domU.

3) Configure Xen

The Xen configuration scripts are found in /etc/xen/. Copy an existing *-confic.sxp and change it to reflect the settings for the new domU.

4) Start the new domU and finish the configuration

xm is the command for interacting with Xen.


xm create -c dom05-confic.sxp

You can then finish any configuration from within the domU.


The street fighter turbo + alpha version of this for a new domU is:


lvcreate -s -L4096M -n clone_debian-etch_dom05-skutter /dev/vg/master_debian-etch
lvcreate -L1024M -n swap_dom05 vg
mkswap /dev/vg/swap_dom05
mount /dev/vg/clone_debian-etch_dom05-skutter /mnt/tmp/
cd /mnt/tmp/
vi etc/hostname
cp /etc/hosts ./etc/hosts
vi etc/network/interfaces
cd /etc/xen/
cp dom03-confic.sxp dom05-confic.sxp
vi dom05-confic.sxp
umount /mnt/tmp/
xm create -c dom05-confic.sxp