Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 1 | # Quantum Ryu plugin |
| 2 | # ------------------ |
| 3 | |
| 4 | # Save trace setting |
Dean Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 5 | MY_XTRACE=$(set +o | grep xtrace) |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 6 | set +o xtrace |
| 7 | |
| 8 | source $TOP_DIR/lib/quantum_plugins/ovs_base |
| 9 | source $TOP_DIR/lib/quantum_thirdparty/ryu # for configuration value |
| 10 | |
| 11 | function 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 | |
| 16 | function quantum_plugin_install_agent_packages() { |
| 17 | _quantum_ovs_base_install_agent_packages |
Isaku Yamahata | 429b39d | 2013-01-09 18:35:55 +0900 | [diff] [blame] | 18 | |
| 19 | # quantum_ryu_agent requires ryu module |
Isaku Yamahata | 2cef6fb | 2013-02-12 23:05:40 +0900 | [diff] [blame] | 20 | install_package $(get_packages "ryu") |
Isaku Yamahata | 429b39d | 2013-01-09 18:35:55 +0900 | [diff] [blame] | 21 | install_ryu |
Isaku Yamahata | 2cef6fb | 2013-02-12 23:05:40 +0900 | [diff] [blame] | 22 | configure_ryu |
Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | function 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 | |
| 32 | function 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 | |
| 37 | function quantum_plugin_configure_dhcp_agent() { |
| 38 | iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT |
| 39 | } |
| 40 | |
| 41 | function 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 | |
| 46 | function 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 | |
| 57 | function quantum_plugin_configure_service() { |
| 58 | iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST:$RYU_API_PORT |
| 59 | } |
| 60 | |
| 61 | function 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 Troyer | 8d55be3 | 2013-02-07 17:16:35 -0600 | [diff] [blame] | 68 | $MY_XTRACE |