Difference between revisions of "Vnx-rootfsdragon"

From VNX
Jump to: navigation, search
(Created page with "{{Title|How to use DRAGON GMPLS UML root filesystem with VNX}} The [http://dragon.east.isi.edu/twiki/bin/view/DRAGON/WebHome DRAGON (Dynamic Resource Allocation via GMPLS Opt...")
 
(Recompiling kernel:)
 
(One intermediate revision by the same user not shown)
Line 39: Line 39:
 
  strip linux  
 
  strip linux  
 
  cp linux /usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx
 
  cp linux /usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx
 +
chmod +x /usr/share/vnx/kernels/uml_linux-2.6.27.8-vnx
 
</ul>
 
</ul>
  
Line 66: Line 67:
 
<li>Copy the root filesystem to VNX directory:</li>
 
<li>Copy the root filesystem to VNX directory:</li>
 
  cp Debian-4.0-x86-root_fs-2008Dec10 /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx
 
  cp Debian-4.0-x86-root_fs-2008Dec10 /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx
 +
</ul>
 +
 +
=== Installing new software: ===
 +
 +
<ul>
 +
<li>Mount the rootfs and chroot to it:</li>
 +
mount -o loop /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx /mnt/dragon
 +
chroot /mnt/dragon
 +
<li>Edit /etc/resolv.conf and configure the DNS ip address</li>
 +
<li>Test that you have network connectivity and make the desired changes</li>
 +
<li>Once finished, exit chroot and unmount</li>
 +
exit
 +
umount /mnt/dragon
 
</ul>
 
</ul>
  

Latest revision as of 02:08, 6 June 2012

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.

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
    
  • Prepare rootfs to be used with VNX:
  • 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
    
  • Exit rootfs directories and unmount it:
  • popd
    umount /mnt/dragon
    
  • Copy the root filesystem to VNX directory:
  • cp Debian-4.0-x86-root_fs-2008Dec10 /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx
    

Installing new software:

  • Mount the rootfs and chroot to it:
  • mount -o loop /usr/share/vnx/filesystems/Debian-4.0-x86-root_fs-2008Dec10-vnx /mnt/dragon
    chroot /mnt/dragon
    
  • Edit /etc/resolv.conf and configure the DNS ip address
  • Test that you have network connectivity and make the desired changes
  • Once finished, exit chroot and unmount
  • exit
    umount /mnt/dragon
    

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>
    
  • Start the scenario with:
  • vnx -f dragon.xml -v -t