Prerequsite
Please prepare four VMs or host machines with the following specification.
No | usage | CPU | Memory | Disk |
---|---|---|---|---|
1 | Openstack Controller Node | 2 Core | 4 GB or higher | 20 GB |
2 | Openstack Network Node | 1 Core | 1 GB | 20 GB |
3 | ONOS Controller | 2 Core | 4 GB | 20 GB |
4 | Compute Node | 1 Core | 2 GB or higher | 20 GB |
5 | Compute Node | 1 Core | 2 GB or higher | 20 GB |
Set up Control node
Install git and python-pip on the Openstack Controller node
$ sudo apt-get install -y git $ sudo apt-get install -y python-pip
Install devstack on the Openstack Controller node
$ git clone git://github.com/openstack-dev/devstack.git or if you want to install the specific version of Devstack, $ git clone -b stable/kilo git://github.com/openstack-dev/devstack.git
Creates local.conf file using the following options
[[local|localrc]] HOST_IP=1.1.1.1 SERVICE_HOST=1.1.1.1 RABBIT_HOST=1.1.1.1 DATABASE_HOST=1.1.1.1 Q_HOST=1.1.1.1 ADMIN_PASSWORD=nova DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD SERVICE_TOKEN=$ADMIN_PASSWORD DATABASE_TYPE=mysql # Log SCREEN_LOGDIR=/opt/stack/logs/screen # Images IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img" NOVA_VNC_ENABLED=true VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP VNCSERVER_LISTEN=$HOST_IP NEUTRON_CREATE_INITIAL_NETWORKS=False Q_ML2_PLUGIN_MECHANISM_DRIVERS=onos_ml2 Q_PLUGIN_EXTRA_CONF_PATH=~/networking-onos/etc Q_PLUGIN_EXTRA_CONF_FILES=(conf_onos.ini) ML2_L3_PLUGIN=networking_onos.plugins.l3.driver.ONOSL3Plugin # Services enable_service q-svc disable_service n-net disable_service n-cpu disable_service tempest disable_service c-sch disable_service c-api disable_service c-vol
* The IP address 1.1.1.1 needs to be changed to your host IP address of Openstack controller.
* You can choose a different admin password if you want.
* If you installed the onos ml2 plugin in a different place, you need to change the Q_PLUGIN_EXTRA_CONF_PATH properly.Install onos ml2 plugin
$ git clone https://github.com/openstack/networking-onos.git $ cd networking-onos ~/networking-onos$ sudo python setup.py install
If you find the following error, please install python-setuptools using apt-get.
Traceback (most recent call last): File "setup.py", line 17, in <module> import setuptools ImportError: No module named setuptools
$ sudo apt-get install python-setuptools
Why we need onos-networking plugin ?
onos-networking plugin just forwards (or calls) REST calls from nova to ONOS, and OpenstackSwitching app receives the API calls and returns OK. Main functions to implement the virtual networks are handled in OpenstackSwitching application.
Configure the onos ml2 plugin by editing the conf_onos.ini file in networking-onos/etc folder, which is just created
#Configuration options for ONOS driver [onos] # (StrOpt) ONOS ReST interface URL. This is a mandatory field. url_path = http://ONOS_HOST_IP:8181/onos/openstackswitching # (StrOpt) Username for authentication. This is a mandatory field. username = onos # (StrOpt) Password for authentication. This is a mandatory field. password = rocks
You need to set the proper IP address for ONOS controller in ONOS_HOST_IP
Set up devstack
~/devstack$ ./stack.sh
It would take quite long up to 1 hour depending on the network status and host performance. If it is setup correctly, you will see the following message.
======================== DevStack Components Timed ======================== apt-get-update - 6 secs pip_install - 31 secs apt-get - 3 secs This is your host IP address: 10.40.101.209 This is your host IPv6 address: ::1 Horizon is now available at http://10.40.101.209/dashboard Keystone is serving at http://10.40.101.209:5000/ The default users are: admin and demo The password: nova 2015-12-10 07:32:04.411 | stack.sh completed in 243 seconds.
Please check if you can log in to the Horizon dashboard with the url and login information as below.
Set up Compute node
Install Openvswitch
Even though any version higher than 2.0 would work, but we have tested with 2.3.2.
$ wget http://openvswitch.org/releases/openvswitch-2.3.2.tar.gz $ tar xzvf openvswitch-2.3.2.tar.gz $ cd openvswitch-2.3.2/ ~/openvswitch-2.3.2$ ./configure ~/openvswitch-2.3.2$ make ~/openvswitch-2.3.2$ sudo make install ~/openvswitch-2.3.2$ sudo modprobe openvswitch
You can check if openvswitch is loaded properly
~/openvswitch-2.3.2$ sudo lsmod Module Size Used by openvswitch 71004 0 vxlan 37619 1 openvswitch ip_tunnel 23768 1 vxlan gre 13796 1 openvswitch libcrc32c 12644 1 openvswitch
Set up OVS
Please see the following link for detail, but here are the simple way to set up the OVS.
https://github.com/openvswitch/ovs/blob/master/INSTALL.md~/openvswitch-2.3.2$ mkdir -p /usr/local/etc/openvswitch ~/openvswitch-2.3.2$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema ~/openvswitch-2.3.2$ sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ --private-key=db:Open_vSwitch,SSL,private_key \ --certificate=db:Open_vSwitch,SSL,certificate \ --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ --pidfile --detach ~/openvswitch-2.3.2$ sudo ovs-vsctl --no-wait init ~/openvswitch-2.3.2$ sudo ovs-vswitchd --pidfile --detach
You can check if it is installed correctly
~/openvswitch-2.3.2$ sudo ovs-vsctl --version ovs-vsctl (Open vSwitch) 2.3.2 Compiled Dec 3 2015 14:49:51 DB Schema 7.6.2
Set manager as ptcp:6640 so that ONOS can detect the OVSDB
~/openvswitch-2.3.2$ sudo ovs-vsctl set-manager ptcp:6640
Install devstack on the Compute node
$ git clone git://github.com/openstack-dev/devstack.git
Please use the following local.conf for the compute nodes
[[local|localrc]] HOST_IP=2.2.2.2 SERVICE_HOST=1.1.1.1 RABBIT_HOST=1.1.1.1 DATABASE_HOST=1.1.1.1 Q_HOST=1.1.1.1 ADMIN_PASSWORD=nova DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD SERVICE_TOKEN=$ADMIN_PASSWORD DATABASE_TYPE=mysql #Images IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img" # Log NOVA_VNC_ENABLED=true VNCSERVER_PROXYCLIENT_ADDRESS=$HOST_IP VNCSERVER_LISTEN=$HOST_IP SCREEN_LOGDIR=/opt/stack/logs/screen LIBVIRT_TYPE=qemu # Services ENABLED_SERVICES=n-cpu,neutron
HOST_IP should be the IP address of the compute node host, and Controller node IP address needs to be set for other settings.
- Set up another compute node in the same way.
Set up Gateway node
Instead of Neutron Network Node, SONA implements 'Gateway Node' to process all of requred functions (e.t.c, pnat, floactingIP, ...) based on 'pure' open vSwitch.
For now, in the Falcon release, SONA only supports a single Gateway Node. We will support multiple Gateway's which gives scalability in the Goldeneye release.
Install Openvswitch
Even though any version higher than 2.0 would work, but we have tested with 2.3.2.$ wget http://openvswitch.org/releases/openvswitch-2.3.2.tar.gz $ tar xzvf openvswitch-2.3.2.tar.gz $ cd openvswitch-2.3.2/ ~/openvswitch-2.3.2$ ./configure ~/openvswitch-2.3.2$ make ~/openvswitch-2.3.2$ sudo make install ~/openvswitch-2.3.2$ sudo modprobe openvswitch
You can check if openvswitch is loaded properly
~/openvswitch-2.3.2$ sudo lsmod Module Size Used by openvswitch 71004 0 vxlan 37619 1 openvswitch ip_tunnel 23768 1 vxlan gre 13796 1 openvswitch libcrc32c 12644 1 openvswitch
Set up OVS
Please see the following link for detail, but here are the simple way to set up the OVS.
https://github.com/openvswitch/ovs/blob/master/INSTALL.md~/openvswitch-2.3.2$ mkdir -p /usr/local/etc/openvswitch ~/openvswitch-2.3.2$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema ~/openvswitch-2.3.2$ sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ --remote=db:Open_vSwitch,Open_vSwitch,manager_options \ --private-key=db:Open_vSwitch,SSL,private_key \ --certificate=db:Open_vSwitch,SSL,certificate \ --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \ --pidfile --detach ~/openvswitch-2.3.2$ sudo ovs-vsctl --no-wait init ~/openvswitch-2.3.2$ sudo ovs-vswitchd --pidfile --detach
You can check if it is installed correctly
~/openvswitch-2.3.2$ sudo ovs-vsctl --version ovs-vsctl (Open vSwitch) 2.3.2 Compiled Dec 3 2015 14:49:51 DB Schema 7.6.2
Set manager as ptcp:6640 so that ONOS can detect the OVSDB
~/openvswitch-2.3.2$ sudo ovs-vsctl set-manager ptcp:6640
Add port which is connected to a physical router to br-int bridge
~/openvswitch-2.3.2$ sudo ovs-vsctl add-port br-int eth0
(Optional) If you construct Gateway Node environment using virtualbox and only have an option to use NAT interface for internet connection, don't worry there's the way as follows,
Create virtual ports~/openvswitch-2.3.2$ sudo ip link add dev veth0 type veth peer name veth1 ~/openvswitch-2.3.2$ sudo ip link set dev veth0 up ~/openvswitch-2.3.2$ sudo ip link set dev veth1 up
Create linux bridge~/openvswitch-2.3.2$ sudo ip link add lbr-ex type bridge
Add veth0 port to the br-int in open vSwitch~/openvswitch-2.3.2$ sudo ovs-vsctl add-port br-int veth0
Add veth1 port to the lbr-ex~/openvswitch-2.3.2$ sudo ip link set veth1 master lbr-ex
Add external ip subnet to the lbr-ex. Note that this should be same as your Openstack configuration for external network (172.24.4.1/24 in this example).~/openvswitch-2.3.2$ sudo ip addr add 172.24.4.1/24 dev lbr-ex ~/openvswitch-2.3.2$ sudo ip link set lbr-ex up
Activate ip forward option in linux~/openvswitch-2.3.2$ sudo sysctl net.ipv4.ip_forward=1
Activate MASQUERADE option to NAT interface (eth0 in this example).~/openvswitch-2.3.2$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
It's done. You can check the set up is done appropriatedly.
~/openvswitch-2.3.2$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.24.4.0 0.0.0.0 255.255.255.0 U 0 0 0 lbr-ex ~/openvswitch-2.3.2$ ping -I 172.24.4.1 8.8.8.8 PING 8.8.8.8 (8.8.8.8) from 172.24.4.1 : 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=63 time=38.01 ms
Set up ONOS node
We recommend to follow the link to set up the ONOS node and set up the ONOS development environment : ONOS from Scratch. However, you can also follow the following steps only to set up the ONOS node.
Log into your new VM as sdn and give the user passwordless sudo privileges. Run
sudo visudo
, and add the following line to the end of the file:USER_ID ALL=(ALL) NOPASSWD:ALL
Install Java 8
$ 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
- Set up the public key login either using onos-push-keys or copying your public key of your development host to ONOS node
Bootstrap Compute/Gateway nodes
Using OpenstackNode application, you can initialize OVS in Compute/Gateway nodes as below,
- Makes OVSDB and OpenFlow1.3 connection between ONOS and each node
- Makes Bridge 'br-int' on each node
- Makes port for vxlan tunneling
The application reads node information from network config,
{ "apps" : { "org.onosproject.openstacknode" : { "openstacknode" : { "nodes" : [ { "hostname" : "compute-01", "ovsdbIp" : "192.168.56.112", "ovsdbPort" : "6640", "bridgeId" : "of:0000000000000001", "openstackNodeType" : "COMPUTENODE" }, { "hostname" : "compute-02", "ovsdbIp" : "192.168.56.106", "ovsdbPort" : "6640", "bridgeId" : "of:0000000000000002", "openstackNodeType" : "COMPUTENODE" }, { "hostname" : "network", "ovsdbIp" : "192.168.56.108", "ovsdbPort" : "6640", "bridgeId" : "of:0000000000000003", "openstackNodeType" : "GATEWAYNODE", "gatewayExternalInterfaceName" : "eth1", "gatewayExternalInterfaceMac" : "00:00:00:00:00:10" } ] } } } }
After activating OpenstackNode application with above config, you can see each node is automatically initialized as below,
Welcome to Open Network Operating System (ONOS)! ____ _ ______ ____ / __ \/ |/ / __ \/ __/ / /_/ / / /_/ /\ \ \____/_/|_/\____/___/ Documentation: wiki.onosproject.org Tutorials: tutorials.onosproject.org Mailing lists: lists.onosproject.org Come help out! Find out how at: contribute.onosproject.org Hit '<tab>' for a list of available commands and '[cmd] --help' for help on a specific command. Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown ONOS. onos> app activate org.onosproject.openstacknode onos> mcpark@compute1:~$ sudo ovs-vsctl show 550f58e0-b328-4002-a3e4-54571585ae5c Manager "ptcp:6640" Bridge br-int Controller "tcp:192.168.56.107:6653" fail_mode: secure Port vxlan Interface vxlan type: vxlan options: {key=flow, remote_ip=flow} Port br-int Interface br-int
Note that OpenstackNode application is independent from SONA Application which means that you can activate the application only when you need initialization.