Difference between revisions of "Vnx-install-ubuntu2"

From VNX
Jump to: navigation, search
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Title|VNX Installation over Ubuntu}}
 
{{Title|VNX Installation over Ubuntu}}
  
Work in progress...do not use yet!
+
This section describes the procedure for manually installing VNX over Ubuntu 12.04, 12.10 and 13.04.  
 
 
 
 
This section describes the procedure for manually installing VNX over Ubuntu 12.04.  
 
  
 
Open a root shell window and follow these steps:
 
Open a root shell window and follow these steps:
Line 10: Line 7:
  
 
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li>
 
<li>Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):</li>
  apt-get update
+
  sudo apt-get update
 
+
  sudo apt-get install qemu-kvm libvirt-bin vlan xterm bridge-utils screen virt-manager \
  apt-get install qemu-kvm libvirt-bin vlan xterm bridge-utils screen virt-manager virt-viewer libxml-checker-perl \
+
  virt-viewer uml-utilities graphviz genisoimage gnome-terminal tree \
      libxml-parser-perl libnetaddr-ip-perl libnet-pcap-perl \
+
  curl w3m picocom expect lxc wmctrl \
  libnet-ipv6addr-perl liberror-perl libexception-class-perl \
+
  libnetaddr-ip-perl libxml-libxml-perl libxml-tidy-perl libappconfig-perl \
  uml-utilities libxml-libxml-perl libterm-readline-perl-perl libnet-telnet-perl \
+
  libreadonly-perl libterm-readline-perl-perl libnet-pcap-perl libnet-ipv6addr-perl \
  libnet-ip-perl libreadonly-perl libmath-round-perl libappconfig-perl \
+
  libsys-virt-perl libnet-telnet-perl liberror-perl libexception-class-perl \
  libdbi-perl graphviz genisoimage gnome-terminal tree libio-pty-perl libsys-virt-perl libfile-homedir-perl
+
  libxml-dom-perl libdbi-perl libmath-round-perl libio-pty-perl libnet-ip-perl \
 
+
  libxml-checker-perl libxml-parser-perl libfile-homedir-perl  
<!--
+
<!--
 
build-essential  \
 
build-essential  \
 
  libxml2-dev libgnutls-dev \
 
  libxml2-dev libgnutls-dev \
 
   libdevmapper-dev  libnl-dev  \
 
   libdevmapper-dev  libnl-dev  \
 
     python-dev libsasl2-dev  
 
     python-dev libsasl2-dev  
 
 
 
  
 
  apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \
 
  apt-get install build-essential qemu-kvm libvirt-bin vlan xterm \
Line 38: Line 32:
 
   libfile-homedir-perl python-dev libsasl2-dev tree libio-pty-perl libsys-virt-perl
 
   libfile-homedir-perl python-dev libsasl2-dev tree libio-pty-perl libsys-virt-perl
 
-->
 
-->
 +
<li>Tune libvirt configuration to work with VNX. In particular, edit /etc/libvirt/qemu.conf file and set the following parameters:</li>
 +
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/net/tun",
 +
]
 +
and restart libvirtd for the changes to take effect:
 +
restart libvirt-bin
 +
<li>Check that libvirt is running correctly, for example, executing:</li>
 +
virsh list
 +
virsh capabilities
 +
Note: Have a look at [[Vnx-install-trobleshooting|this document]] in case you get an error similar to this one: virsh: /usr/lib/libvirt.so.0: version LIBVIRT_PRIVATE-XXX not found (required by virsh)
 +
 +
<li>Only for Ubuntu 12.10: serial lines support seems to be broken in qemu-kvm v1.2 package provided in 12.10, so you need to downgrade to v1.0.1.</li>
 +
apt-get install zlib1g-dev libglib2.0-dev
 +
mkdir src
 +
cd src
 +
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/1.0.1/qemu-kvm-1.0.1.tar.gz
 +
tar xfvz qemu-kvm-1.0.1.tar.gz
 +
cd qemu-kvm-1.0.1
 +
./configure --prefix=/usr
 +
make
 +
make install
 +
service libvirt-bin restart
 
<!--li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li>
 
<!--li>If you use 64 bits version of Ubuntu, install 32 bits compatibility libraries:</li>
 
   apt-get install ia32-libs
 
   apt-get install ia32-libs
Line 70: Line 92:
 
  cd /tmp/vnx-update
 
  cd /tmp/vnx-update
 
  rm -rf /tmp/vnx-update/vnx-*
 
  rm -rf /tmp/vnx-update/vnx-*
  wget http://idefix.dit.upm.es/download/vnx/vnx-latest.tgz
+
  wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz
 
  tar xfvz vnx-latest.tgz
 
  tar xfvz vnx-latest.tgz
 
  cd vnx-*
 
  cd vnx-*
Line 76: Line 98:
  
 
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
 
<li>Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:</li>
  mv /etc/vnx.conf.sample /etc/vnx.conf
+
  mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
  
 
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li>
 
<li>Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these [[Vnx-install-root_fs|instructions]]</li>
Line 149: Line 171:
  
 
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:
 
