Vnx-rootfsdragon
How to use DRAGON GMPLS UML root filesystem with VNX
The DRAGON (Dynamic Resource Allocation via GMPLS Optical Networks) project is conducting research and developing technologies to enable dynamic provisioning of network resources on an interdoman basis across heterogeneous network technologies. As part of the project they provide instructions for simulating a GMPLS network using User Mode Linux root filesystem.
This documents is a quick recipe describing how to use DRAGON's UML root filesystem with VNX.
VNX supports User-Mode-Linux virtual machines, so the root filesystem and kernels provided by DRAGON's project can be directly used after making the standard modifications to the rootfs.
However, neither the kernel nor the root filesystem include support for iso9660 filesystem format, which is needed by VNX to autoconfigure virtual machines once started.
So, to use DRAGON's rootfs we need to rebuild the UML kernel with iso9600 support. The procedure described below has been tested over an Ubuntu 10.04.4 32 bits system. It does NOT work as it is over a 64 bits system, even using the SUBARCH=i386 compilation option.
Recompiling kernel:
NOTE: if you do not want to follow the procedure you can download the modified kernel from here.
- Download DRAGON kernel config file:
wget http://dragon.maxgigapop.net/twiki/pub/DRAGON/UserModeLinux/uml_linux-2.6.27.8.config
apt-get install vde2 libvdeplug2-dev
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.8.tar.gz tar xfvz linux-2.6.27.8.tar.gz cd linux-2.6.27.8
wget http://wiki.strongswan.org/projects/strongswan/repository/revisions/693a244d0fddccd11f3a18112519d3593e0eb197/raw/src/dumm/patches/mconsole-exec-2.6.27.patch patch -p1 < mconsole-exec-2.6.27.patch
wget http://idefix.dit.upm.es/vnx/filesystems/dragon-gmpls/kernel-buffer-overflow.patch patch -p1 < kernel-buffer-overflow.patch
make defconfig ARCH=um CC=gcc-4.4 cp ../uml_linux-2.6.27.8.config .config sed -i -e 's/CONFIG_ISO9660_FS=m/CONFIG_ISO9660_FS=y/' .config make ARCH=um CC=gcc-4.4
strip linux cp linux /usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx
Modifiyng root filesystem:
- Download dragon rootfs and uncompress it:
wget http://dragon.maxgigapop.net/twiki/pub/DRAGON/UserModeLinux/Debian-4.0-x86-root_fs-2008Dec10.bz2 bunzip2 Debian-4.0-x86-root_fs-2008Dec10.bz2
mkdir /mnt/dragon mount -o loop Debian-4.0-x86-root_fs-2008Dec10 /mnt/dragon chroot /mnt/dragon echo '/dev/ubdb /mnt/vnuml iso9660 defaults 0 0' >> /etc/fstab mkdir /mnt/vnuml mkdir /mnt/hostfs ln -s /mnt/vnuml/umlboot /etc/rc2.d/S11umlboot exit pushd /mnt/dragon/dev wget http://www.theshore.net/~caker/uml/makeUBDdev.sh chmod a+x makeUBDdev.sh ./makeUBDdev.sh rm makeUBDdev.sh
popd umount /mnt/dragon
cp Debian-4.0-x86-root_fs-2008Dec10 /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx
Testing:
- Install VNX (see instructions here)
- Create a file named dragon.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?> <!-- ~~~~~~~~~~~~~~~~~~~~ VNX Sample scenarios ~~~~~~~~~~~~~~~~~~~~ Name: dragon Description: Simple example to show two virtual machines running DRAGON's rootfs connected to a network. The host has an interface in Net0 with address 10.0.0.1 This file is part of the Virtual Networks over LinuX (VNX) Project distribution. (www: http://www.dit.upm.es/vnx - e-mail: vnx@dit.upm.es) Departamento de Ingenieria de Sistemas Telematicos (DIT) Universidad Politecnica de Madrid SPAIN --> <vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-2.00.xsd"> <global> <version>2.0</version> <scenario_name>simple_uml-dragon</scenario_name> <automac offset="2"/> <!--vm_mgmt type="none" /--> <vm_mgmt type="private" network="10.250.0.0" mask="24" offset="8"> <host_mapping /> </vm_mgmt> <vm_defaults> <exec_mode type="uml">net</exec_mode> </vm_defaults> </global> <net name="Net0" mode="virtual_bridge" /> <vm name="vm1" type="uml" subtype="" os=""> <filesystem type="cow">/usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx</filesystem> <mem>256M</mem> <kernel trace="on">/usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx</kernel> <console id="0" display="yes">xterm</console> <if id="1" net="Net0"> <ipv4>10.0.0.20/24</ipv4> </if> </vm> <vm name="vm2" type="uml" subtype="" os=""> <filesystem type="cow">/usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx</filesystem> <mem>256M</mem> <kernel trace="on">/usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx</kernel> <console id="0" display="yes">xterm</console> <if id="1" net="Net0"> <ipv4>10.0.0.21/24</ipv4> </if> </vm> <host> <hostif net="Net0"> <ipv4>10.0.0.1/24</ipv4> </hostif> </host> </vnx>
vnx -f dragon.xml -v -t