Xen debian
Contents |
Debian
Debian 4 Etch with 3.1 Xen as a Managed Node
Xen 3.1 Setup: The default xen distribution for the Debian 4 seems to be Xen 3.0.3-1. This being too old, follow the procedure given below to setup Xen 3.1 from binary distributions. This based on an article from howtoforge.
Preparation
# apt-get remove exim4 exim4-base lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig # apt-get install screen ssh debootstrap python python-twisted iproute bridge-utils libcurl3-dev libssl0.9.7
Download the binary bits and install it. This example shows downloading a PAE xen bits.
# cd /usr/src # wget http://bits.xensource.com/oss-xen/release/3.1.0/bin.tgz/xen-3.1.0-install-x86_32p.tgz # tar xvzf xen-3.1.0-install-x86_32.tgz # cd dist/ # ./install.sh # mv /lib/tls /lib/tls.disabled
Lets create the ramdisk
# depmod 2.6.18-xen # apt-get install yaird # mkinitramfs -o /boot/initrd.img-2.6.18-xen 2.6.18-xen
Add Xen in the start up scripts
# update-rc.d xend defaults 20 21 # update-rc.d xendomains defaults 20 21
Update the grub file
# update-grub
Loop devices setup : To use file based disks for virtual machines there should be enough number of /dev/loop devices Check if the kernel has loop module
# lsmod | grep loop
If your kernel has loop compiled in, the above command would not show anything. In thiscase, Edit the /boot/grub/menu.lst file to add max_loop=64 to the kerenl (in a module line).
e.g. module /boot/vmlinuz-2.6.18-xen root=/dev/sda7 ro console=tty0 max_loop=64
Otherwise you will see a line containing loop with couple of numbers. In this case, Edit /etc/modules file and add the following line
loop max_loop=64
Restart the machine. This should show Xen 3.1.0 as one of the menu item.
Configure the managed node
Get the ConVirt tarball (if you are reading this online) and run the following from the config-scripts directory.
# ./configure-xend.sh 3.1
Validate the Bridge setup
The VMs use the bridge to communicate to other vm or other servers. This section help validate/setup the bridge.
# brctl show
This command should show vif0.0 and peth0 in the last column (interfaces). If it is the case, you are done. But, If not, then your VMs may not be able to acess the network. Here are couple of suggestions to fix this Add the following to the /etc/network/interfaces file
## To use dhcp: ## auto eth0 iface eth0 inet dhcp
Move a couple of udev rules to prevent different eth being created on every boot. (Some discussion on this Ethernet numbering, Eth numbering)
# cd /etc/udev/rules.d # mkdir backup # mv *_persistent-net.rules backup # mv *_persistent-net-generator.rules backup
Reboot the machine and check brctl show output.
コメント