4 **Prerequisites**: OpenDaylight requires Java 1.7.0.
6 * On the control host, `Download
7 the latest OpenDaylight release <ODL_Downloads_>`_ (at the time of writing,
9 * Uncompress it as root, and start OpenDaylight (you can start OpenDaylight
10 by running karaf directly, but exiting from the shell will shut it down):
14 tar xvfz distribution-karaf-0.5.0-Boron.tar.gz
15 cd distribution-karaf-0.5.0-Boron
16 ./bin/start # Start OpenDaylight as a server process
18 * Connect to the Karaf shell, and install the odl-ovsdb-openstack bundle,
19 dlux and their dependencies:
23 ./bin/client # Connect to OpenDaylight with the client
24 opendaylight-user@root> 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 odl-dlux-core
26 * If everything is installed correctly, you should now be able to log in to
27 the dlux interface on http://$CONTROL_HOST:8181/dlux/index.html - the
28 default username and password is "admin/admin" (see screenshot below)
30 .. figure:: images/dlux-default.png
32 Ensuring OpenStack network state is clean
33 -----------------------------------------
35 When using OpenDaylight as the Neutron back-end, ODL expects to be the only
36 source of truth for Open vSwitch configuration. Because of this, it is
37 necessary to remove existing OpenStack and Open vSwitch configurations to
38 give OpenDaylight a clean slate.
45 nova delete <instance names>
47 * Remove link from subnets to routers
53 neutron router-port-list <router name>
54 neutron router-interface-delete <router name> <subnet ID or name>
56 * Delete subnets, nets, routers
60 neutron subnet-delete <subnet name>
62 neutron net-delete <net name>
63 neutron router-delete <router name>
65 * Check that all ports have been cleared - at this point, this should be an
73 Ensure Neutron is stopped
74 -------------------------
76 While Neutron is managing the OVS instances on compute and control nodes,
77 OpenDaylight and Neutron can be in conflict. To prevent issues, we turn off
78 Neutron server on the network controller, and Neutron's Open vSwitch agents
81 * Turn off neutron-server on control node
85 systemctl stop neutron-server
87 * On each node in the cluster, shut down and disable Neutron's agent services to ensure that they do not restart after a reboot:
91 systemctl stop neutron-openvswitch-agent
92 systemctl disable neutron-openvswitch-agent
95 Configuring Open vSwitch to be managed by OpenDaylight
96 ------------------------------------------------------
98 On each host (both compute and control nodes) we will clear the pre-existing
99 Open vSwitch config and set OpenDaylight to manage the switch:
101 * Stop the Open vSwitch service, and clear existing OVSDB (ODL expects to
102 manage vSwitches completely)
106 systemctl stop openvswitch
107 rm -rf /var/log/openvswitch/*
108 rm -rf /etc/openvswitch/conf.db
109 systemctl start openvswitch
111 * At this stage, your Open vSwitch configuration should be empty:
115 [root@dneary-odl-compute2 ~]# ovs-vsctl show
116 9f3b38cb-eefc-4bc7-828b-084b1f66fbfd
119 * Set OpenDaylight as the manager on all nodes
123 ovs-vsctl set-manager tcp:${CONTROL_HOST}:6640
126 * You should now see a new section in your Open vSwitch configuration
127 showing that you are connected to the OpenDaylight server, and OpenDaylight
128 will automatically create a br-int bridge:
132 [root@dneary-odl-compute2 ~]# ovs-vsctl show
133 9f3b38cb-eefc-4bc7-828b-084b1f66fbfd
134 Manager "tcp:172.16.21.56:6640"
137 Controller "tcp:172.16.21.56:6633"
144 * (BUG WORKAROUND) If SELinux is enabled, you may not have a security
145 context in place which allows Open vSwitch remote administration. If you
146 do not see the result above (specifically, if you do not see
147 "is_connected: true" in the Manager section), set SELinux to Permissive
148 mode on all nodes and ensure it stays that way after boot:
153 sed -i -e 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
155 * Make sure all nodes, including the control node, are connected to
157 * If you reload DLUX, you should now see that all of your Open vSwitch nodes
158 are now connected to OpenDaylight
160 .. figure:: images/dlux-with-switches.png
162 * If something has gone wrong, check ``data/log/karaf.log`` under
163 the OpenDaylight distribution directory. If you do not see any interesting
164 log entries, set logging for OVSDB to TRACE level inside Karaf and try again:
171 Configuring Neutron to use OpenDaylight
172 ---------------------------------------
174 Once you have configured the vSwitches to connect to OpenDaylight, you can
175 now ensure that OpenStack Neutron is using OpenDaylight.
177 First, ensure that port 8080 (which will be used by OpenDaylight to listen
178 for REST calls) is available. By default, swift-proxy-service listens on the
179 same port, and you may need to move it (to another port or another host), or
180 disable that service. I moved it to port 8081 by editing
181 ``/etc/swift/proxy-server.conf`` and
182 ``/etc/cinder/cinder.conf``, modifying iptables appropriately, and
183 restarting swift-proxy-service and OpenDaylight.
185 * Configure Neutron to use OpenDaylight's ML2 driver:
189 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers opendaylight
190 crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
192 cat <<EOT>> /etc/neutron/plugins/ml2/ml2_conf.ini
196 url = http://${CONTROL_HOST}:8080/controller/nb/v2/neutron
199 * Reset Neutron's ML2 database
203 mysql -e "drop database if exists neutron_ml2;"
204 mysql -e "create database neutron_ml2 character set utf8;"
205 mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"
206 neutron-db-manage --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf \
207 --config-file /etc/neutron/plugin.ini upgrade head
209 * Restart neutron-server:
213 systemctl start neutron-server
219 * Verify that OpenDaylight's ML2 interface is working:
223 curl -u admin:admin http://${CONTROL_HOST}:8080/controller/nb/v2/neutron/networks
229 If this does not work or gives an error, check Neutron's log file in
230 ``/var/log/neutron/server.log``. Error messages here should give
231 some clue as to what the problem is in the connection with OpenDaylight
233 * Create a net, subnet, router, connect ports, and start an instance using
238 neutron router-create router1
239 neutron net-create private
240 neutron subnet-create private --name=private_subnet 10.10.5.0/24
241 neutron router-interface-add router1 private_subnet
242 nova boot --flavor <flavor> --image <image id> --nic net-id=<network id> test1
243 nova boot --flavor <flavor> --image <image id> --nic net-id=<network id> test2
245 At this point, you have confirmed that OpenDaylight is creating network
246 end-points for instances on your network and managing traffic to them.
248 Congratulations! You're done!
251 .. _ODL_Downloads: https://www.opendaylight.org/software/downloads