From 7a4ae3d24260cc2cd8eaed495829ec44ff121458 Mon Sep 17 00:00:00 2001 From: Akihiro MOTOKI Date: Thu, 10 Oct 2013 00:40:38 +0900 Subject: [PATCH] Modification for Ubuntu 13.10 and minor fixes in Neutron NEC plugin Modifications for Ubuntu 13.10: * Add .conf suffix to apache2 config files. In Ubuntu 13.10, files in sites-available should have ".conf" suffix. Otherwise it is not recognized by a2ensite. * libglib2.0-dev is added to lib/files/apt/trema. Trema is an OpenFlow controler framework used by Neutron NEC plugin Ubuntu package dependency seems to be changed. Minor cleanups are also done in OVS configuration: * Set datapath_id before connecting to the OpenFlow controller to ensure datapath_id changes after connected. Previously datapath_id is changed after connecting to the controller. * Drop "0x" prefix from datapath_id passed to OVS. OVS ignores datapath_id with 0x prefix. * Fix a bug that SKIP_OVS_BRIDGE_SETUP skips all confiugration of the plugin agent. It should skip only OVS setup. Change-Id: Ifac3def8decda577b5740c82fe8d24e8520c7777 --- files/apts/trema | 1 + lib/neutron_plugins/nec | 11 ++++++++--- lib/neutron_thirdparty/trema | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/files/apts/trema b/files/apts/trema index e33ccd3004..09cb7c6794 100644 --- a/files/apts/trema +++ b/files/apts/trema @@ -6,6 +6,7 @@ rubygems1.8 ruby1.8-dev libpcap-dev libsqlite3-dev +libglib2.0-dev # Sliceable Switch sqlite3 diff --git a/lib/neutron_plugins/nec b/lib/neutron_plugins/nec index 3806c32c75..d8d8b7ce7e 100644 --- a/lib/neutron_plugins/nec +++ b/lib/neutron_plugins/nec @@ -55,21 +55,26 @@ function neutron_plugin_configure_l3_agent() { _neutron_ovs_base_configure_l3_agent } -function neutron_plugin_configure_plugin_agent() { +function _quantum_plugin_setup_bridge() { if [[ "$SKIP_OVS_BRIDGE_SETUP" = "True" ]]; then return fi # Set up integration bridge _neutron_ovs_base_setup_bridge $OVS_BRIDGE - sudo ovs-vsctl --no-wait set-controller $OVS_BRIDGE tcp:$OFC_OFP_HOST:$OFC_OFP_PORT # Generate datapath ID from HOST_IP - local dpid=$(printf "0x%07d%03d%03d%03d\n" ${HOST_IP//./ }) + local dpid=$(printf "%07d%03d%03d%03d\n" ${HOST_IP//./ }) sudo ovs-vsctl --no-wait set Bridge $OVS_BRIDGE other-config:datapath-id=$dpid sudo ovs-vsctl --no-wait set-fail-mode $OVS_BRIDGE secure + sudo ovs-vsctl --no-wait set-controller $OVS_BRIDGE tcp:$OFC_OFP_HOST:$OFC_OFP_PORT if [ -n "$OVS_INTERFACE" ]; then sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $OVS_INTERFACE fi _neutron_setup_ovs_tunnels $OVS_BRIDGE +} + +function neutron_plugin_configure_plugin_agent() { + _quantum_plugin_setup_bridge + AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-nec-agent" _neutron_ovs_base_configure_firewall_driver diff --git a/lib/neutron_thirdparty/trema b/lib/neutron_thirdparty/trema index 5b5c4590c3..9efd3f6c39 100644 --- a/lib/neutron_thirdparty/trema +++ b/lib/neutron_thirdparty/trema @@ -28,7 +28,7 @@ TREMA_TMP_DIR=$TREMA_DATA_DIR/trema TREMA_LOG_LEVEL=${TREMA_LOG_LEVEL:-info} TREMA_SS_CONFIG=$TREMA_SS_ETC_DIR/sliceable.conf -TREMA_SS_APACHE_CONFIG=/etc/apache2/sites-available/sliceable_switch +TREMA_SS_APACHE_CONFIG=/etc/apache2/sites-available/sliceable_switch.conf # configure_trema - Set config files, create data dirs, etc function configure_trema() {