|
|
xenFrom $1Table of contents
Xen Install on Lenny Debian This guide describes the way I intalled my home server. The server is a Debian Lenny installation containing a variaty of virtual servers. The virtualisation is done by xen. This guides describes the proceses needed, commands issued and so on. Good luck!
Step 1 - Basic installationFirst install a minimal Lenny from a network boot machine.
Step 2 - Change settingsWe need to change the IP address of the server as we want it to have a static address (instead of an address issued by DHCP): # nano /etc/network/interfaces Change the following parts of this file
Now restart the network device: # ifdown eth0 # ifup eth0 Now we need to install the ssh-server to make maintainance a bit easier: # apt-get install openssh-server
Step 3 - Install xenFinally it is time to install our mighty xen: # apt-get install xen-hypervisor-i386 linux-image-2.6-xen-686 linux-headers-2.6-xen-686 xen-utils-3.2-1 xen-tools bridge-utils To make the consoles work we also need to make some changes to the inittab: # nano /etc/inittab
Step 4 - Edit xen to make it work properlyAfter the installation there are still a few adjustments to make in order to get it running smoothly. Firstly we make the consoles work. Therefore we need to make some changes to the inittab: # nano /etc/inittab Change the following parts of this file
Also edit the /etc/xen/xend-config.sxp # nano /etc/xen/xend-config.sxp See the desciption on: http://www.howtoforge.com/virtualization-with-xen-on-debian-lenny-amd64 Next edit the xen-tools.conf # nano /etc/xen-tools/xen-tools.conf See the desciption on: http://www.howtoforge.com/virtualization-with-xen-on-debian-lenny-amd64 Finally we also need to make some adjustments to prevent the famous “clocksource/0: Time went backwards” error (or similar problems) by not using the xen clock. First we need to install ntp on the dom0: # apt-get install ntp Also see: http://wiki.debian.org/Xen Then, later, we also have to take some steps into account for the domU, but we see about them later!
Now it is time to load our new (xen)kernel. Therefore, reboot the server: # reboot
Step 5 - Create a domU (virtual server)Let's create a dumU: # xen-create-image --hostname=<DOMAIN>.hanckmann.net --size=4Gb --swap=256Mb –ip=192.168.2.<IP ADDRESS> --memory=128Mb --arch=i386 –role=udev For example: # xen-create-image --hostname=apache.hanckmann.net --size=4Gb --swap=256Mb --ip=192.168.2.211 --memory=128Mb --arch=i386 –role=udev
Before we do anything else, we first prevent the famous “clocksource/0: Time went backwards” error. Edit the *.cfg file of the created domU domain: # nano /etc/xen/<DOMAIN>.hanckmann.net.cfg Now add (or expand) the extra line:
This domU runs a standard Debian Lenny installation on the i386 platform with 4Gb disk space, 256Mb swap space and 128Mb memory.
Step 6 - Start the domUNow it is time to start this domU. This is done via the command "xm create ...cfg". In my example I would issue the command: # xm create /etc/xen/apache.hanckmann.net.cfg
Check if the domU managed to start by typing: # xm list The domU should be in that list.
To work with the domU we have to connect to its console. We do this via: # xm console apache.hanckmann.net
Step 7 - Adjusting the domUThe domU needs some minor adjustments to make it work nicely. First we, again, go on to prevent the famous “clocksource/0: Time went backwards” error. Type: # nano /etc/sysctl.conf and add the line:
Now install the ntp client on this machine: # apt-get install ntp
To activate the changes without a reboot perform the following steps: # sysctl -p # echo "jiffies"> /sys/devices/system/clocksource/clocksource0/current_clocksource
Besides this it is a good idea to generate an rsa key so you can ssh into your virtual machine (sshserver is installed by default): # ssh-keygen You can also simply reboot the domU.
Step 8 - Exit the domU environmentTo exit the domU environment type CTRL + ]
Step 9 - Read the following information sources
Hi, I had to add "console=hvc0 xencons=tty" to the extra parameter. If not, I cannot access the dom0 console... extra = "clocksource=jiffies console=hvc0 xencons=tty” thanks for the tuto ++
Move an LVM-based virtual machine to another hostby Brad on Apr.26, 2008, under Linux, Tech Notes, Virtualization For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host. There may be more elegant ways to achieve this, but this is what worked for me. Environment
2. Export the snapshot of the guest VM to a file that can be moved between physical servers.
3. Remove the snapshot LVM volume.
4. Copy the file to the new VM host. Make sure you have sufficient free drive space.
5. On the new VM host, create an LVM volume that is at least as big as the guest VM file.
6. Transfer the guest VM file to the new LVM volume.
7. Copy the VM config file from the old VM host to the new VM host server.
8. Copy the file to the appropriate directory.
Summary of Commands dd if=/dev/arsndom/arsn.arsena.co.id-disk-snpsht conv=noerror,sync bs=64k | ssh root@10.1.1.32 'dd of=/dev/node0032/arsn.arsena.co.id-disk'
Tags:
|
||||