blob: 6d5d4e08c2b740ea63ab6a2b2f03c989004a9dee [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
8function is_quantum_ovs_base_plugin() {
9 # linuxbridge doesn't use OVS
10 return 1
11}
12
13function quantum_plugin_create_nova_conf() {
14 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver"}
15}
16
17function quantum_plugin_install_agent_packages() {
18 install_package bridge-utils
19}
20
21function 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
28function quantum_plugin_configure_debug_command() {
29 iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge
30}
31
32function quantum_plugin_configure_dhcp_agent() {
33 :
34}
35
36function quantum_plugin_configure_l3_agent() {
37 iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
38}
39
40function 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
53function 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
73function 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 Troyer8d55be32013-02-07 17:16:35 -060079$MY_XTRACE