In Opendaylight

systems-integration-img

Adoption of OpenSource technologies is in rise and this is very evident from the popularity of projects like Openstack and Opendaylight. While each project tries to address specific
problem, the combination of projects like Openstack and OpenDayLight might be something to look out for.

OpenDaylight started with Hydrogen release and it is now in its 3rd release cycle named Lithium. There are more than 60+ projects available/incubated with OpenDaylight Lithium that could fulfil all the networking necessity around the SDN requirements. There are also some dedicated projects for Openstack that are designed and integrated in Opendaylight.

In this blog, I will walk you through the steps on deploying OpenDaylight and integrating it
with Openstack to address use case specific to networking infrastructure.

1. Assumption

Before getting started, I assume the reader understands Openstack(kilo) and the setup is already done.

2. Install OpenDaylight:

OpenDaylight Controller runs in a JVM. So Install openjdk7 using the below command.

$ apt-get install openjdk-7-jdk

Download the latest OpenDaylight-Lithium package from the official repo.

$ wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/
integration/distribution-karaf/0.3.3-Lithium-SR3/distribution-karaf-0.3.3-Lithium-SR3.tar.gz

Uncompress it as root, and start OpenDaylight using the command below,

$ tar xvfz distribution-karaf-0.3.3-Lithium-SR3.tar.gz
$ cd distribution-karaf-0.3.3-Lithium-SR3/
$ ./bin/start # Start OpenDaylight as a server process and Wait for some time before
running the next command below.

Connect to the Karaf shell,

karaf-shell-img

$ ./bin/client # connecting to the OpenDaylight with the client

Now, you should be in OpenDaylight’s console. Install all the required features.

[email protected]> feature:install odl-base-all odl-aaa-authn odl-restconf odl-nsf-all
odl-adsal-northbound odl-mdsal-apidocs odl-ovsdb-openstack odl-ovsdb-northbound odldlux-
core

#Feature installation may take some time to install.

Once the installation is completed, you can check whether everything is working fine by using
the below curl call.

$ curl -u admin:admin http://<OPENDAYLIGHT SERVER’s IP>:8080/controller/nb/v2/
neutron/networks

The response should be an empty network list if OpenDaylight is working properly.

Also, you should be able to log in to the dlux interface on – the default username and password is “admin/admin”. (see screenshot
below)

Additionally, you can find the log details at the below location,

$ tail -f data/log/karaf.log
$ tail -f logs/web_access_log_2015-12.txt

Now, you are up with the working OpenDaylight-Lithium setup☺ . Let’s get into the
Integration part,

3. Erase all VMs, networks, routers and ports in the Controller
Node

Since, you already have the working OpenStack setup. You may tested for VM provisioning as
sanity test but before integrating the openstack with OpenDaylight you must clean up all the
unwanted data from openstack database. When using OpenDaylight as the Neutron back-end,
ODL expects to be the only source for Open vSwitch configuration. Because of this, it is
necessary to remove existing OpenStack and Open vSwitch configurations to give
OpenDaylight a clean slate.

Following steps will guide you through the cleaning process!

• Delete instances
$ nova list
$ nova delete <instance names>

• Remove link from subnets to routers
$ neutron subnet-list
$ neutron router-list
$ neutron router-port-list <router name>
$ neutron router-interface-delete <router name> <subnet ID or name>

• Delete subnets, nets, routers
$ neutron subnet-delete <subnet name>
$ neutron net-list
$ neutron net-delete <net name>
$ neutron router-delete <router name>

• Check that all ports have been cleared – at this point, this should be an empty list
$ neutron port-list

Stop the neutron-server service:

While Neutron is managing the OVS instances on compute and control nodes, OpenDaylight
and Neutron can be in conflict. To prevent issues, turn off Neutron server on the network
controller, and Neutron’s Open vSwitch agents on all hosts.

$ service neutron-server stop

4. Configure OpenvSwitches in Network and Compute Nodes

The neutron plugin in every node must be removed because only OpenDaylight will be
controlling the openvswitches. So on each host, we will clear the pre-existing Open vSwitch
config and set OpenDaylight to manage the openVswitch.

$ apt-get purge neutron-plugin-openvswitch-agent

$ service openvswitch-switch stop

