Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents of this page are obsolete. Please refer to Getting Started with ONOS screencast and Building ONOS instead.

Table of Contents
maxLevel3

...

Code Block
languagetext
build:~$ sudo -s
build:~#

1.  Prerequisites Prerequisites and Setup for the Tutorial

...

    • Name: build, type: Linux:
      • Select 2GB of RAM
      • Hard disk: take the defaults: 8 GB and Create a virtual hard disk now
      • Hard disk file type: VDI
      • Storage on physical hard disk: Dynamically allocated
      • File location and size: type "build" for the name - select at least 10 GB for the size of the virtual hard disk for the build VM
    • Click on settings for the build VM:
      • Storage: Controller IDE – click on the disk with a + sign symbol to add an optical drive. Choose disk: browse to the location of the downloaded iso file.
      • Add a 2nd network adapter for host-only network (see the screenshot in the section for Creating onos-scratch VM.)
      • System: Motherboard tab – uncheck floppy, move optical to the top in the Boot Order box.
    • Install Ubuntu (use the same credentials as for the first Ubuntu VM). When the installation completes, power the VM on and login.

  • Generate a SSH public key on your build machine if you hadn't done so in the past.
    Login to the build machine and run the following command:

    Code Block
    languagetext
    build:~$ ssh-keygen -t rsa

    The default options and no password are fine for this tutorial.

  • Verify connectivity. From the build machine you should be able to SSH to the onos-scratch VM using the IP address assigned to eth1:

    Code Block
    languagetext
    build:~$ ssh -l sdn 192.168.56.101

    If the ssh connection failed make sure that the openssh-server is installed by running:

    Code Block
    languagetext
    $ sudo apt-get install openssh-server

    Check that you can ping the onos-scratch VM by IP from the build machine and reverse, for example:

    Code Block
    languagetext
    sdn@build:~$ ping 192.168.56.101

    Close the ssh connection to the onos-scratch VM by typing exit.

...

2. Install required software

On the build machine

 


Install Git:

Code Block
languagetext
build:~$ sudo apt-get install git-core
Excerpt

Install Karaf, Maven:

Create two directories called ~/Downloads and ~/Applications. Download the Karaf 3.0.5 and Maven 3.3.9 binaries (the tar.gz versions of both) into ~/Downloads and extract it to ~/Applications. Keep the tar archives in ~/Downloads; we'll need that later.

Code Block
languagetext
build:~$ cd; mkdir Downloads Applications
build:~$ cd Downloads
build:~$ wget http://archive.apache.org/dist/karaf/3.0.5/apache-karaf-3.0.5.tar.gz
build:~$ wget http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
build:~$ tar -zxvf apache-karaf-3.0.5.tar.gz -C ../Applications/
build:~$ tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ../Applications/ 

Next, install Oracle Java 8:

Code Block
languagetext
build:~$ sudo apt-get install software-properties-common -y
build:~$ sudo add-apt-repository ppa:webupd8team/java -y
build:~$ sudo apt-get update
build:~$ sudo apt-get install oracle-java8-installer oracle-java8-set-default -y

It will ask you to acknowledge the license; do so when prompted.
The second step above may prompt for the installation of python-software-properties. If prompted, do so.

Clone the ONOS source:

Now let’s copy a repository into a new onos directory under the home directory on the build machine.

...

This will create a directory called onos, with the source code in it.

 


On the onos-scratch VM

The VM only requires Java 8 - follow the instructions for Java 8 above performed on the build VM.

...

3. Set up your build environment

Environment variables

First off, you will need to export several environment variables. The ONOS source comes with a sample bash_profile that can set these variables for you. 

...

Code Block
languagetext
sdn@build:~$ nano . ~/.bashrc

Add the line below at the end of the file:

...

Once you run the above command, you will see in the output of the env that  command that several new variables, such as ONOS_ROOT, OCI, and KARAF_ROOT, have been set.

...

If previous version of ONOS is running, the service should be stopped (sudo service onos stop) before building with mvn. Otherwise, the test on onlab.nio package would fail with "address already in use" error.

...

4. Create a custom cell definition

A quick intro to cells

Under ONOS terminology, a cell is a collection of environment variables that are used:

...

See vicell -h for the list of options.

...

5. Package and deploy ONOS

Passwordless VM access

For convenience, before we can deploy anything to our VM, we will configure paswordless login to the VM from our build machine with onos-push-keys:

...

Code Block
languagetext
build:~$ onos-package
-rw-rw-r--  1 onosuser  onosuser  33395409 Dec  4 16:12 /tmp/onos-1.25.01.onosuser.tar.gz

This creates a tar archive in /tmp .

...

Code Block
languagetext
onos> apps
  id=1, name=-a -s
*   6 org.onosproject.bgprouter, version=1.2.0 ...
  id=2, name=org.onosproject.config, version=1.2.0 ...
  id=3, name=org.onosproject.demo, version=1.2.0 ...
* id=4, name=org.onosproject.drivers, version=1.2.0 ...
  id=5, name=org.onosproject.election, version=1.2.0 ...
* id=6, name=org.onosproject.fwd, version=1.2.0 ...
  id=7, name=org.onosproject.intentperf, version=1.2.0 ...
  id=8, name=org.onosproject.metrics, version=1.2.0 ...
* id=9, name=org.onosproject.mobility, version=1.2.0 ...
  id=10, name=org.onosproject.null, version=1.2.0 ...
* id=11, name=org.onosproject.openflow, version=1.2.0 ...
  id=12, name=org.onosproject.optical, version=1.2.0 ...
* id=13, name=org.onosproject.proxyarp, version=1.2.0 ...
  id=14, name=org.onosproject.routing, version=1.2.0 ...
  id=15, name=org.onosproject.sdnip, version=1.2.0 ...
  id=16, name=org.onosproject.segmentrouting, version=1.2.0 ...drivers              1.5.1.SNAPSHOT Default device drivers
*  35 org.onosproject.hostprovider         1.5.1.SNAPSHOT ONOS host location provider.
*  50 org.onosproject.sdnip                1.5.1.SNAPSHOT SDN-IP peering application
*  56 org.onosproject.lldpprovider         1.5.1.SNAPSHOT ONOS LLDP link provider.
*  78 org.onosproject.openflow-base        1.5.1.SNAPSHOT OpenFlow protocol southbound providers
*  82 org.onosproject.openflow             1.5.1.SNAPSHOT OpenFlow southbound meta application
*  94 org.onosproject.proxyarp             1.5.1.SNAPSHOT Proxy ARP/NDP application.
onos>

Note that there will be many more modules than you have configured - these are part of the ONOS OpenFlow and core components. Refer to Appendix C : Source Tree Organization to see descriptions of the modules.

...

Return To : Tutorials and Walkthroughs

...

...