top of page

The VNX system consists of the VNX program that parses the scenario description XML file and builds and manages the virtual network elements; XML files that contain a description of the network scenario to be created; and preconfigured KVM or UML root filesystems that are used to create the virtual machines in the network simulation scenario.

Environment: VMWare (Ubuntu 16.04)

Install requirement and check Virtualization support

1. Install cpu-checker
$ sudo apt-get install cpu-checker

2. Check virtualization suppport 
$ kvm-ok

Or 

$ egrep '(vmx|svm)' --color=always /proc/cpuinfo

*vmx or svm should be colored RED

*Intel use VMX

*AMD use SVM

Install requirement

3. Update & Install requirement

$ sudo apt-get update

sudo apt-get install qemu-kvm libvirt-bin vlan xterm bridge-utils screen virt-manager \
  virt-viewer uml-utilities graphviz genisoimage gnome-terminal xfce4-terminal tree \
  curl w3m picocom expect lxc wmctrl xdotool pv bash-completion \
  libnetaddr-ip-perl libxml-libxml-perl libxml-tidy-perl libappconfig-perl \
  libreadonly-perl libterm-readline-perl-perl libnet-pcap-perl libnet-ipv6addr-perl \
  libsys-virt-perl libnet-telnet-perl liberror-perl libexception-class-perl \
  libxml-dom-perl libdbi-perl libmath-round-perl libio-pty-perl libnet-ip-perl \
  libxml-checker-perl libxml-parser-perl libfile-homedir-perl libswitch-perl \
  openvswitch-switch net-tools

Edit qemu.conf

4. Copy paste this at /etc/libvirt/qemu.conf


5. Restart libvirt-bin service

$ sudo systemctl restart libvirt-bin

6. Check if libvirt is running correctly. Without Error

$ sudo virsh list

$ sudo virsh capabilities

7. Install VNX

$ mkdir /tmp/vnx-update

$ mcd /tmp/vnx-update

$ mrm -rf /tmp/vnx-update/vnx-*

$ wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz

$ tar xfvz vnx-latest.tgz

$ cd vnx-*-*

$ sudo ./install_vnx

8.  Create VNX config file

$ sudo cp /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf

9. edit /etc/vnx.conf

*Ubuntu 15.04 or newer:

overlayfs_workdir_option = 'yes'

*Ubuntu 16.04 and 16.10:

union_type='overlayfs'

-----------------------------------------------------------------------------------------------------------------------------------------

TEST RUNNING VNX

*NOTE: I will use "tutorial_ubuntu.xml" to test if VNX can run without problem, so we need to download 
tutorial_ubuntu.xml requirement:


 i. vnx_rootfs_kvm_ubuntu-12.04-v025.qcow2.bz2
 ii.vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2.bz2 


 it is because the "tutorial_ubuntu.xml" need this two files to run the "tutorial_ubuntu.xml" scenario.

Done.

 HOW TO IDENTIFY WHICH FILESYSTEMS TO DOWNLOAD:
 1. It should be tell in the .xml file. 


 For this tutorial we are using an example scenario that already been given, which is "tutorial_ubuntu.xml"


 2. Go to example folder
 $ cd /usr/share/vnx/example/


 3. Find the filesystems that required by the tutorial_ubuntu.xml
 $ grep rootfs tutorial_ubuntu.xml
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu-gui</filesystem>
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu</filesystem>
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu</filesystem>
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu</filesystem>
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu</filesystem>
    <filesystem type="cow">/usr/share/vnx/filesystems/
rootfs_ubuntu</filesystem>
  *From output above we can see to run the scenario tutorial_ubuntu.xml

 

we need only: 
 
i. rootfs_ubuntu-gui 
 ii. rootfs_ubuntu

-----------------------------------------------------------------------------------------------------------------------------------------

TUTORIAL HOW TO USE VNX

1. Download VNX root filesystems:


Using VNX tools:
    i. Go to filesystems folder (rootfs file must be placed in the filesystems folder!)
    $ cd /usr/share/vnx/filesystems


    ii. Execute vnx_download_rootfs
   $ sudo /usr/bin/vnx_download_rootfs 
        * Add [ -l ]  at the last, if you want the tool automatic create the symbolic links used by VNX example scenarios.


    iii. Select which rootfs you want to download.

 iii. After download it will save and check the MD5 checksum, 