* Calculate the idle-pc value for your computer following the procedure in http://dynagen.org/tutorial.htm:
  dynagen /usr/share/vnx/examples/R.net
+
  dynagen /usr/share/vnx/examples/R3640.net
  console R     # type 'no' to exit the config wizard and wait  
+
  console R3640     # type 'no' to exit the config wizard and wait  
 
               # for the router to completely start  
 
               # for the router to completely start  
  idle-pc get R
+
  idlepc get R3640
Once you know the idle-pc value for your system, include it in /etc/vnx.conf file.
+
Once you know the idlepc value for your system, include it in /etc/vnx.conf file.
 
 
<!--
 
 
 
=== Additional install steps for Olive support ===
 
 
 
An additional step is needed to support Olive (Juniper) routers in VNX scenarios:
 
 
 
<ul>
 
 
 
<li>Create a special bios for Olive with the CONFIG_SMBIOS option disabled:  </li>
 
wget http://www.linuxtogo.org/~kevin/SeaBIOS/seabios-0.6.2.tar.gz
 
tar xfvz seabios-0.6.2.tar.gz
 
cd seabios-0.6.2
 
make
 
sed -i -e 's/#define CONFIG_SMBIOS 1/#define CONFIG_SMBIOS 0/' out/autoconf.h
 
make
 
cp out/bios.bin /usr/share/kvm/bios-olive.bin
 
