Xen is an opensource hypervisor. Version 4 has been released on the 7th of april 2010.
One of the main new feature concerns high availability. With the intergation of project Remus code, Xen now supports fault tolerance for virtual machines, using live transactional synchronization of VM state between physical servers.
Unfortunatly, Debian is only shipped with Xen version 3.2 for current stable Lenny, and version 3.4 for next stable Squeeze. Let's see how to install Xen 4 on Lenny.
Current system inventory
The target Xen platform we want to upgrade is discribed here (sorry for my non french readers, theses 2 documents are not translated yet):
- Virtualisation avec Xen sous GNU/Debian Linux
- Cluster Xen sous Debian GNU/Linux avec DRBD, Corosync et Pacemaker
Despite the use of cluster stack in the second case, installation will follow the same steps for both architectures.
But we have to take care about some things in order to complete migration:
- We are about to upgrade Xen hypervisor. We will also have to upgrade Dom0 kernel (during my tests, Debian 2.6.26 kernel crashed while booting with Xen4 and I don't have time to investigate it for now).
- Because we update Dom0 kernel, we must build a new DRBD module accordingly
- Finally, because we'll build Xen from sources, we have to clean Debian install in order to avoid libraries conflicts.
All compilations will be done on a specific computer. For obvious security reasons, it's of course out of question to compile Xen on the Dom0. Remember ? "Never install dev tools on productions servers" ;-)
Inside our dedicated VM, tou must install needed packages for compilation:
As we'll use Debian provided Dom0 kernel, we don't need to build it. The
make stubdom command is therefore not required.
Binaries have copied into
dist directory. You'll find a script called
install.sh which will take care of copying files in destination system tree.
System files are located
dist/install. In order to make deployment easier, we'll build a tar.gz archive from direcory
But first, we have to modify some files to respect Debian's usages for configuration files stroage: we have to move
Then, we have to adapt init scripts.
Then, you can copy this archive on each dom0 you want to update. Let's deal now with DRBD module.
Our next dom0 kernel will be 2.6.32 from backports repos. We have to build it. As our dev VM does not use it, we must specify kernel version module-assistant will have to use to build against.
I only write a summary of needed commands, details are already here (still only in french, sorry): Installation de DRBD > 8.3.2 sur Debian GNU/Linux Lenny
Before beginning, ensure all your VMs have been migrated (or stopped, depending on you configuration).
First install new kernel from backports:
Now reboot the server. If everything is fine, you can uninstall all xen related packages as well as the old kernel. As usual, do not forget to backup your Xen configuration !
Once done, you can install DRBD module and Xen4 archive:
Without the last command, xend process will be unable to communicate with hypervisor and therefore, nothing will work. You may have to add some others modules in
Now it's time to restore Xen's config files. Finally, setup xen related services start
When done and before rebooting on hypervisor, you should install some libraries. They are needed for Xen to work, but have been uninstalled by Debian (because you remove packages).
Now you can reboot and start Xen4 hypervisor. Let's check Xen status with command
Et voilà, now you have a completly new Xen4 dom0 running Debian Lenny. Have fun !
Sources and references
- GNU/Debian Linux