If you enable -l , it will automatic create the symbolic link for you.

Using manual methods:
    i. go to http://vnx.dit.upm.es/vnx/filesystems/


    ii. Download which file you want, using wget commands.

*In this tutorial using vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2.bz2


    $ wget http://download_link


    iii. extract .bz2 file
    
$ sudo bunzip2 vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2.bz2 


    iv. Assign symbolic links
    
$ sudo ln -s vnx_rootfs_kvm_filename.qcow2 rootfs_ubuntu-gui

*Note: Symbolic link name is choose base on the need from the scenario.xml in this case tutorial_ubuntu.xml

1. Check the MD5 checksum if you download manual from the website. Because tools automatic check the MD5 after download.

i. Download from .md5 using from the website.

In this tutorial i download file below:
        vnx_rootfs_kvm_ubuntu-12.04-v025.qcow2.md5
        vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2.md5

    ii. Put .md5 files at /filesystems and then verify the md5 checksum
        $ sudo md5sum -c *.md5
        vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2:
OK
        vnx_rootfs_kvm_ubuntu-12.04-v025.qcow2: OK

2. Check the sumbolic link using "ll" commands

$ ll
lrwxrwxrwx  1 root root         38 Sep 20 13:00 rootfs_ubuntu -> vnx_rootfs_kvm_ubuntu-12.04-v025.qcow2
lrwxrwxrwx  1 root root         42 Sep 20 23:48 rootfs_ubuntu-gui -> vnx_rootfs_kvm_ubuntu-12.04-gui-v025.qcow2

*You should see the symbolic links in the first four lines of the listing (with the “l” flag), each one pointing to a root filesystem file.

3. To start the Scenario. Go to example folder

$ cd /usr/share/vnx/example/

4. Run the scenario.

$ sudo vnx -f tutorial_ubuntu.xml -v --create

*It should be 5 terminal appear and 1 GUI

5. Login each VMX

Login: vnx

Password: xxxx

Done.

-----------------------------------------------------------------------------------------------------------------------------------------

BONUS

To check the configuration of each host 

# cd /.vnx/scenarios/ 

*run as root

Shutdown the scenario 

$ sudo vnx -f tutorial_ubuntu.xml -v --shutdown

Purge the scenario after we configure

$ sudo vnx -f tutorial_ubuntu.xml -v --destroy 

Show scenario map

$ sudo vnx -f tutorial_ubuntu.xml -v --show-map

To shutdown and the restart virtual router r1, execute the commands:
$ sudo vnx -f tutorial_ubuntu.xml -v --shutdown -M r1
$ sudo vnx -f tutorial_ubuntu.xml -v --create -M r1

Suspend and then to resume virtual router r1, execute the commands:
$ sudo vnx -f tutorial_ubuntu.xml -v --suspend -M h1
$ sudo vnx -f tutorial_ubuntu.xml -v --resume -M h1

KVM virtual machines in VNX each have two consoles:

a graphical console (con0) and a command-line console (con1).
Re-open graphical console for h1:
$ sudo vnx -f tutorial_ubuntu.xml -v --console con0 -M h1

Re-open the command-line console for h2:
$ sudo vnx -f tutorial_ubuntu.xml -v --console con1 -M h2

-----------------------------------------------------------------------------------------------------------------------------------------

TROUBLESHOOT

http://web.dit.upm.es/vnxwiki/index.php/Vnx-install-trobleshooting

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-troubleshooting-common_libvirt_errors_and_troubleshooting

-----------------------------------------------------------------------------------------------------------------------------------------

REFERENCES

http://web.dit.upm.es/vnxwiki/index.php/Docintro

http://www.brianlinkletter.com/tag/vnx/

VNX Install and Run

security_driver = "none"
user = "root"
group = "root"
cgroup_device_acl = [
   "/dev/null", "/dev/full", "/dev/zero",
   "/dev/random", "/dev/urandom",
   "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
   "/dev/rtc", "/dev/hpet", "/dev/vfio/vfio", "/dev/net/tun"
]

bottom of page