blob: d3f5bd5752ccd0267548c771cd2bca2b582f910c [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
melissaml5ed05392018-09-20 10:45:10 +08003# Neutron Big Switch/FloodLight plugin
Mark McClainb05c8762013-07-06 23:29:39 -04004# ------------------------------------
5
6# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +11007_XTRACE_NEUTRON_BIGSWITCH=$(set +o | grep xtrace)
Mark McClainb05c8762013-07-06 23:29:39 -04008set +o xtrace
9
10source $TOP_DIR/lib/neutron_plugins/ovs_base
11source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight # for third party service specific configuration values
12
Ian Wienandaee18c72014-02-21 15:35:08 +110013function neutron_plugin_create_nova_conf {
Aaron Rosen4540d002013-10-24 13:59:33 -070014 :
Mark McClainb05c8762013-07-06 23:29:39 -040015}
16
Ian Wienandaee18c72014-02-21 15:35:08 +110017function neutron_plugin_install_agent_packages {
Mark McClainb05c8762013-07-06 23:29:39 -040018 _neutron_ovs_base_install_agent_packages
19}
20
Ian Wienandaee18c72014-02-21 15:35:08 +110021function neutron_plugin_configure_common {
Mark McClainb05c8762013-07-06 23:29:39 -040022 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch
23 Q_PLUGIN_CONF_FILENAME=restproxy.ini
Mark McClainb05c8762013-07-06 23:29:39 -040024 Q_PLUGIN_CLASS="neutron.plugins.bigswitch.plugin.NeutronRestProxyV2"
25 BS_FL_CONTROLLERS_PORT=${BS_FL_CONTROLLERS_PORT:-localhost:80}
26 BS_FL_CONTROLLER_TIMEOUT=${BS_FL_CONTROLLER_TIMEOUT:-10}
27}
28
Ian Wienandaee18c72014-02-21 15:35:08 +110029function neutron_plugin_configure_dhcp_agent {
Mark McClainb05c8762013-07-06 23:29:39 -040030 :
31}
32
Ian Wienandaee18c72014-02-21 15:35:08 +110033function neutron_plugin_configure_l3_agent {
Mark McClainb05c8762013-07-06 23:29:39 -040034 _neutron_ovs_base_configure_l3_agent
35}
36
Ian Wienandaee18c72014-02-21 15:35:08 +110037function neutron_plugin_configure_plugin_agent {
Kevin Benton753afeb2014-02-13 17:17:30 -080038 # Set up integration bridge
39 _neutron_ovs_base_setup_bridge $OVS_BRIDGE
40 iniset /$Q_PLUGIN_CONF_FILE restproxyagent integration_bridge $OVS_BRIDGE
41 AGENT_BINARY="$NEUTRON_DIR/neutron/plugins/bigswitch/agent/restproxy_agent.py"
42
43 _neutron_ovs_base_configure_firewall_driver
Mark McClainb05c8762013-07-06 23:29:39 -040044}
45
Ian Wienandaee18c72014-02-21 15:35:08 +110046function neutron_plugin_configure_service {
Mark McClainb05c8762013-07-06 23:29:39 -040047 iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT
48 iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT
Sean Dague16dd8b32014-02-03 09:10:54 +090049 if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
Mark McClainb05c8762013-07-06 23:29:39 -040050 iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs
51 fi
52}
53
Ian Wienandaee18c72014-02-21 15:35:08 +110054function neutron_plugin_setup_interface_driver {
Mark McClainb05c8762013-07-06 23:29:39 -040055 local conf_file=$1
Sean Dague16dd8b32014-02-03 09:10:54 +090056 if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then
Martin Hickeydca49de2015-10-20 12:13:19 +010057 iniset $conf_file DEFAULT interface_driver ivs
Mark McClainb05c8762013-07-06 23:29:39 -040058 else
Martin Hickeydca49de2015-10-20 12:13:19 +010059 iniset $conf_file DEFAULT interface_driver openvswitch
Mark McClainb05c8762013-07-06 23:29:39 -040060 fi
61}
62
63
Ian Wienandaee18c72014-02-21 15:35:08 +110064function has_neutron_plugin_security_group {
Mark McClainb05c8762013-07-06 23:29:39 -040065 # 1 means False here
Kevin Benton753afeb2014-02-13 17:17:30 -080066 return 0
Mark McClainb05c8762013-07-06 23:29:39 -040067}
68
Ian Wienandaee18c72014-02-21 15:35:08 +110069function neutron_plugin_check_adv_test_requirements {
Mark McClainb05c8762013-07-06 23:29:39 -040070 is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
71}
72
73# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110074$_XTRACE_NEUTRON_BIGSWITCH