blob: 334c227cdbab9ef3abe80f66e753e0eff3bbbd71 [file] [log] [blame]
Mark McClainb05c8762013-07-06 23:29:39 -04001# Neutron Ryu plugin
2# ------------------
3
4# Save trace setting
5MY_XTRACE=$(set +o | grep xtrace)
6set +o xtrace
7
8source $TOP_DIR/lib/neutron_plugins/ovs_base
9source $TOP_DIR/lib/neutron_thirdparty/ryu # for configuration value
10
11function neutron_plugin_create_nova_conf() {
12 _neutron_ovs_base_configure_nova_vif_driver
13 iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
14}
15
16function neutron_plugin_install_agent_packages() {
17 _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
25function neutron_plugin_configure_common() {
26 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
32function neutron_plugin_configure_debug_command() {
33 _neutron_ovs_base_configure_debug_command
34 iniset $NEUTRON_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
35}
36
37function neutron_plugin_configure_dhcp_agent() {
38 iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
39}
40
41function neutron_plugin_configure_l3_agent() {
42 iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
43 _neutron_ovs_base_configure_l3_agent
44}
45
46function neutron_plugin_configure_plugin_agent() {
47 # 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
58function neutron_plugin_configure_service() {
59 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
64function neutron_plugin_setup_interface_driver() {
65 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
70function has_neutron_plugin_security_group() {
71 # 0 means True here
72 return 0
73}
74
75function neutron_plugin_check_adv_test_requirements() {
76 is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
77}
78
79# Restore xtrace
80$MY_XTRACE