blob: ceb89faf6eea16550711f5516b21fc644a960c7b [file] [log] [blame]
Mark McClainb05c8762013-07-06 23:29:39 -04001# Neutron Ryu plugin
2# ------------------
3
4# Save trace setting
Dean Troyere3a91602014-03-28 12:40:56 -05005RYU_XTRACE=$(set +o | grep xtrace)
Mark McClainb05c8762013-07-06 23:29:39 -04006set +o xtrace
7
8source $TOP_DIR/lib/neutron_plugins/ovs_base
9source $TOP_DIR/lib/neutron_thirdparty/ryu # for configuration value
10
Ian Wienandaee18c72014-02-21 15:35:08 +110011function neutron_plugin_create_nova_conf {
Mark McClainb05c8762013-07-06 23:29:39 -040012 _neutron_ovs_base_configure_nova_vif_driver
13 iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
14}
15
Ian Wienandaee18c72014-02-21 15:35:08 +110016function neutron_plugin_install_agent_packages {
Mark McClainb05c8762013-07-06 23:29:39 -040017 _neutron_ovs_base_install_agent_packages
18
19 # neutron_ryu_agent requires ryu module
20 install_package $(get_packages "ryu")
21 install_ryu
22 configure_ryu
23}
24
Ian Wienandaee18c72014-02-21 15:35:08 +110025function neutron_plugin_configure_common {
Mark McClainb05c8762013-07-06 23:29:39 -040026 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/ryu
27 Q_PLUGIN_CONF_FILENAME=ryu.ini
28 Q_DB_NAME="ovs_neutron"
29 Q_PLUGIN_CLASS="neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2"
30}
31
Ian Wienandaee18c72014-02-21 15:35:08 +110032function neutron_plugin_configure_debug_command {
Mark McClainb05c8762013-07-06 23:29:39 -040033 _neutron_ovs_base_configure_debug_command
34 iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
35}
36
Ian Wienandaee18c72014-02-21 15:35:08 +110037function neutron_plugin_configure_dhcp_agent {
Mark McClainb05c8762013-07-06 23:29:39 -040038 iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
39}
40
Ian Wienandaee18c72014-02-21 15:35:08 +110041function neutron_plugin_configure_l3_agent {
Mark McClainb05c8762013-07-06 23:29:39 -040042 iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
43 _neutron_ovs_base_configure_l3_agent
44}
45
Ian Wienandaee18c72014-02-21 15:35:08 +110046function neutron_plugin_configure_plugin_agent {
Mark McClainb05c8762013-07-06 23:29:39 -040047 # Set up integration bridge
48 _neutron_ovs_base_setup_bridge $OVS_BRIDGE
49 if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
50 sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
51 fi
52 iniset /$Q_PLUGIN_CONF_FILE ovs integration_bridge $OVS_BRIDGE
53 AGENT_BINARY="$NEUTRON_DIR/neutron/plugins/ryu/agent/ryu_neutron_agent.py"
54
55 _neutron_ovs_base_configure_firewall_driver
56}
57
Ian Wienandaee18c72014-02-21 15:35:08 +110058function neutron_plugin_configure_service {
Mark McClainb05c8762013-07-06 23:29:39 -040059 iniset /$Q_PLUGIN_CONF_FILE ovs openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
60
61 _neutron_ovs_base_configure_firewall_driver
62}
63
Ian Wienandaee18c72014-02-21 15:35:08 +110064function neutron_plugin_setup_interface_driver {
Mark McClainb05c8762013-07-06 23:29:39 -040065 local conf_file=$1
66 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
67 iniset $conf_file DEFAULT ovs_use_veth True
68}
69
Ian Wienandaee18c72014-02-21 15:35:08 +110070function has_neutron_plugin_security_group {
Mark McClainb05c8762013-07-06 23:29:39 -040071 # 0 means True here
72 return 0
73}
74
Ian Wienandaee18c72014-02-21 15:35:08 +110075function neutron_plugin_check_adv_test_requirements {
Mark McClainb05c8762013-07-06 23:29:39 -040076 is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
77}
78
79# Restore xtrace
Dean Troyere3a91602014-03-28 12:40:56 -050080$RYU_XTRACE