See more details [http://inetpro.org/wiki/Using_QEMU_with_Olive_to_emulate_Juniper_Routers#Watchdog_panic_immediately_after_boot here]
 
-->
 
 
 
 
 
<!-- Ya no hace falta desde que se usa <qemu:commandline>
 
 
 
<li>Install a patched version of libvirt 0.8.5 with support to define the bios used by a virtual machine:</li>
 
 
 
<ul>
 
<li>Copy the following content to a file named libvirt-0.8.5-biosfile.patch (based on http://www.mail-archive.com/libvir-list@redhat.com/msg15952.html):</li>
 
<pre>
 
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.c libvirt-0.8.5/src/conf/domain_conf.c
 
*** libvirt-0.8.5.orig/src/conf/domain_conf.c 2010-11-22 11:38:08.000000000 +0100
 
--- libvirt-0.8.5/src/conf/domain_conf.c 2010-11-22 11:47:41.000000000 +0100
 
***************
 
*** 4267,4272 ****
 
--- 4267,4274 ----
 
      if (node)
 
          def->mem.hugepage_backed = 1;
 
 
 
+    def->biosfile = virXPathString("string(./biosfile[1])", ctxt);
 
+
 
      /* Extract other memory tunables */
 
      if (virXPathULong("string(./memtune/hard_limit)", ctxt,
 
                        &def->mem.hard_limit) < 0)
 
diff -crB libvirt-0.8.5.orig/src/conf/domain_conf.h libvirt-0.8.5/src/conf/domain_conf.h
 
*** libvirt-0.8.5.orig/src/conf/domain_conf.h 2010-11-22 11:38:08.000000000 +0100
 
--- libvirt-0.8.5/src/conf/domain_conf.h 2010-11-22 11:40:18.000000000 +0100
 
***************
 
*** 885,890 ****
 
--- 885,891 ----
 
          unsigned long min_guarantee;
 
          unsigned long swap_hard_limit;
 
      } mem;
 
+    char *biosfile;
 
      unsigned short vcpus;
 
      unsigned short maxvcpus;
 
      int cpumasklen;
 
diff -crB libvirt-0.8.5.orig/src/qemu/qemu_conf.c libvirt-0.8.5/src/qemu/qemu_conf.c
 
*** libvirt-0.8.5.orig/src/qemu/qemu_conf.c 2010-11-22 11:38:08.000000000 +0100
 
--- libvirt-0.8.5/src/qemu/qemu_conf.c 2010-11-22 11:41:05.000000000 +0100
 
***************
 
*** 3984,3989 ****
 
--- 3984,3995 ----
 
      ADD_ARG_LIT(emulator);
 
      ADD_ARG_LIT("-S");
 
 
 
+    if(def->biosfile)
 
+    {
 
+        ADD_ARG_LIT("-bios");
 
+        ADD_ARG_LIT(def->biosfile);
 
+    }
 
+
 
      /* This should *never* be NULL, since we always provide
 
      * a machine in the capabilities data for QEMU. So this
 
      * check is just here as a safety in case the unexpected
 
</pre>
 
 
 
<li>Install libvirt 0.8.5 with that patch applied:</li>
 
service libvirt-bin stop
 
wget http://libvirt.org/sources/libvirt-0.8.5.tar.gz
 
tar xfvz libvirt-0.8.5.tar.gz
 
cd libvirt-0.8.5
 
patch -p1 -i ../libvirt-0.8.5-biosfile.patch
 
./configure --without-xen --prefix=/usr && make && make install
 
service libvirt-bin start
 
 
 
</ul>
 
 
 
<li>Download old qemu bios from 0.10.6 version and copy it to /usr/share/qemu directory:</li>
 
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.10.6/qemu-kvm-0.10.6.tar.gz
 
tar xfvz qemu-kvm-0.10.6.tar.gz
 
cp qemu-kvm-0.10.6/pc-bios/bios.bin /usr/share/qemu-kvm/bios-0.10.6.bin
 
-->
 
 
 
<!-- Not needed, it seems to work without downloading this drivers
 
<li>Download i82559 ROM from the latest qemu versions (Ubuntu 10.04 does not include that ROM in qemu-kvm package):</li>
 
wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/0.12.5/qemu-kvm-0.12.5.tar.gz
 
tar xfvz qemu-kvm-0.12.5.tar.gz
 
cp qemu-kvm-0.12.5/pc-bios/pxe-i82559er.bin /usr/share/qemu-kvm/
 
-->
 
</ul>
 

Latest revision as of 15:47, 3 October 2014

VNX Installation over Ubuntu

This section describes the procedure for manually installing VNX over Ubuntu 12.04, 12.10 and 13.04.

Open a root shell window and follow these steps:

  • Install all packages required (basic development, virtualization, perl libraries and auxiliar packages):
  • 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 tree \
     curl w3m picocom expect lxc wmctrl \
     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 
    
  • Tune libvirt configuration to work with VNX. In particular, edit /etc/libvirt/qemu.conf file and set the following parameters:
  • 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/net/tun",
    ]
    

    and restart libvirtd for the changes to take effect:

    restart libvirt-bin
    
  • Check that libvirt is running correctly, for example, executing:
  • virsh list
    virsh capabilities
    

    Note: Have a look at this document in case you get an error similar to this one: virsh: /usr/lib/libvirt.so.0: version LIBVIRT_PRIVATE-XXX not found (required by virsh)

  • Only for Ubuntu 12.10: serial lines support seems to be broken in qemu-kvm v1.2 package provided in 12.10, so you need to downgrade to v1.0.1.
  • apt-get install zlib1g-dev libglib2.0-dev
    mkdir src
    cd src
    wget http://downloads.sourceforge.net/project/kvm/qemu-kvm/1.0.1/qemu-kvm-1.0.1.tar.gz
    tar xfvz qemu-kvm-1.0.1.tar.gz
    cd qemu-kvm-1.0.1
    ./configure --prefix=/usr
    make
    make install
    service libvirt-bin restart
    
  • Install VNX:
  • mkdir /tmp/vnx-update
    cd /tmp/vnx-update
    rm -rf /tmp/vnx-update/vnx-*
    wget http://vnx.dit.upm.es/vnx/vnx-latest.tgz
    tar xfvz vnx-latest.tgz
    cd vnx-*
    ./install_vnx
    
  • Create the VNX config file (/etc/vnx.conf). You just can move the sample config file:
  • mv /usr/share/vnx/etc/vnx.conf.sample /etc/vnx.conf
    
  • Download root file systems from http://idefix.dit.upm.es/download/vnx/filesystems and install them following these instructions
  • Additional install steps for Dynamips support

    • Install Dynamips and Dynagen:
    apt-get install dynamips dynagen
    
    #!/bin/sh
    # Start/stop the dynamips program as a daemon.
    #
    ### BEGIN INIT INFO
    # Provides:          dynamips
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Cisco hardware emulator daemon
    ### END INIT INFO
    
    DAEMON=/usr/bin/dynamips
    NAME=dynamips
    PORT=7200
    PIDFILE=/var/run/$NAME.pid 
    LOGFILE=/var/log/$NAME.log
    DESC="Cisco Emulator"
    SCRIPTNAME=/etc/init.d/$NAME
    
    test -f $DAEMON || exit 0
    
    . /lib/lsb/init-functions
    
    
    case "$1" in
    start)  log_daemon_msg "Starting $DESC " "$NAME"
            start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE
            log_end_msg $?
            ;;
    stop)   log_daemon_msg "Stopping $DESC " "$NAME"
            start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME
            log_end_msg $?
            ;;
    restart) log_daemon_msg "Restarting $DESC " "$NAME"
            start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name $NAME
            start-stop-daemon --start --chdir /tmp --background --make-pidfile --pidfile $PIDFILE --name $NAME --startas $DAEMON -- -H $PORT -l $LOGFILE
            log_end_msg $?
            ;;
    status)
            status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? 
            #status $NAME
            #RETVAL=$?
            ;; 
    *)      log_action_msg "Usage: $SCRIPTNAME {start|stop|restart|status}"
            exit 2
            ;;
    esac
    exit 0
    
    
    • Set execution permissions for the script and add it to system start-up:
    chmod +x /etc/init.d/dynamips
    update-rc.d dynamips defaults
    /etc/init.d/dynamips start
    
    • Download and install cisco IOS image:
     cd /usr/share/vnx/filesystems
     # Cisco image
     wget ... c3640-js-mz.124-19.image
     ln -s c3640-js-mz.124-19.image c3640
    
    dynagen /usr/share/vnx/examples/R3640.net
    console R3640     # type 'no' to exit the config wizard and wait 
                  # for the router to completely start 
    idlepc get R3640
    
    Once you know the idlepc value for your system, include it in /etc/vnx.conf file.