blob: 989b930005c345f9dc4ea509e165fad06684d36e [file] [log] [blame]
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09001# Quantum Linux Bridge plugin
2# ---------------------------
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
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09008function quantum_plugin_configure_common() {
9 Q_PLUGIN_CONF_PATH=etc/quantum/plugins/linuxbridge
10 Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini
11 Q_DB_NAME="quantum_linux_bridge"
12 Q_PLUGIN_CLASS="quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2"
13}
14
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090015function quantum_plugin_configure_service() {
16 if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000017 iniset /$Q_PLUGIN_CONF_FILE vlans tenant_network_type vlan
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090018 else
19 echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
20 fi
21
22 # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc``
23 # for more complex physical network configurations.
24 if [[ "$LB_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
25 LB_VLAN_RANGES=$PHYSICAL_NETWORK
26 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
27 LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE
28 fi
29 fi
30 if [[ "$LB_VLAN_RANGES" != "" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000031 iniset /$Q_PLUGIN_CONF_FILE vlans network_vlan_ranges $LB_VLAN_RANGES
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090032 fi
Jiajun Liue6f2ee52013-05-14 09:48:15 +000033 if [[ "$Q_USE_SECGROUP" == "True" ]]; then
Gary Kottond42634f2013-06-24 09:26:55 +000034 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.linux.iptables_firewall.IptablesFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000035 else
Gary Kottond42634f2013-06-24 09:26:55 +000036 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver quantum.agent.firewall.NoopFirewallDriver
Jiajun Liue6f2ee52013-05-14 09:48:15 +000037 fi
Kyle Mesteryebfac642013-05-17 15:20:56 -050038
39 # Define extra "LINUX_BRIDGE" configuration options when q-svc is configured by defining
40 # the array ``Q_SRV_EXTRA_OPTS``.
41 # For Example: ``Q_SRV_EXTRA_OPTS=(foo=true bar=2)``
42 for I in "${Q_SRV_EXTRA_OPTS[@]}"; do
43 # Replace the first '=' with ' ' for iniset syntax
Gary Kottond42634f2013-06-24 09:26:55 +000044 iniset /$Q_PLUGIN_CONF_FILE linux_bridge ${I/=/ }
Kyle Mesteryebfac642013-05-17 15:20:56 -050045 done
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090046}
47
Akihiro MOTOKI3452f8e2013-03-21 14:11:27 +090048function has_quantum_plugin_security_group() {
49 # 0 means True here
50 return 0
51}
52
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090053# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060054$MY_XTRACE