| Bob Kukura | c9b0f1a | 2013-04-23 16:28:24 -0400 | [diff] [blame] | 1 | # Quantum Open vSwitch plugin | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 2 | # --------------------------- | 
 | 3 |  | 
 | 4 | # Save trace setting | 
| Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 5 | MY_XTRACE=$(set +o | grep xtrace) | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 6 | set +o xtrace | 
 | 7 |  | 
| Bob Kukura | c9b0f1a | 2013-04-23 16:28:24 -0400 | [diff] [blame] | 8 | source $TOP_DIR/lib/quantum_plugins/openvswitch_agent | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 9 |  | 
 | 10 | function quantum_plugin_configure_common() { | 
 | 11 |     Q_PLUGIN_CONF_PATH=etc/quantum/plugins/openvswitch | 
 | 12 |     Q_PLUGIN_CONF_FILENAME=ovs_quantum_plugin.ini | 
 | 13 |     Q_DB_NAME="ovs_quantum" | 
 | 14 |     Q_PLUGIN_CLASS="quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2" | 
 | 15 | } | 
 | 16 |  | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 17 | function quantum_plugin_configure_service() { | 
 | 18 |     if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then | 
 | 19 |         iniset /$Q_PLUGIN_CONF_FILE OVS tenant_network_type gre | 
 | 20 |         iniset /$Q_PLUGIN_CONF_FILE OVS tunnel_id_ranges $TENANT_TUNNEL_RANGES | 
 | 21 |     elif [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then | 
 | 22 |         iniset /$Q_PLUGIN_CONF_FILE OVS tenant_network_type vlan | 
 | 23 |     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 | 
 | 36 |         iniset /$Q_PLUGIN_CONF_FILE OVS network_vlan_ranges $OVS_VLAN_RANGES | 
 | 37 |     fi | 
 | 38 |  | 
 | 39 |     # Enable tunnel networks if selected | 
 | 40 |     if [[ $OVS_ENABLE_TUNNELING = "True" ]]; then | 
 | 41 |         iniset /$Q_PLUGIN_CONF_FILE OVS enable_tunneling True | 
 | 42 |     fi | 
| Jiajun Liu | e6f2ee5 | 2013-05-14 09:48:15 +0000 | [diff] [blame] | 43 |  | 
 | 44 |     _quantum_ovs_base_configure_firewall_driver | 
| Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 45 |  | 
 | 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 | 
 | 51 |         iniset /$Q_PLUGIN_CONF_FILE OVS ${I/=/ } | 
 | 52 |     done | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 53 | } | 
 | 54 |  | 
| Akihiro MOTOKI | 3452f8e | 2013-03-21 14:11:27 +0900 | [diff] [blame] | 55 | function has_quantum_plugin_security_group() { | 
 | 56 |     return 0 | 
 | 57 | } | 
 | 58 |  | 
| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 59 | # Restore xtrace | 
| Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 60 | $MY_XTRACE |