My Xen Upgrade From 2.0 -> 3.0

So I’ve been running Xen 2.0 on this one Debian 3.1 box of mine for a little over a year, with lots of little NetBSD domU’s. Worked great (in fact this site run’s on it), but I needed it to recognize more than 2 SATA drives (not really sure why it didn’t to begin with) on a new MB I bought, so I figured the time to upgrade to 3.0 was here.

It wasn’t totally straight forward, b/c I like to compile stuff from source, and my Xen 2.0 was compiled from source – I had Broadcom’s Tigon3 NIC that wasn’t supported in Xen 2.0’s stock kernel.

Here’s how it went down.

First off, I didn’t have LaTeX or any X11 stuff installed (it’s a server for fuck’s sake), but apparently Xen 3 has this new VNC tool that is dependent on X11. Saying goodbye to my lean Debian install, I perform:

1
2
apt-get install latex # For Xen documenation
apt-get install libx11-dev

libx11-dev has all the X11 code written in the last 100 years as a dependency, so this bloats my setup. <sigh>…

Next comes building the Xen 3 kernel, Linux dom0 kernel, and Xen 3 tools. Now, the only kernel I need from the Xen 3 package is the dom0 one, I don’t need the domU’s b/c I don’t run them. That’s why I set the “KERNELS” environment variable before my “make” commands below:

1
2
3
4
5
6
cd ~/src
wget http://bits.xensource.com/oss-xen/release/3.0.3-0/src.tgz/xen-3.0.3_0-src.tgz
tar xzvf xen-3.0.3_0-src.tgz
cd xen-3.0.3_0-src
KERNELS="linux-2.6-xen0" make world
KERNELS="linux-2.6-xen0" make install # As root

I then put the following in my grub/menu.lst file:

1
2
3
4
title Xen 3.0 / XenLinux 2.6.16
   root  (hd0,0)
   kernel /xen-3.0.gz dom0_mem=128000
   module /vmlinuz-2.6.16-xen0 root=/dev/sda2

Lastly, I needed to upgrade my NetBSD domU kernel, b/c the NetBSD 3.0 domU kernel only works in Xen 2.0. But the new NetBSD 3.1 domU kernel works in Xen 3 :)

1
2
3
4
5
cd ~/kernels
mkdir NetBSD-3.1
cd NetBSD-3.1
wget ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/i386/binary/kernel/netbsd-XEN3_DOMU.gz
gunzip netbsd-XEN3_DOMU.gz

So in my Xen domU config files, I needed to set the “kernel” line to point to this new kernel file.

After all this, I thought I was out of the woods. Everything booted up fine, dom0, domU’s, no problem. But none of my domU’s had network devices. Weird. Fortunately, after some research and trial and error, I found the trick. I had to add the following to each of my domU’s config files (remember, my domU’s are NetBSD, so this may not be needed for Linux domU’s):

1
vif = [ '' ]

And that’s all she wrote. Now my Xen box runs 3.0 and works just like before. I also was able to see all 4 SATA drives now, which satisfies my original goal for the upgrade. Success!

Comments