Add support for configuring OVS to work with OpenDaylight
This adds support for running OpenDaylight as an OpenStack Neutron plugin
under devstack. This entails downloading the latest version of OpenDaylight,
configuring it, and running it as a service under devstack. This code also
includes pieces which configure Open vSwitch on each devstack node to point
at OpenDaylight as their OpenFlow and OVSDB control interface. This is
required for compute hosts, which will not be running any Neutron software
on them at all. This post-devstack configuration is handled in the extras
directory because of the fact there is no Neutron code running on the compute
hosts themselves.
Closes-bug: #1273917
Change-Id: I696e7c7fe63c835f90c56105775def305a702877
diff --git a/extras.d/80-opendaylight.sh b/extras.d/80-opendaylight.sh
new file mode 100644
index 0000000..cc5c8de
--- /dev/null
+++ b/extras.d/80-opendaylight.sh
@@ -0,0 +1,67 @@
+# opendaylight.sh - DevStack extras script
+
+# Need this first to get the is_***_enabled for ODL
+source $TOP_DIR/lib/opendaylight
+
+if is_service_enabled odl-server; then
+ if [[ "$1" == "source" ]]; then
+ # no-op
+ :
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+ install_opendaylight
+ configure_opendaylight
+ init_opendaylight
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ # This has to start before Neutron
+ start_opendaylight
+ elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
+ # no-op
+ :
+ fi
+
+ if [[ "$1" == "unstack" ]]; then
+ stop_opendaylight
+ cleanup_opendaylight
+ fi
+
+ if [[ "$1" == "clean" ]]; then
+ # no-op
+ :
+ fi
+fi
+
+if is_service_enabled odl-compute; then
+ if [[ "$1" == "source" ]]; then
+ # no-op
+ :
+ elif [[ "$1" == "stack" && "$2" == "install" ]]; then
+ install_opendaylight-compute
+ elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
+ create_nova_conf_neutron
+ elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
+ echo_summary "Initializing OpenDaylight"
+ ODL_LOCAL_IP=${ODL_LOCAL_IP:-$HOST_IP}
+ ODL_MGR_PORT=${ODL_MGR_PORT:-6640}
+ read ovstbl <<< $(sudo ovs-vsctl get Open_vSwitch . _uuid)
+ sudo ovs-vsctl set-manager tcp:$ODL_MGR_IP:$ODL_MGR_PORT
+ sudo ovs-vsctl set Open_vSwitch $ovstbl other_config={"local_ip"="$ODL_LOCAL_IP"}
+ elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
+ # no-op
+ :
+ fi
+
+ if [[ "$1" == "unstack" ]]; then
+ sudo ovs-vsctl del-manager
+ BRIDGES=$(sudo ovs-vsctl list-br)
+ for bridge in $BRIDGES ; do
+ sudo ovs-vsctl del-controller $bridge
+ done
+
+ stop_opendaylight-compute
+ fi
+
+ if [[ "$1" == "clean" ]]; then
+ # no-op
+ :
+ fi
+fi