ofagent: Vendor code split

Install networking-ofagent from StackForge, using DevStack's
external plugins mechanism.

The following line needs to be added to the existing local.conf settings:
    enable_plugin networking-ofagent https://git.openstack.org/stackforge/networking-ofagent

Remove neutron_thirdparty/ryu, as Ryu is installed via
networking-ofagent's requirements.

Change-Id: I12287a47eac4689414f70b517ee37fb98b260e60
Partially-implements: blueprint core-vendor-decomposition
Partial-Bug: #1412653
This commit is contained in:
YAMAMOTO Takashi 2015-01-26 13:39:30 +09:00
parent 13c7ccc9d5
commit 183a9c0386
2 changed files with 2 additions and 126 deletions

View File

@ -1,100 +1,4 @@
#!/bin/bash #!/bin/bash
#
# OpenFlow Agent plugin
# ----------------------
# Save trace setting # REVISIT(yamamoto): This file is intentionally left empty
OFA_XTRACE=$(set +o | grep xtrace) # in order to keep Q_AGENT=ofagent_agent work.
set +o xtrace
source $TOP_DIR/lib/neutron_plugins/ovs_base
source $TOP_DIR/lib/neutron_thirdparty/ryu # for RYU_DIR, install_ryu, etc
function neutron_plugin_create_nova_conf {
_neutron_ovs_base_configure_nova_vif_driver
}
function neutron_plugin_install_agent_packages {
_neutron_ovs_base_install_agent_packages
# This agent uses ryu to talk with switches
install_package $(get_packages "ryu")
install_ryu
}
function neutron_plugin_configure_debug_command {
_neutron_ovs_base_configure_debug_command
}
function neutron_plugin_configure_dhcp_agent {
iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_agent_manager neutron.agent.dhcp_agent.DhcpAgentWithStateReport
}
function neutron_plugin_configure_l3_agent {
_neutron_ovs_base_configure_l3_agent
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
function _neutron_ofagent_configure_firewall_driver {
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
else
iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
}
function neutron_plugin_configure_plugin_agent {
# Set up integration bridge
_neutron_ovs_base_setup_bridge $OVS_BRIDGE
_neutron_ofagent_configure_firewall_driver
# Check a supported openflow version
OF_VERSION=`ovs-ofctl --version | grep "OpenFlow versions" | awk '{print $3}' | cut -d':' -f2`
if [ `vercmp_numbers "$OF_VERSION" "0x3"` -lt "0" ]; then
die $LINENO "This agent requires OpenFlow 1.3+ capable switch."
fi
# Enable tunnel networks if selected
if [[ "$OVS_ENABLE_TUNNELING" == "True" ]]; then
# Verify tunnels are supported
# REVISIT - also check kernel module support for GRE and patch ports
OVS_VERSION=`ovs-vsctl --version | head -n 1 | grep -E -o "[0-9]+\.[0-9]+"`
if [ `vercmp_numbers "$OVS_VERSION" "1.4"` -lt "0" ]; then
die $LINENO "You are running OVS version $OVS_VERSION. OVS 1.4+ is required for tunneling between multiple hosts."
fi
iniset /$Q_PLUGIN_CONF_FILE ovs local_ip $TUNNEL_ENDPOINT_IP
fi
# Setup physical network bridge mappings. Override
# ``OVS_VLAN_RANGES`` and ``OVS_BRIDGE_MAPPINGS`` in ``localrc`` for more
# complex physical network configurations.
if [[ "$OVS_BRIDGE_MAPPINGS" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$OVS_PHYSICAL_BRIDGE" != "" ]]; then
OVS_BRIDGE_MAPPINGS=$PHYSICAL_NETWORK:$OVS_PHYSICAL_BRIDGE
# Configure bridge manually with physical interface as port for multi-node
sudo ovs-vsctl --no-wait -- --may-exist add-br $OVS_PHYSICAL_BRIDGE
fi
if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings $OVS_BRIDGE_MAPPINGS
fi
if [[ "$OFAGENT_PHYSICAL_INTERFACE_MAPPINGS" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE agent physical_interface_mappings \
$OFAGENT_PHYSICAL_INTERFACE_MAPPINGS
fi
AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-ofagent-agent"
iniset /$Q_PLUGIN_CONF_FILE agent tunnel_types $Q_TUNNEL_TYPES
}
function neutron_plugin_setup_interface_driver {
local conf_file=$1
iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
iniset $conf_file DEFAULT ovs_use_veth True
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
$OFA_XTRACE

View File

@ -1,28 +0,0 @@
#!/bin/bash
#
# Ryu SDN Framework
# -----------------
# Used by ofagent.
# TODO(yamamoto): Switch to pip_install once the development was settled
# Save trace setting
RYU3_XTRACE=$(set +o | grep xtrace)
set +o xtrace
RYU_DIR=$DEST/ryu
# Make this function idempotent and avoid cloning same repo many times
# with RECLONE=yes
_RYU_INSTALLED=${_RYU_INSTALLED:-False}
function install_ryu {
if [[ "$_RYU_INSTALLED" == "False" ]]; then
git_clone $RYU_REPO $RYU_DIR $RYU_BRANCH
export PYTHONPATH=$RYU_DIR:$PYTHONPATH
pip_install $(cat $RYU_DIR/tools/pip-requires)
_RYU_INSTALLED=True
fi
}
# Restore xtrace
$RYU3_XTRACE