neutron-openvswitch-agent and IPv6

Bug #1846494 reported by Vladimir Georgiev on 2019-10-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Medium
Unassigned

Bug Description

I got two problems connected to IPv6 and neutron-openvswitch-agent (Queens version of Openstack, Ubuntu 18.04):

The first problem:

The default value of "of_listen_address" (setting in [ovs] section in file /etc/neutron/plugins/ml2/openvswitch_agent.ini) is 127.0.0.1.

When I set it to its IPv6 equivalent "::1", it tries to pass that to ovs-vswitchd as "tcp:::1:6633", which is not valid URL according IPv6. As result ovs-vswitchd complains about that.

When I set value to "[::1]" with idea the result to be valid URL "tcp:[::1]:6633", I got following exception:

  File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 3378, in __getattr__
    return self._conf._get(name, self._group)
  File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2940, in _get
    value = self._do_get(name, group, namespace)
  File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2983, in _do_get
    % (opt.name, str(ve)))
oslo_config.cfg.ConfigFileValueError: Value for option of_listen_address is not valid: [::1] is not IPv4 or IPv6 address

So the composing of URL with "of_listen_address" and "of_listen_port" for version IPv6 is not done correctly.

The second problem:

When I try to set "ovsdb_connection = tcp:[::1]:6640", again in "openvswitch_agent.ini", in logs I see neutron try to set manager as "ovs-vsctl set-manager ptcp::1]:6640:[". But I do not keep exact steps for reproduction.

Also (just in case) I tried to set "ovsctl set-manager ptcp:6640:[::1]" , again in "openvswitch_agent.ini", but as expected I got follow error:

ovs-vsctl[1957]: ovs|00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl set-manager ptcp:6640:[::1]
ovs-config.py[1962]: configobj.ParseError: Invalid line ('ovs-vsctl set-manager ptcp:6640:[::1]') (matched as neither section nor keyword) at line 58.

So obviously it is for starting of server, not value for the ini file.

description: updated
description: updated
description: updated
description: updated
Bernard Cafarelli (bcafarel) wrote :

Confirmed on master (I always use 127.0.0.1 so never tested IPv6 addresses before)

Changed in neutron:
status: New → Confirmed
tags: added: ipv6 ovs
Changed in neutron:
importance: Undecided → Medium
Slawek Kaplonski (slaweq) wrote :

We should probably check if IP address is IPv6 and than add [] to it before creating connection string. It looks for me like low-hanging-fruit bug.

tags: added: low-hanging-fruit

Here is additional information about the second problem:

when "ovsdb_connection = tcp:[::1]:6640" is in "openvswitch_agent.ini"
log file contains:

DEBUG neutron.agent.linux.utils [req-d289647c-543a-417c-a42e-e56307e6293f - - - - -] Running command: ['sudo', '/usr/bin/neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-vsctl', '--timeout=5', '--id=@manager', '--', 'create', 'Manager', 'target="ptcp::1]:6640:["', '--', 'add', 'Open_vSwitch', '.', 'manager_options', '@manager'] create_process /usr/lib/python2.7/dist-packages/neutron/agent/linux/utils.py:92

'target="ptcp::1]:6640:["'

Sapna Jadhav (sapana45) on 2019-10-08
Changed in neutron:
assignee: nobody → Sapna Jadhav (sapana45)
Changed in neutron:
status: Confirmed → In Progress
Changed in neutron:
assignee: Sapna Jadhav (sapana45) → Rodolfo Alonso (rodolfo-alonso-hernandez)

Reviewed: https://review.opendev.org/688304
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4d52b903eb0745296c4e71eebd3db13d17aeede7
Submitter: Zuul
Branch: master

commit 4d52b903eb0745296c4e71eebd3db13d17aeede7
Author: SapanaJadhav <email address hidden>
Date: Sun Oct 13 20:46:57 2019 +0530

    Adding check for IPv6 address in setup_controllers

    If it is IPv6 then adding [] to it before
    creating the connection string.

    Change-Id: Idd108cbef944cdd89808bb1ad5c8ab1db202d31a
    Closes-Bug: #1846494

Changed in neutron:
status: In Progress → Fix Released

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: Rodolfo Alonso (rodolfo-alonso-hernandez) → nobody
tags: added: timeout-abandon

Change abandoned by Slawek Kaplonski (<email address hidden>) on branch: master
Review: https://review.opendev.org/689576
Reason: This review is > 4 weeks without comment and currently blocked by a core reviewer with a -2. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and contacting the reviewer with the -2 on this review to ensure you address their concerns.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers