Skip to content

Configuration OpenStack OFAgent agent

fumihiko kakuma edited this page Jun 27, 2017 · 22 revisions

This page describes how to configure OFAgent agent in Openstack Kilo and later, which uses Ryu as OpenFlow library, with OpenStack. If you are not familiar with OpenStack installation, please refer to OpenStack documentation.

If you use an environments installing from a distribution package, this document may not match your environment. Package maintainers will add some customized patches to original codes. So we don't know about results come from the environment. Please ask questions about them to its maintainer or ML.

Attention

You sholud use OVS agent rather than OFAgent agent, if you begin to use OFAgent agent from now on. OVS agent gained a native interface using Ryu in the Liberty.

The OFAgent agent had been removed in the Neuton cycle, so Mitaka is the last release of OFAgent agent. And it will not be maintained anymore as currently the Mitaka is in the EOL status.

Setup with devstack

localrc

Configure the following keys in addition to a ML2 configuration.

Q_ML2_PLUGIN_MECHANISM_DRIVERS=ofagent,l2population
Q_AGENT=ofagent
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS='flat_networks=\*'
Q_USE_PROVIDERNET_FOR_PUBLIC=True
Q_USE_PUBLIC_VETH=True
PUBLIC_BRIDGE=br-int
PUBLIC_PHYSICAL_NETWORK=public
OFAGENT_PHYSICAL_INTERFACE_MAPPINGS=public:veth-pub-int
enable_plugin networking-ofagent git://git.openstack.org/openstack/networking-ofagent

For example, the following localrc snippet makes devstack configure a VXLAN network.

disable_service n-net tempest
enable_service q-svc q-agt q-dhcp q-l3 q-meta q-metering
VERBOSE=True
VIRT_DRIVER=libvirt
Q_PLUGIN=ml2
Q_AGENT=ofagent
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS='flat_networks=\*'
Q_ML2_PLUGIN_MECHANISM_DRIVERS=ofagent,l2population
Q_USE_PROVIDERNET_FOR_PUBLIC=True
Q_USE_PUBLIC_VETH=True
ENABLE_TENANT_TUNNELS=True
PUBLIC_BRIDGE=br-int
PUBLIC_PHYSICAL_NETWORK=public
OFAGENT_PHYSICAL_INTERFACE_MAPPINGS=public:veth-pub-int
enable_plugin networking-ofagent git://git.openstack.org/openstack/networking-ofagent
DATABASE_PASSWORD=secrete
RABBIT_PASSWORD=secrete
SERVICE_TOKEN=secrete
SERVICE_PASSWORD=secrete
ADMIN_PASSWORD=secrete

Setup without devstack

The OpenFlow Agent agent isn't contained neutron tree since Kilo. So you will need to separately install networking-ofagent.

$ sudo pip install networking-ofagent

Neutron Server Node

/etc/neutron/plugin/ml2/ml2_conf.ini

Configure the following keys in addition to a ML2 configuration.

Specify ofagent and l2population mechanism driver. From Juno, ofagent does not support configuration without l2population.

[ml2]
mechanism_drivers = ofagent,l2population

Compute Node

/etc/neutron/plugin/ml2/ml2_conf.ini

Configure general options.

[agent]
l2_population = True
get_datapath_retry_times = 60

Configure either VXLAN or VLAN.

VXLAN tunneling

[ovs]
local_ip=<physical-net-ip>

[agent]
tunnel_types = vxlan

You must create a bridge preliminarily.

# ovs-vsctl add-br br-int

VLAN network

[agent]
physical_interface_mappings = <physical-net-name>:<interface>

You must create bridges preliminarily.

# ovs-vsctl add-br br-int

If you want to connect other nodes,

# ovs-vsctl add-port <physical-net-bridge-name> <interface>

For example use a VLAN network on an one node.

# ovs-vsctl add-br br-int

# cat /etc/neutron/plugin/ml2/ml2_conf.ini
[ml2]
tenant_network_types = vlan
type_drivers = vlan
mechanism_drivers = ofagent,l2population

[ml2_type_vlan]
network_vlan_ranges = physnet1:100:199

[agent]
physical_interface_mappings = physnet1:eth1

Start the agent

$ cd /opt/stack/neutron
$ python /usr/local/bin/neutron-ofagent-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini

NOTE: The OpenFlow Agent agent requires OpenFlow 1.3. Please check if your installation of OpenvSwich supports OpenFlow 1.3. For example:

$ ovs-ofctl --version
ovs-ofctl (Open vSwitch) 1.10.2
Compiled Sep 23 2013 14:53:13
OpenFlow versions 0x1:0x4
$

NOTE: The OpenFlow Agent agent requires a ryu version of the flowing: networking-ofagent pip package will automatically install ryu.

Juno and later: 3.19 or later

$ sudo pip install ryu[==3.xx]
$