2014-12-05 14:25:28 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2014-10-28 11:49:58 +09:00
|
|
|
# Common code used by cisco and embrane plugins
|
|
|
|
# ---------------------------------------------
|
|
|
|
|
|
|
|
# This module used to be for Open vSwitch monolithic plugin,
|
|
|
|
# which has been removed in Juno.
|
2012-12-28 13:15:31 +09:00
|
|
|
|
|
|
|
# Save trace setting
|
2014-03-28 12:40:56 -05:00
|
|
|
OVS_XTRACE=$(set +o | grep xtrace)
|
2012-12-28 13:15:31 +09:00
|
|
|
set +o xtrace
|
|
|
|
|
2013-07-06 23:29:39 -04:00
|
|
|
source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
|
2012-12-28 13:15:31 +09:00
|
|
|
|
2014-02-21 15:35:08 +11:00
|
|
|
function neutron_plugin_configure_common {
|
2013-07-06 23:29:39 -04:00
|
|
|
Q_PLUGIN_CONF_PATH=etc/neutron/plugins/openvswitch
|
|
|
|
Q_PLUGIN_CONF_FILENAME=ovs_neutron_plugin.ini
|
|
|
|
Q_PLUGIN_CLASS="neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
|
2012-12-28 13:15:31 +09:00
|
|
|
}
|
|
|
|
|
2014-02-21 15:35:08 +11:00
|
|
|
function neutron_plugin_configure_service {
|
2014-04-30 23:50:29 +00:00
|
|
|
if [[ "$ENABLE_TENANT_TUNNELS" == "True" ]]; then
|
2013-06-24 09:26:55 +00:00
|
|
|
iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
|
|
|
|
iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
|
2014-04-30 23:50:29 +00:00
|
|
|
elif [[ "$ENABLE_TENANT_VLANS" == "True" ]]; then
|
2013-06-24 09:26:55 +00:00
|
|
|
iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type vlan
|
2012-12-28 13:15:31 +09:00
|
|
|
else
|
|
|
|
echo "WARNING - The openvswitch plugin is using local tenant networks, with no connectivity between hosts."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Override ``OVS_VLAN_RANGES`` and ``OVS_BRIDGE_MAPPINGS`` in ``localrc``
|
|
|
|
# for more complex physical network configurations.
|
2014-04-30 23:50:29 +00:00
|
|
|
if [[ "$OVS_VLAN_RANGES" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
|
2012-12-28 13:15:31 +09:00
|
|
|
OVS_VLAN_RANGES=$PHYSICAL_NETWORK
|
|
|
|
if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
|
|
|
|
OVS_VLAN_RANGES=$OVS_VLAN_RANGES:$TENANT_VLAN_RANGE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ "$OVS_VLAN_RANGES" != "" ]]; then
|
2013-06-24 09:26:55 +00:00
|
|
|
iniset /$Q_PLUGIN_CONF_FILE ovs network_vlan_ranges $OVS_VLAN_RANGES
|
2012-12-28 13:15:31 +09:00
|
|
|
fi
|
|
|
|
|
2013-07-06 23:29:39 -04:00
|
|
|
_neutron_ovs_base_configure_firewall_driver
|
2013-05-17 15:20:56 -05:00
|
|
|
|
|
|
|
# Define extra "OVS" configuration options when q-svc is configured by defining
|
|
|
|
# the array ``Q_SRV_EXTRA_OPTS``.
|
|
|
|
# For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
|
|
|
|
for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
|
|
|
|
# Replace the first '=' with ' ' for iniset syntax
|
2013-06-24 09:26:55 +00:00
|
|
|
iniset /$Q_PLUGIN_CONF_FILE ovs ${I/=/ }
|
2013-05-17 15:20:56 -05:00
|
|
|
done
|
2012-12-28 13:15:31 +09:00
|
|
|
}
|
|
|
|
|
2014-02-21 15:35:08 +11:00
|
|
|
function has_neutron_plugin_security_group {
|
2013-03-21 14:11:27 +09:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2012-12-28 13:15:31 +09:00
|
|
|
# Restore xtrace
|
2014-03-28 12:40:56 -05:00
|
|
|
$OVS_XTRACE
|