Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
melissaml | 5ed0539 | 2018-09-20 10:45:10 +0800 | [diff] [blame] | 3 | # Neutron Big Switch/FloodLight plugin |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 4 | # ------------------------------------ |
| 5 | |
| 6 | # Save trace setting |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 7 | _XTRACE_NEUTRON_BIGSWITCH=$(set +o | grep xtrace) |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 8 | set +o xtrace |
| 9 | |
| 10 | source $TOP_DIR/lib/neutron_plugins/ovs_base |
| 11 | source $TOP_DIR/lib/neutron_thirdparty/bigswitch_floodlight # for third party service specific configuration values |
| 12 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 13 | function neutron_plugin_create_nova_conf { |
Aaron Rosen | 4540d00 | 2013-10-24 13:59:33 -0700 | [diff] [blame] | 14 | : |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 15 | } |
| 16 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 17 | function neutron_plugin_install_agent_packages { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 18 | _neutron_ovs_base_install_agent_packages |
| 19 | } |
| 20 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 21 | function neutron_plugin_configure_common { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 22 | Q_PLUGIN_CONF_PATH=etc/neutron/plugins/bigswitch |
| 23 | Q_PLUGIN_CONF_FILENAME=restproxy.ini |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 24 | 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 Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 29 | function neutron_plugin_configure_dhcp_agent { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 30 | : |
| 31 | } |
| 32 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 33 | function neutron_plugin_configure_l3_agent { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 34 | _neutron_ovs_base_configure_l3_agent |
| 35 | } |
| 36 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 37 | function neutron_plugin_configure_plugin_agent { |
Kevin Benton | 753afeb | 2014-02-13 17:17:30 -0800 | [diff] [blame] | 38 | # 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 McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 44 | } |
| 45 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 46 | function neutron_plugin_configure_service { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 47 | iniset /$Q_PLUGIN_CONF_FILE restproxy servers $BS_FL_CONTROLLERS_PORT |
| 48 | iniset /$Q_PLUGIN_CONF_FILE restproxy servertimeout $BS_FL_CONTROLLER_TIMEOUT |
Sean Dague | 16dd8b3 | 2014-02-03 09:10:54 +0900 | [diff] [blame] | 49 | if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 50 | iniset /$Q_PLUGIN_CONF_FILE nova vif_type ivs |
| 51 | fi |
| 52 | } |
| 53 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 54 | function neutron_plugin_setup_interface_driver { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 55 | local conf_file=$1 |
Sean Dague | 16dd8b3 | 2014-02-03 09:10:54 +0900 | [diff] [blame] | 56 | if [ "$BS_FL_VIF_DRIVER" = "ivs" ]; then |
Martin Hickey | dca49de | 2015-10-20 12:13:19 +0100 | [diff] [blame] | 57 | iniset $conf_file DEFAULT interface_driver ivs |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 58 | else |
Martin Hickey | dca49de | 2015-10-20 12:13:19 +0100 | [diff] [blame] | 59 | iniset $conf_file DEFAULT interface_driver openvswitch |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 60 | fi |
| 61 | } |
| 62 | |
| 63 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 64 | function has_neutron_plugin_security_group { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 65 | # 1 means False here |
Kevin Benton | 753afeb | 2014-02-13 17:17:30 -0800 | [diff] [blame] | 66 | return 0 |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 67 | } |
| 68 | |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 69 | function neutron_plugin_check_adv_test_requirements { |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 70 | is_service_enabled q-agt && is_service_enabled q-dhcp && return 0 |
| 71 | } |
| 72 | |
| 73 | # Restore xtrace |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 74 | $_XTRACE_NEUTRON_BIGSWITCH |