blob: 2dfd4f705ad23e40d129884f777bb01dd44cbe98 [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
20 install_ryu
Isaku Yamahata0dd34df2012-12-28 13:15:31 +090021}
22
23function quantum_plugin_configure_common() {
24 Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ryu
25 Q_PLUGIN_CONF_FILENAME=ryu.ini
26 Q_DB_NAME="ovs_quantum"
27 Q_PLUGIN_CLASS="quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2"
28}
29
30function quantum_plugin_configure_debug_command() {
31 _quantum_ovs_base_configure_debug_command
32 iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
33}
34
35function quantum_plugin_configure_dhcp_agent() {
36 iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
37}
38
39function quantum_plugin_configure_l3_agent() {
40 iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
41 _quantum_ovs_base_configure_l3_agent
42}
43
44function quantum_plugin_configure_plugin_agent() {
45 # Set up integration bridge
46 OVS_BRIDGE=${OVS_BRIDGE:-br-int}
47 _quantum_ovs_base_setup_bridge $OVS_BRIDGE
48 if [ -n "$RYU_INTERNAL_INTERFACE" ]; then
49 sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE
50 fi
51 iniset /$Q_PLUGIN_CONF_FILE OVS integration_bridge $OVS_BRIDGE
52 AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/ryu/agent/ryu_quantum_agent.py"
53}
54
55function quantum_plugin_configure_service() {
56 iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST:$RYU_API_PORT
57}
58
59function quantum_plugin_setup_interface_driver() {
60 local conf_file=$1
61 iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
62 iniset $conf_file DEFAULT ovs_use_veth True
63}
64
65# Restore xtrace
Dean Troyer8d55be32013-02-07 17:16:35 -060066$MY_XTRACE