Isaku Yamahata | 0dd34df | 2012-12-28 13:15:31 +0900 | [diff] [blame] | 1 | # Quantum Ryu plugin |
| 2 | # ------------------ |
| 3 | |
| 4 | # Save trace setting |
| 5 | XTRACE=$(set +o | grep xtrace) |
| 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 |
| 18 | } |
| 19 | |
| 20 | function quantum_plugin_configure_common() { |
| 21 | Q_PLUGIN_CONF_PATH=etc/quantum/plugins/ryu |
| 22 | Q_PLUGIN_CONF_FILENAME=ryu.ini |
| 23 | Q_DB_NAME="ovs_quantum" |
| 24 | Q_PLUGIN_CLASS="quantum.plugins.ryu.ryu_quantum_plugin.RyuQuantumPluginV2" |
| 25 | } |
| 26 | |
| 27 | function quantum_plugin_configure_debug_command() { |
| 28 | _quantum_ovs_base_configure_debug_command |
| 29 | iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT |
| 30 | } |
| 31 | |
| 32 | function quantum_plugin_configure_dhcp_agent() { |
| 33 | iniset $Q_DHCP_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT |
| 34 | } |
| 35 | |
| 36 | function quantum_plugin_configure_l3_agent() { |
| 37 | iniset $Q_L3_CONF_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT |
| 38 | _quantum_ovs_base_configure_l3_agent |
| 39 | } |
| 40 | |
| 41 | function quantum_plugin_configure_plugin_agent() { |
| 42 | # Set up integration bridge |
| 43 | OVS_BRIDGE=${OVS_BRIDGE:-br-int} |
| 44 | _quantum_ovs_base_setup_bridge $OVS_BRIDGE |
| 45 | if [ -n "$RYU_INTERNAL_INTERFACE" ]; then |
| 46 | sudo ovs-vsctl --no-wait -- --may-exist add-port $OVS_BRIDGE $RYU_INTERNAL_INTERFACE |
| 47 | fi |
| 48 | iniset /$Q_PLUGIN_CONF_FILE OVS integration_bridge $OVS_BRIDGE |
| 49 | AGENT_BINARY="$QUANTUM_DIR/quantum/plugins/ryu/agent/ryu_quantum_agent.py" |
| 50 | } |
| 51 | |
| 52 | function quantum_plugin_configure_service() { |
| 53 | iniset /$Q_PLUGIN_CONF_FILE OVS openflow_rest_api $RYU_API_HOST:$RYU_API_PORT |
| 54 | } |
| 55 | |
| 56 | function quantum_plugin_setup_interface_driver() { |
| 57 | local conf_file=$1 |
| 58 | iniset $conf_file DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver |
| 59 | iniset $conf_file DEFAULT ovs_use_veth True |
| 60 | } |
| 61 | |
| 62 | # Restore xtrace |
| 63 | $XTRACE |