Installation


Upgrades


DTC-Xen Installation


DTC-Xen / Dom0 Howtos

DTC-Xen / DomU Howtos

FAQ


DTC Howtos


Manuals


Features


Roadmap


Devel docs


Wiki - i18n


Wiki - Meta


Upgrade-DTC-Xen-To-Squeeze

Upgrading a server running Xen from Lenny to Squeeze is not strait forward. After the upgrade, there's quite few things to fix. Read-on...

1. The standard part

Edit /etc/apt/sources.list, change your lenny entries by squeeze, then do:

   apt-get update
   apt-get dist-upgrade

Then start the less fun part... Fixing stuff.

2. Re-adding Xen and fixing xend-config.sxp

As per the Debian release notes, upgrading to Squeeze will not upgrade the Xen hypervisor. You will need to install it by hand:

   apt-get install linux-image-2.6-xen-amd64 xen-hypervisor-4.0-amd64 \ 
xen-linux-system-2.6.32-5-xen-amd64 xen-utils-4.0

Let it overwrite /etc/xen/xend-config.sxp, then make sure you have the following in it:

   (network-script 'network-bridge antispoof=yes')
   (vnc-listen '0.0.0.0')
   (vncpasswd '9e39d927')
   (dom0-min-mem 500)

3. Fixing grub2

As we are now using Grub2, you'll need to tell it that you want your dom0 to use only 500 MB of RAM. So edit /etc/default/grub, and add the following at the end of the file:

   # In the /etc/default/grub add the following:
   # Start dom0 with less RAM
   GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=512M"

   # Disable OS prober to prevent virtual machines on logical volumes from
   # appearing in the boot menu.
   GRUB_DISABLE_OS_PROBER=true

Then tell grub that you really want to boot with the Xen hypervisor by default:

   cd /etc/grub.d
   mv 10_linux 25_linux
   upgrade-from-grub-legacy

Then finally, reconfigure grub2 to install it on both MBR of your 2 HDD in the RAID1:

   dpkg-reconfigure grub-pc

4. Console not blanking

You might want to edit /etc/console-tools/config and change all the entries with 30 in it by a single zero, so that your server monitor wont go off.

5. dependency-based boot system

If you have some init.d script that do not have lsb-base headers for dependency boot, you might need to remove them. Here's an example with exim4:

   update-rc.d -f exim4 remove
   rm /etc/init.d/exim4

Then you can try again to switch to dependency-based boot using the following command:

dpkg-reconfigure sysv-rc

If it yells again, remove the next init.d script, and do again until succeed.

6. Adding missing firmware files

In Lenny, the kernel might include some non-free firmware. But in Squeeze, they got removed completely from the kernel. So in some cases, you might need to install the non-free packages explicitely. Here's an example that would work for a tg3 network card. First add the contrib and non-free sections to your /etc/apt/sources.list, then do:

   apt-get install firmware-linux-nonfree

Note that depending on your hardware, you might need other types of packages (like for example, realtek cards would need the firmware-realtek package).

7. Reboot

... pray your server comes back ...

8. Upgrading your virtual machines

For each domU, you will need to shut it down, mount in dom0, and do (in this example $1 is to be replaced by 28 if you are upgrading xen28 for example):

   cd /var/lib/dtc-xen/mnt
   cp -auxf /lib/modules/2.6.32-5-xen-amd64 $1/lib/modules
   chroot $1 depmod -a
   sed -i "s/tty1/console/" $1/etc/inittab || true
   sed -i "s/sda1/xvda1/" $1/etc/fstab
   sed -i "s/sda2/xvda2/" $1/etc/fstab
   sed -i "s/sda1/xvda1/" /etc/xen/xen$1
   sed -i "s/sda2/xvda2/" /etc/xen/xen$1
   sed -i "s/2.6.26-1/2.6.32-5/" /etc/xen/xen$1
   sed -i "s/2.6.26-2/2.6.32-5/" /etc/xen/xen$1
   sed -i "s/4 TERM=xterm xencons=tty console=tty1/4/" /etc/xen/xen$1

Of course, it's a good idea to use the above as a script, so you can call it with:

   ./upgrade-script 28

After the above, your domU should be able to boot normally.

Editing this page means accepting its license.

Page last modified on April 07, 2011, at 08:30 PM EST