From b26a27aef06d12d423a70eec078103aa53216fc5 Mon Sep 17 00:00:00 2001 From: Bob Kukura Date: Mon, 27 Aug 2012 01:53:11 -0400 Subject: [PATCH] Update stack.sh for Quantum openvswitch plugin changes With support for multiple physical networks being added to the Quantum openvswitch plugin via https://review.openstack.org/#/c/11388/, the configuration needed to enable either tunneling or VLANs has changed. See http://wiki.openstack.org/ConfigureOpenvswitch for configuration and usage details. Change-Id: I82ca587e097a0f9612af46f2f89a19ac27c73432 --- stack.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/stack.sh b/stack.sh index 665a366339..6f68646a85 100755 --- a/stack.sh +++ b/stack.sh @@ -1135,14 +1135,19 @@ if is_service_enabled quantum; then sudo sed -i -e "s/^sql_connection =.*$/sql_connection = mysql:\/\/$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST\/$Q_DB_NAME?charset=utf8/g" /$Q_PLUGIN_CONF_FILE OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-True} - if [[ "$Q_PLUGIN" = "openvswitch" && $OVS_ENABLE_TUNNELING = "True" ]]; then + if [[ "$Q_PLUGIN" = "openvswitch" && "$OVS_ENABLE_TUNNELING" = "True" ]]; then OVS_VERSION=`ovs-vsctl --version | head -n 1 | awk '{print $4;}'` if [ $OVS_VERSION \< "1.4" ] && ! is_service_enabled q-svc ; then echo "You are running OVS version $OVS_VERSION." echo "OVS 1.4+ is required for tunneling between multiple hosts." exit 1 fi - sudo sed -i -e "s/.*enable_tunneling = .*$/enable_tunneling = $OVS_ENABLE_TUNNELING/g" /$Q_PLUGIN_CONF_FILE + if [[ "$OVS_DEFAULT_BRIDGE" = "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE OVS network_vlan_ranges "" + else + iniset /$Q_PLUGIN_CONF_FILE OVS network_vlan_ranges default + fi + iniset /$Q_PLUGIN_CONF_FILE OVS tunnel_id_ranges 1:1000 fi Q_CONF_FILE=/etc/quantum/quantum.conf @@ -1189,7 +1194,19 @@ if is_service_enabled q-agt; then sudo ovs-vsctl --no-wait -- --if-exists del-br $OVS_BRIDGE sudo ovs-vsctl --no-wait add-br $OVS_BRIDGE sudo ovs-vsctl --no-wait br-set-external-id $OVS_BRIDGE bridge-id br-int - sudo sed -i -e "s/.*local_ip = .*/local_ip = $HOST_IP/g" /$Q_PLUGIN_CONF_FILE + if [[ "$OVS_ENABLE_TUNNELING" == "True" ]]; then + iniset /$Q_PLUGIN_CONF_FILE OVS local_ip $HOST_IP + else + # Need bridge if not tunneling + OVS_DEFAULT_BRIDGE=${OVS_DEFAULT_BRIDGE:-br-$GUEST_INTERFACE_DEFAULT} + fi + if [[ "$OVS_DEFAULT_BRIDGE" = "" ]]; then + iniset /$Q_PLUGIN_CONF_FILE OVS bridge_mappings "" + else + # Configure bridge manually with physical interface as port for multi-node + sudo ovs-vsctl --no-wait -- --may-exist add-br $OVS_DEFAULT_BRIDGE + iniset /$Q_PLUGIN_CONF_FILE OVS bridge_mappings default:$OVS_DEFAULT_BRIDGE + fi AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py" elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then # Start up the quantum <-> linuxbridge agent