Too long tunnel devices names

Bug #1281098 reported by Viktor Křivák
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Darragh O'Reilly

Bug Description

Openvswitch neutron agent create too long names for tunnel devices.
Ports name are created like %type-%remoteip.
For example for gre type tunnel, name is gre-192.168.201.10 which exceed max length for linux network devices (15 chars).
This name pass throw openvswitch, but create failed port with ofport -1 and proceed with error like this:

2014-02-17 11:25:14.048 22908 ERROR neutron.agent.linux.ovs_lib [-] Unable to execute ['ovs-ofctl', 'add-flow', 'br-tun', 'hard_timeout=0,idle_timeout=0,priority=1,in_port=-1,actions=resubmit(,2)']. Exception:
Command: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-ofctl', 'add-flow', 'br-tun', 'hard_timeout=0,idle_timeout=0,priority=1,in_port=-1,actions=resubmit(,2)']
Exit code: 1
Stdout: ''
Stderr: 'ovs-ofctl: -1: negative values not supported for in_port\n'

This bug affect only devices with long ip address 10.0.0.1 will pass, but 192.168.201.10 fail.

Found in HAVANA with:
openvswitch: 1.9.3-1
linux: 3.2.54-2

But I think length limit will apply on all versions.

Revision history for this message
Darragh O'Reilly (darragh-oreilly) wrote :

Running this:
from neutron.agent.linux.ovs_lib import OVSBridge
br_tun = OVSBridge(br_name='br-tun', root_helper='sudo')
br_tun.add_tunnel_port('gre-100.100.100.100', '100.100.100.100',
                       '100.100.100.99', tunnel_type='gre')

on:
$ uname -a
Linux devstack 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ sudo ovs-vsctl show | tail -1
    ovs_version: "1.4.0+build0"

returns '-1'
And using a port name <=15 chars is ok.

But running the same on:
$ uname -a
Linux netnode 3.8.0-32-generic #47~precise1-Ubuntu SMP Wed Oct 2 16:19:35 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ sudo ovs-vsctl show | tail -1
    ovs_version: "1.10.2"

returns a positive integer in a string, ie no problem.

When using the OVS plugin, 'id' is returned from the tunnel_sync rpc, and so there is no problem. But the ML2 plugin does not return an id, and so the remote ip is used:
https://github.com/openstack/neutron/blob/stable/havana/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py#L1029
  tunnel_id = tunnel.get('id', tunnel['ip_address'])
  tun_name = '%s-%s' % (tunnel_type, tunnel_id)

One solution would be to use the hex of the IP address which will always be 8 chars, so even with the 'vxlan-' prefix, port_name will only be 14 chars. The port name just needs to be unique.

Changed in neutron:
status: New → Confirmed
Changed in neutron:
assignee: nobody → Darragh O'Reilly (darragh-oreilly)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/74442

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/74442
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3d8ab7964ace4e96539cfbc0587c8f04c81ac3b3
Submitter: Jenkins
Branch: master

commit 3d8ab7964ace4e96539cfbc0587c8f04c81ac3b3
Author: Darragh O'Reilly <email address hidden>
Date: Tue Feb 18 16:31:08 2014 +0000

    ovs-agent: use hexadecimal IP address in tunnel port name

    The remote IP address is used to form the tunnel port name when
    the ovs-agent is used with the ML2 plugin. With some OVS/Linux
    combinations there is a 15 character limit on port names, so a
    name like 'gre-192.168.10.10' does not work. This fix uses the
    shorter hexadecimal representation of the IP address instead.

    Change-Id: I58caf54219130159525b5a6492eaa451062c2ff5
    Closes-Bug: 1281098

Changed in neutron:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in neutron:
importance: Undecided → High
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.