| Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 1 | # Quantum Linux Bridge plugin | 
|  | 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 |  | 
|  | 8 | function is_quantum_ovs_base_plugin() { | 
|  | 9 | # linuxbridge doesn't use OVS | 
|  | 10 | return 1 | 
|  | 11 | } | 
|  | 12 |  | 
|  | 13 | function quantum_plugin_create_nova_conf() { | 
|  | 14 | NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver"} | 
|  | 15 | } | 
|  | 16 |  | 
|  | 17 | function quantum_plugin_install_agent_packages() { | 
|  | 18 | install_package bridge-utils | 
|  | 19 | } | 
|  | 20 |  | 
|  | 21 | function quantum_plugin_configure_common() { | 
|  | 22 | Q_PLUGIN_CONF_PATH=etc/quantum/plugins/linuxbridge | 
|  | 23 | Q_PLUGIN_CONF_FILENAME=linuxbridge_conf.ini | 
|  | 24 | Q_DB_NAME="quantum_linux_bridge" | 
|  | 25 | Q_PLUGIN_CLASS="quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2" | 
|  | 26 | } | 
|  | 27 |  | 
|  | 28 | function quantum_plugin_configure_debug_command() { | 
|  | 29 | iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge | 
|  | 30 | } | 
|  | 31 |  | 
|  | 32 | function quantum_plugin_configure_dhcp_agent() { | 
|  | 33 | : | 
|  | 34 | } | 
|  | 35 |  | 
|  | 36 | function quantum_plugin_configure_l3_agent() { | 
|  | 37 | iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge | 
|  | 38 | } | 
|  | 39 |  | 
|  | 40 | function quantum_plugin_configure_plugin_agent() { | 
|  | 41 | # Setup physical network interface mappings.  Override | 
|  | 42 | # ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more | 
|  | 43 | # complex physical network configurations. | 
|  | 44 | if [[ "$LB_INTERFACE_MAPPINGS" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$LB_PHYSICAL_INTERFACE" != "" ]]; then | 
|  | 45 | LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE | 
|  | 46 | fi | 
|  | 47 | if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then | 
|  | 48 | iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS | 
|  | 49 | fi | 
|  | 50 | AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent" | 
|  | 51 | } | 
|  | 52 |  | 
|  | 53 | function quantum_plugin_configure_service() { | 
|  | 54 | if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then | 
|  | 55 | iniset /$Q_PLUGIN_CONF_FILE VLANS tenant_network_type vlan | 
|  | 56 | else | 
|  | 57 | echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts." | 
|  | 58 | fi | 
|  | 59 |  | 
|  | 60 | # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` | 
|  | 61 | # for more complex physical network configurations. | 
|  | 62 | if [[ "$LB_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then | 
|  | 63 | LB_VLAN_RANGES=$PHYSICAL_NETWORK | 
|  | 64 | if [[ "$TENANT_VLAN_RANGE" != "" ]]; then | 
|  | 65 | LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE | 
|  | 66 | fi | 
|  | 67 | fi | 
|  | 68 | if [[ "$LB_VLAN_RANGES" != "" ]]; then | 
|  | 69 | iniset /$Q_PLUGIN_CONF_FILE VLANS network_vlan_ranges $LB_VLAN_RANGES | 
|  | 70 | fi | 
|  | 71 | } | 
|  | 72 |  | 
|  | 73 | function quantum_plugin_setup_interface_driver() { | 
|  | 74 | local conf_file=$1 | 
|  | 75 | iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver | 
|  | 76 | } | 
|  | 77 |  | 
|  | 78 | # Restore xtrace | 
| Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 79 | $MY_XTRACE |