Error message

Notice: Undefined index: default_image in image_field_prepare_view() (line 207 of /usr/share/drupal7/modules/image/image.field.inc).

Moving a XEN-Instance from etch to lenny

Wed, 06/17/2009 - 22:23 -- Tom

With the upgrade from Debian etch to lenny i've set up an new machine to serv my XEN-Instances. First install the Dom0 on the new hardware and create a logical volume (here my-lvm-vg on /dev/sdb) for further expansion:

    pvcreate /dev/sdb
    vgcreate my-lvm-vg /dev/sdb

Then bring up your network by editing the /etc/xen/xend-config.sxp similar to the old system (e. g. network-bridge). If you have broken network interfaces in Dom0, follow this link.

Now create new logical volumes with the same size as the old ones:

    lvcreate -n host1.fqdn-disk -L 10G my-lvm-vg
    lvcreate -n host1.fqdn-swap -L 256M my-lvm-vg

Copy the DomU's using scp to the new lenny machine:


On the old etch-machine

    xm shutdown <domain-id>
    dd if=/dev/my-lvm-vg/host1.fqdn-disk bs=1k | ssh -C root@<new-machine> dd of=/dev/my-lvm-vg/host1.fqdn-disk bs=1k
    scp /etc/xen/host1.fqdn.cfg root@<new-machine>:/etc/xen/

After that check the filesystem of the new DomU's with e2fsck -f /dev/my-lvm-vg/host1.fqdn-disk and edit your host1.fqdn.cfg to use the new kernel version. At the moment e. g. :

    kernel  = '/boot/vmlinuz-2.6.26-2-xen-686'
    ramdisk = '/boot/initrd.img-2.6.26-2-xen-686'

All your DomU's needs the suitable kernel module. Simultaneous edit the /etc/init.d/hwclock.sh inside the DomU to prevent hanging on boot. Insert a exit 0 in the second line after #!/bin/sh.

    mount -o loop /dev/my-lvm-vg/host1.fqdn-disk /mnt/
    cp -vdpR /lib/modules/2.6.26-2-xen-686 /mnt/lib/modules/
    vi /mnt/etc/init.d/hwclock.sh
       #!/bin/sh
       exit 0
    umount /mnt/

Another pitfall is the crond-daemon start. It hangs also at boot. The solution is to add a line extra = 'console=hvc0 xencons=tty' in your host1.fqdn.cfg (see xen-support).

The last two errors are the swap- and ssh-login-error. So boot the DomU an do this (my swap is here /dev/sda2):

    mkswap /dev/sda2
    swapon -a

If you try to login in your DomU using SSH, you get an ssh error: PTY allocation request failed .... Install udev on the DomU will fix it.

Done!

Tom


Disclaimer


No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damage your system. Proceed with caution, and although this is highly unlikely, the author do not take any responsibility. All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.
Tags: 

Impressum