blob: 11bc585fe92f3f270260625118d8a354de9c6d50 [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() {
Gary Kotton4d8c5b02013-03-07 12:54:34 +000014 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090015}
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() {
Akihiro MOTOKI09d61852013-03-03 01:24:45 +090033 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager quantum.agent.dhcp_agent.DhcpAgentWithStateReport
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090034}
35
36function quantum_plugin_configure_l3_agent() {
37 iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
Akihiro MOTOKI09d61852013-03-03 01:24:45 +090038 iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager quantum.agent.l3_agent.L3NATAgentWithStateReport
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090039}
40
41function quantum_plugin_configure_plugin_agent() {
42 # Setup physical network interface mappings. Override
43 # ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc`` for more
44 # complex physical network configurations.
45 if [[ "$LB_INTERFACE_MAPPINGS" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$LB_PHYSICAL_INTERFACE" != "" ]]; then
46 LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE
47 fi
48 if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then
49 iniset /$Q_PLUGIN_CONF_FILE LINUX_BRIDGE physical_interface_mappings $LB_INTERFACE_MAPPINGS
50 fi
51 AGENT_BINARY="$QUANTUM_DIR/bin/quantum-linuxbridge-agent"
52}
53
54function quantum_plugin_configure_service() {
55 if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
56 iniset /$Q_PLUGIN_CONF_FILE VLANS tenant_network_type vlan
57 else
58 echo "WARNING - The linuxbridge plugin is using local tenant networks, with no connectivity between hosts."
59 fi
60
61 # Override ``LB_VLAN_RANGES`` and ``LB_INTERFACE_MAPPINGS`` in ``localrc``
62 # for more complex physical network configurations.
63 if [[ "$LB_VLAN_RANGES" = "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]]; then
64 LB_VLAN_RANGES=$PHYSICAL_NETWORK
65 if [[ "$TENANT_VLAN_RANGE" != "" ]]; then
66 LB_VLAN_RANGES=$LB_VLAN_RANGES:$TENANT_VLAN_RANGE
67 fi
68 fi
69 if [[ "$LB_VLAN_RANGES" != "" ]]; then
70 iniset /$Q_PLUGIN_CONF_FILE VLANS network_vlan_ranges $LB_VLAN_RANGES
71 fi
72}
73
74function quantum_plugin_setup_interface_driver() {
75 local conf_file=$1
76 iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
77}
78
79# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060080$MY_XTRACE