blob: bdbc5a9367dbd04ad70883b2a0f35bc416e00f7f [file] [log] [blame]
Mark McClainb05c8762013-07-06 23:29:39 -04001# Neutron Open vSwitch plugin
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09002# ---------------------------
3
4# Save trace setting
Dean Troyer8d55be32013-02-07 17:16:35 -06005MY_XTRACE=$(set +o | grep xtrace)
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09006set +o xtrace
7
Mark McClainb05c8762013-07-06 23:29:39 -04008source $TOP_DIR/lib/neutron_plugins/openvswitch_agent
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09009
Ian Wienandaee18c72014-02-21 15:35:08 +110010function neutron_plugin_configure_common {
Mark McClainb05c8762013-07-06 23:29:39 -040011 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/openvswitch
12 Q_PLUGIN_CONF_FILENAME=ovs_neutron_plugin.ini
13 Q_DB_NAME="ovs_neutron"
14 Q_PLUGIN_CLASS="neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2"
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090015}
16
Ian Wienandaee18c72014-02-21 15:35:08 +110017function neutron_plugin_configure_service {
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090018 if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000019 iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type gre
20 iniset /$Q_PLUGIN_CONF_FILE ovs tunnel_id_ranges $TENANT_TUNNEL_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090021 elif [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000022 iniset /$Q_PLUGIN_CONF_FILE ovs tenant_network_type vlan
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090023 else
24 echo "WARNING - The openvswitch plugin is using local tenant networks, with no connectivity between hosts."
25 fi
26
27 # Override ``OVS_VLAN_RANGES`` and ``OVS_BRIDGE_MAPPINGS`` in ``localrc``
28 # for more complex physical network configurations.
29 if [[ "$OVS_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
30 OVS_VLAN_RANGES=$PHYSICAL_NETWORK
31 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
32 OVS_VLAN_RANGES=$OVS_VLAN_RANGES:$TENANT_VLAN_RANGE
33 fi
34 fi
35 if [[ "$OVS_VLAN_RANGES" != "" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000036 iniset /$Q_PLUGIN_CONF_FILE ovs network_vlan_ranges $OVS_VLAN_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090037 fi
38
39 # Enable tunnel networks if selected
40 if [[ $OVS_ENABLE_TUNNELING = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000041 iniset /$Q_PLUGIN_CONF_FILE ovs enable_tunneling True
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090042 fi
Jiajun Liue6f2ee52013-05-14 09:48:15 +000043
Mark McClainb05c8762013-07-06 23:29:39 -040044 _neutron_ovs_base_configure_firewall_driver
Kyle Mesteryebfac642013-05-17 15:20:56 -050045
46 # Define extra "OVS" configuration options when q-svc is configured by defining
47 # the array ``Q_SRV_EXTRA_OPTS``.
48 # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
49 for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
50 # Replace the first '=' with ' ' for iniset syntax
Gary Kottond42634f2013-06-24 09:26:55 +000051 iniset /$Q_PLUGIN_CONF_FILE ovs ${I/=/ }
Kyle Mesteryebfac642013-05-17 15:20:56 -050052 done
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090053}
54
Ian Wienandaee18c72014-02-21 15:35:08 +110055function has_neutron_plugin_security_group {
Akihiro MOTOKI3452f8e2013-03-21 14:11:27 +090056 return 0
57}
58
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090059# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060060$MY_XTRACE