Versions Compared

Key

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

...

I'm using VirtualBox as virtualization environment, but I see no reason why this shouldn't work on VMWare or other hypervisors.

The first step is to create a fresh install of Ubuntu 14.04.2 LTS server edition. Then proceed to install Git, Apache Karaf, Apache Maven, and Oracle Java 8. You can find detailed instructions on how to do that here: ONOS from Scratch#2.Installrequiredsoftware

Next, create a key pair as follows

Code Block
languagebash
ssh-keygen -t rsa

 

complete the first three steps of the ONOS from Scratch tutorial. So only do the VM preparation, install required software, and setup the build environment. Don't bother creating a cell definition, nor packaging and deploying ONOS. This document has new instructions for those steps.

This VM will eventually This VM will host the ONOS instance containers. In the following, we'll first create a single container that is fully configured, and then clone the original as many times as needed.

...

Take a look at the output of lxc-ls again: note the container is now started and, if all has gone well, has received an IP address.

 

Customizing Your Container

You can ssh into the container by using the IP address you just saw; ubuntu is the default login and password.

You want to do two things: enable passwordless sudo for the ubuntu user, and install Java 8.

 

Run sudo visudo and add the following line to the end of the file:

Code Block
ubuntu ALL=(ALL) NOPASSWD:ALL

 

Installing Java is done as follows:

...

languagebash

...

Container Clones

The 

Cell Configuration

Containers are also very convenient since we can automatically obtain their IPs. This is what my cell definition looks like; you want to put this in a file in onos/tools/test/cells/. You definitely want to verify if the ONOS_NIC variable corresponds to your system settings, and also also OCN which  which points to the machine where Mininet is running. Feel free to customize the the ONOS_FEATURES to  to your liking. Finally, you have to reload the cell if you create additional containers, so the new IPs get picked up.

Code Block
languagebash
# LXC-based multi ONOS instance & LINC-OE mininet box
export ONOS_NIC=10.0.3.*
I=1
for CONTAINER in $( sudo lxc-ls ); do
 IP=`sudo lxc-ls --fancy -F ipv4 $CONTAINER | tail -1`
 export OC${I}=${IP}
 let I=I+1
done
export OCI=$OC1
export OCN="192.168.56.9"
export ONOS_FEATURES="webconsole,onos-api,onos-core,onos-cli,onos-openflow,onos-app-fwd,onos-app-optical,onos-gui,onos-rest,onos-app-proxyarp"
export ONOS_USER=ubuntu
export ONOS_GROUP=ubuntu

Customizing Your Container

You want to do three things: enable paswordless login, enable passwordless sudo, and install Java 8.

First, push your public key to the container (make sure you have reloaded your cell definition):

Code Block
languagebash
onos-push-keys $OC1

 

Then ssh into the container as user ubuntu:

Code Block
languagec#
ssh ubuntu@$OC1 

 

Run sudo visudo and add the following line to the end of the file:

Code Block
ubuntu ALL=(ALL) NOPASSWD:ALL

 

Installing Java is done as follows:

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

Finally, log out of the container by pressing Ctrl-d or typing exit.

Container Clones

We're now ready to make as many clones of the original container as you want ONOS instances. Repeat the following steps as many times as you'd like, giving each new container a unique name.

Code Block
languagebash
sudo lxc-clone onos1 onos2
sudo lxc-start -n onos2 -d

Be sure to reload your cell configuration, which will automatically create and assign new $OCx variables.

Additional Steps

Linux Bridge Configuration

...