Vnx-rootfsolive

From VNX
Jump to: navigation, search

How to create a KVM Olive (Juniper router) root-file-system for VNX

The procedure described here is mainly based on the excellent information provided in the following GNS3 blog entry: Olive reloaded or how to emulate Juniper routers. It has been tested over an Ubuntu 10.04.1 LTS machine.

Steps:

  • Create the base root filesystem image (use 7G instead of 4G):
  • qemu-img create -f qcow2 vnx_rootfs_olive.qcow2 7G
    
  • Download Freebsd 4.11 installation CD from:
  • wget ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ISO-IMAGES/4.11/4.11-RELEASE-i386-miniinst.iso
    
  • Start the new virtual machine:
  • kvm -m 256 -hda vnx_rootfs_olive.qcow2 -cdrom 4.11-RELEASE-i386-miniinst.iso -boot d -localtime
    

    and make the FreeBSD installation following the exact steps described in GNS3 blog.

  • Once the FreeBSD installation is finished, stop the virtual machine (just make a Ctrl-C on the window you started the kvm command line when asked to restart). Start the virtual machine again using the following options:
  • kvm -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
    
  • Login into the machine and configure the network interface:
  • dhclient em0
    
  • Get JunOS package (you need an account in Juniper's server to download JunOS images):
  • wget ... jinstall-9.5R1.8-domestic-signed.tgz
    
  • Copy it using scp from inside the virtual machine:
  • scp 10.0.2.2:/path-to/jinstall-9.5R1.8-domestic-signed.tgz /var/tmp
    
  • Prepare the JunOS package before installing it using the following instructions:
  • cd /var/tmp
    mkdir jinst-signed
    cd jinst-signed/
    tar zxvf ../jinstall-9.5R1.8-domestic-signed.tgz
    mkdir jinst
    cd jinst
    tar zfvx ../jinstall-9.5R1.8-domestic.tgz
    mkdir pkgtools
    cd pkgtools
    tar zxvf ../pkgtools.tgz
    cd bin
    cp /usr/bin/true ./checkpic
    cd ..
    tar zcvf ../pkgtools.tgz *
    cd ..
    rm -rf pkgtools
    tar zcfv /var/tmp/jinstall-9.5R1.8-domestic-olive.tgz *
    cd /var/tmp
    rm -rf jinstall-9.5R1.8-domestic-signed.tgz jinst-signed
    

    Note: you don't need to sign the package before rebuilding it as described in Olive's blogs.

  • Install the package:
  • pkg_add -f jinstall-9.5R1.8-domestic-olive.tgz
    
  • When the installation is finished and you are required to reboot, stop the virtual machine with "halt" and restart it with the following parameters:
  • kvm -bios bios-0.10.6.bin -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio
    

    Note: as stated in a comment to "Olive reloaded" blog entry mentioned above, Olive virtual machines do not work with the latest BIOS distributed with qemu-kvm package. To make it work, you have to download the BIOS from qemu 0.10.6 version and copy it to /usr/share/qemu/ directory:

    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
    
  • Finally, install the autoconfiguration daemon with the following procedure:
    • Start the virtual machine with:
    • kvm -bios bios-0.10.6.bin -m 1024 -hda vnx_rootfs_olive.qcow2 -boot c -localtime -nodefaults -nographic -serial stdio -net nic,macaddr=00:aa:00:60:01:01,model=e1000 -net user
      
    • Configure the network interface manually (dhclient is no more available; it has been deleted duting JunOS installation) and test the connectivity to the host:
    • ifconfig em0 inet 10.0.2.10/24
      ping 10.0.2.2
      
    • Copy the olived tar file to the virtual machine (note that name of the file could be different depending on the version):
    • scp 10.0.2.2:/usr/share/vnx/aced/vnx-aced-olive-0.1b.tgz /var/tmp
      
    • Expand the tar file and install the daemon:
    • cd /var/tmp
      tar xfvz vnx-aced-olive-0.1b.tgz 
      cd vnx-ace-olive-0.1b
      sh install-vnxolived
      
    • Delete /var/tmp directory:
    • rm -rf /var/tmp/*
      
    • Set the root password for the router:
    • cli
      config
      set system root-authentication plain-text-password 
      commit
      
  • Stop the virtual machine with a halt. The root filesystem is now ready to be used with VNX.

Updating ACE daemon

To update the autoconfiguration and command execution daemon (ACED):

  • Start the virtual machine with:
virsh create rootfs_olive.xml


References