21Nov/09Off
Xen on Ubuntu 8.04 (Hardy Heron) with Software Raid and LVM
This is a short guide to configuring XEN on Ubuntu 8.04 LTS using RAID and LVM. It is designed as a stable and efficient configuration for a single server with two hard disks.
Building the Dom0 (Host)
- Download the Latest Ubuntu 8.04 server installation DVD.
- Boot off the CD and select the first install option
- At the partitioning screen create two raid partitions on each disk. The first should be 1024MB in size. The second should use the rest of the disk.
- Now generate two raid volumes using the partitions you've created.
- On the first (1024MB) raid volume create an ext3 filesystem. Select for it to be mounted on /boot
- On the second raid device create a large LVM partition the uses the entire device
- Within the LVM partition create two logical volumes. The first should be of type "swap". The second should be a 15GB ext3 filesystem with a mountpoint of /.
- When prompted for services select the SSH server option. Nothing else should need to run on the Dom0 (the host OS).
- Update the system
- aptitude update && aptitude dist-upgrade
- Install necessary packages
- aptitude install ubuntu-xen-server vim xfsprogs ssh
- Reboot and check XEN is working
- uname -r
- xm list
Manually creating a DOMU (Guest)
- Create the LVM partitions for the guest
- lvcreate -L 20G -n test1 SYSTEMVG
- lvcreate -L 2G -n test1_swap SYSTEMVG
- mkfs.xfs /dev/SYSTEMVG/test1
- mkswap /dev/SYSTEMVG/test1_swap
- Build the base system in the guest
- mount /dev/SYSTEMVG/test1 /mnt
- cd /mnt
- debootstrap --arch amd64 hardy /mnt http://archive.ubuntu.com/ubuntu
- mount --bind /dev/ /mnt/dev
- mount proc /mnt/proc -t proc
- Copy some critical files into the guest filesystem
- mkdir -p /mnt/lib/modules/
- cp -a /lib/modules/`uname -r` /mnt/lib/modules
- cp /etc/resolv.conf /mnt/etc/resolv.conf
- cp /etc/apt/sources.list /mnt/etc/apt/sources.list
- Chroot into the newly created guest filesystem
- chroot /mnt
- aptitude update && aptitude dist-upgrade
- aptitude install vim ssh xfsprogs
- passwd (set a root password)
- Edit /etc/fstab to look like the following
/dev/xvda1 / xfs defaults 1 2
/dev/xvda2 none swap sw 0 0
proc /proc proc defaults 0 0
- Create an /etc/network/interfaces to look like the following (substituting the relevant details for your network).
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.16
netmask 255.255.255.0
gateway 192.168.0.1
- Create an /etc/hostname file with the short hostname of the guest
- exit (exit from the chroot)
- Now we need to create an XEN config file
- Create the file /etc/xen/test1 (substituting test1 with the short hostname of your guest)
kernel = '/boot/vmlinuz-2.6.24-24-xen'
ramdisk = '/boot/initrd.img-2.6.24-24-xen'
memory = '512'
name = 'Hardy_xentest1'
vif = [ '' ]
dhcp = "dhcp"
extra = 'xencons=tty'
disk = ['phy:SYSTEM_VG/test1,xvda1,w','phy:SYSTEM_VG/test1_swap,xvda2,w']
root = "/dev/xvda1 ro"
- Start the XEN guest
- xm create /etc/xen/test1 -c (the -c attaches a console so we can see the guest boot)
- Create the file /etc/xen/test1 (substituting test1 with the short hostname of your guest)
Useful XEN commands
- List running XEN instances - xm list
- Connect a console to a running DOMU xm console <DOMU_name> (to escape from a console use ctrl-]
9Sep/09Off
mycounciltax.org.uk – An easy way to find out how much council tax you pay
My latest creation is mycounciltax.org.uk. It's a mashup allowing you in one easy step to find out council tax rates for any property in England. Rates for Wales should be added shortly. Scotland is slightly more challenging but may be added in the future.
It combines data from the Valuation Office Agency (VOA) website and council tax information provided by Communities and Local Government.
Hopefully you find it useful. I think it's pretty nifty.