$ rm -rf /var/log/openvswitch/*
$ rm -rf /etc/openvswitch/conf.db #Clear openvswitch database and start it again.
$ service openvswitch-switch start
$ ovs-vsctl show # This command must return the empty set except OpenVswitch ID and
it’s Version.

5. Connect Openswitch with OpenDaylight:

Use the following commands to make the OpenDaylight to manage the OpenVswitch,

$ ovs-vsctl set Open_vSwitch <OPENVSWITCH ID> other_config={‘local_ip’='<TUNNEL
INTERFACE IP&gt’}

You can get OpenVswitch ID from the return of above command and Tunnel IP from Openstack
IP.

Create the bridge br-ex that is needed for the external network for OpenStack.

$ ovs-vsctl add-br br-ex
$ ovs-vsctl add-port br-ex <INTERFACE NAME OF EXTERNAL NETWORK&gt #commonly eth0 or
p2p1

Execute the below command in all the node which has openVswitch Installed.

$ ovs-vsctl set-manager tcp:<OPENDAYLIGHT MANAGEMENT IP>:6640
$ ovs-vsctl show


The above command shows that you are connected to the OpenDaylight server, and
OpenDaylight will automatically create a br-int bridge.


[[email protected] ~]# ovs-vsctl show
9e3b34cb-fefc-4br4-828s-084b3e55rtfd
Manager “tcp:192.XXX.X.XXX:XXXX”
Is_connected: true
Bridge br-int
Controller “tcp:192.XXX.X.XXX:XXXX”
fail_mode: secure
Port br-int
Interface br-int
ovs_version: “2.1.3”

6. Configure ml2_conf.ini for odl driver

Edit vi /etc/neutron/plugins/ml2/ml2_conf.ini in all the required nodes and modify the
following configuration. And leave the other configurations as it is.


[ml2]

type_drivers = flat,vxlan
tenant_network_types = vxlan
mechanism_drivers = opendaylight

[ml2_odl] password = admin
username = admin
url = http://<OPENDAYLIGHT SERVER’s IP&gt:8080/controller/nb/v2/neutron

7. Configure Neutron Database

Reset the neutron database,


$ mysql -uroot –p

$ drop database neutron;
$ create database neutron;
$ grant all privileges on neutron.* to ‘neutron’@’localhost’ identified by ‘<YOUR NEUTRON
PASSWORD&gt’;
$ grant all privileges on neutron.* to ‘neutron’@’%’ identified by ‘<YOUR NEUTRON
PASSWORD&gt’;
$ exit

$ su -s /bin/sh -c “neutron-db-manage –config-file /etc/neutron/neutron.conf –config-file
etc/neutron/plugins/ml2/ml2_conf.ini upgrade head” neutron

Restart the neutron server:

$ service neutron-server start

8. Install networking_odl python module

IMPORTANT:

At this stage you will get neutron service failed to start message.

Don’t worry, its temporary issue. Since, you have enabled OpenDaylight as a
mechanism_driver but not yet installed the python module for it.

So here we goes… Install networking_odl python module.


$ apt-get install python-pip

$ pip install networking_odl


Now, restart the neutron-server and check its status which should be running without
errors.

9. Verify the integration:

We are almost done with Openstack with OpenDaylight integration.

Now, it’s time to verify it.

Create initial networks in Openstack and check whether the same is reflected in
OpenDaylight.

You could create the network using Openstack horizon dashboard also. Below are the
commands to create the same in CLI.

$ neutron router-create router1
$ neutron net-create private
$ neutron subnet-create private –name=private_subnet 172.0.0.0/24
$ neutron router-interface-add router1 private_subnet
$ nova boot –flavor <flavor> –image <image id> –nic net-id=<network id> vinoth-vm1

Once, the network creation is done. You could see the same networks has been created in
OpenDaylight using the below command.

$ curl -u admin:admin http://${OPENDAYLIGHT’s SERVER}:8080/controller/nb/v2/neutron/
networks

The above command will return the network information which is created in opendaylight
through openstack.

If the integration is done correctly, you should now be able to ping VM

Showing 5 comments
  • vishal
    Reply

    Can you explain a bit more on step 5. this configuration is on all the compute nodes and network node or where ?
    Please can you explain a bit more on the steps.

    thanks

pingbacks / trackbacks

Leave a Comment

Start typing and press Enter to search