If you do a lot of very different projects like we do here at CosmoCode you often need very different environment to test new technologies without interfering with other setups. But using new servers all the time isn't feasible at all. The solution to this is virtualization. It allows you to run multiple completely independednt systems on the same hardware. We decided to go this way and bought I nice big server to do so. For virtualization we use the open source software XEN.
Andreas Gohr, 01/30/2007 12:36 p.m.
If you do a lot of very different projects like we do here at CosmoCode you often need very different environment to test new technologies without interfering with other setups. But using new servers all the time isn't feasible at all.
The solution to this is virtualization. It allows you to run multiple completely independednt systems on the same hardware. We decided to go this way and bought I nice big server to do so. For virtualization we use the open source software XEN.
In the following I will give you some details on how to setup logical volume management (LVM), a XEN "server" (dom-0) and a XEN "client" using Debian's soon-to-be-stable release "Etch".
Getting LVM running is quite simple: partition your harddisk as usual for the host (master) system and create an unformatted partition for management by LVM. For example I created a 1GB swap disk at sda1, a single 10GB root partition at sda2 for the master system and put the rest into sda3.
The next step is to prepare the partition for LVM (think of it like creating a LVM fileystem). This is done with pvcreate.
To use this physical device it needs to be added to a volume group first. Volume groups can span multiple physical devices, but we have only one here. The first parameter to vgcreate is the name of the group. I used the name "vserver" here.
This will install the xend daemon and kernels for the master and the clients. Before the reboot, a small change in /etc/xen/xend-config.sxp should be done.
Make sure you configured the LVM volume group and the kernel/initrd images correctly here.
To boot the system use the mighty xm command which is used to control all the domains.
Use this to set up a root password and other intitial things, to leave the virtual console use CTRL-]. Note this is not a full terminal, log into your new xen domain with SSH to run fancy stuff like ncurses interfaces.
Okay, that's it. This is the very simplest and basic setup, but should get you going.