blob: d1d7382c4ba8a94578daa00ceb651c6b70e3eb20 [file] [log] [blame]
Isaku Yamahata0dd34df2012-12-28 13:15:31 +09001# Quantum Ryu 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
8source $TOP_DIR/lib/quantum_plugins/ovs_base
9source $TOP_DIR/lib/quantum_thirdparty/ryu # for configuration value
10
11function quantum_plugin_create_nova_conf() {
12 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver"}
13 iniset $NOVA_CONF DEFAULT libvirt_ovs_integration_bridge "$OVS_BRIDGE"
14}
15
16function quantum_plugin_install_agent_packages() {
17 _quantum_ovs_base_install_agent_packages
Isaku Yamahata429b39d2013-01-09 18:35:55 +090018
19 # quantum_ryu_agent requires ryu module
Isaku Yamahata2cef6fb2013-02-12 23:05:40 +090020 install_package $(get_packages "ryu")
Isaku Yamahata429b39d2013-01-09 18:35:55 +090021 install_ryu
Isaku Yamahata2cef6fb2013-02-12 23:05:40 +090022 configure_ryu
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090023}
24
25function quantum_plugin_configure_common() {
26 Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ryu
27 Q_PLUGIN_CONF_FILENAME=ryu.ini
28 Q_DB_NAME="ovs_quantum"
29 Q_PLUGIN_CLASS="quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2"
30}
31
32function quantum_plugin_configure_debug_command() {
33 _quantum_ovs_base_configure_debug_command
34 iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
35}
36
37function quantum_plugin_configure_dhcp_agent() {
38 iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
39}
40
41function quantum_plugin_configure_l3_agent() {
42 iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
43 _quantum_ovs_base_configure_l3_agent
44}
45
46function quantum_plugin_configure_plugin_agent() {
47 # Set up integration bridge
48 OVS_BRIDGE=${OVS_BRIDGE:-br-int}
49 _quantum_ovs_base_setup_bridge $OVS_BRIDGE
50 if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
51 sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
52 fi
53 iniset /$Q_PLUGIN_CONF_FILE OVS integration_bridge $OVS_BRIDGE
54 AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/ryu/agent/ryu_quantum_agent.py"
55}
56
57function quantum_plugin_configure_service() {
58 iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
59}
60
61function quantum_plugin_setup_interface_driver() {
62 local conf_file=$1
63 iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
64 iniset $conf_file DEFAULT ovs_use_veth True
65}
66
67# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060068$MY_XTRACE