Remove and recreate interfacein ovs if already exists

Bug #1268762 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Aaron Rosen
Havana
Fix Released
Undecided
Unassigned

Bug Description

If the dhcp-agent machine restarts and openvswitch logs the following
warning message for all tap interfaces that have not been recreated yet:

bridge|WARN|could not open network device tap2cf7dbad-9d (No such device)

Once the dhcp-agent starts he recreates the interfaces and readds them to the
ovs-bridge. Unfortinately, ovs does not reinitalize the interface as its
already in ovsdb and does not assign it an ofport number.

In order to correct this we should first remove interfaces that exist and
then readd them.

root@arosen-desktop:~# ovs-vsctl -- --may-exist add-port br-int fake1

# ofport still -1
root@arosen-desktop:~# ovs-vsctl list inter | grep -A 2 fake1
name : "fake1"
ofport : -1
ofport_request : []
root@arosen-desktop:~# ip link add fake1 type veth peer name fake11
root@arosen-desktop:~# ifconfig fake1
fake1 Link encap:Ethernet HWaddr 56:c3:a1:2b:1f:f4
          BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@arosen-desktop:~# ovs-vsctl list inter | grep -A 2 fake1
name : "fake1"
ofport : -1
ofport_request : []
root@arosen-desktop:~# ovs-vsctl -- --may-exist add-port br-int fake1
root@arosen-desktop:~# ovs-vsctl list inter | grep -A 2 fake1
name : "fake1"
ofport : -1
ofport_request : []

Aaron Rosen (arosen)
Changed in neutron:
assignee: nobody → Aaron Rosen (arosen)
importance: Undecided → High
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/66451

Changed in neutron:
status: New → In Progress
Revision history for this message
yong sheng gong (gongysh) wrote :

it seems has nothing to do with dhcp agent. in fact, if the port's interface is internal, the '-1' of ofport should not happen at all.
but it actually happens to non-internal interface port.

Aaron Rosen (arosen)
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit b78eea6146145793a7c61705a1602cf5e9ac3d3a
Author: Aaron Rosen <email address hidden>
Date: Mon Jan 13 13:57:04 2014 -0800

    Remove and recreate interface if already exists

    If the dhcp-agent machine restarts when openvswitch comes up it logs the
    following warning messages for all tap interfaces that do not exist:

    bridge|WARN|could not open network device tap2cf7dbad-9d (No such device)

    Once the dhcp-agent starts it recreates the interfaces and re-adds them to the
    ovs-bridge. Unfortunately, ovs does not reinitialize the interfaces as they
    are already in ovsdb and does not assign them a ofport number.

    This situation corrects itself though the next time a port is added to the
    ovs-bridge which is why no one has probably noticed this issue till now.

    In order to correct this we should first remove interface that exist and
    then readd them.

    Closes-bug: #1268762

    Change-Id: I4bb0019135ab7fa7cdfa6d5db3bff6eafe22fc85

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/72253

Yaguang Tang (heut2008)
tags: removed: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/havana)

Reviewed: https://review.openstack.org/72253
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c7596bf8c952ecc6d73ff50a6ae9ec6384b94cd1
Submitter: Jenkins
Branch: stable/havana

commit c7596bf8c952ecc6d73ff50a6ae9ec6384b94cd1
Author: Aaron Rosen <email address hidden>
Date: Mon Jan 13 13:57:04 2014 -0800

    Remove and recreate interface if already exists

    If the dhcp-agent machine restarts when openvswitch comes up it logs the
    following warning messages for all tap interfaces that do not exist:

    bridge|WARN|could not open network device tap2cf7dbad-9d (No such device)

    Once the dhcp-agent starts it recreates the interfaces and re-adds them to the
    ovs-bridge. Unfortunately, ovs does not reinitialize the interfaces as they
    are already in ovsdb and does not assign them a ofport number.

    This situation corrects itself though the next time a port is added to the
    ovs-bridge which is why no one has probably noticed this issue till now.

    In order to correct this we should first remove interface that exist and
    then readd them.

    Closes-bug: #1268762

    Change-Id: I4bb0019135ab7fa7cdfa6d5db3bff6eafe22fc85
    (cherry picked from commit b78eea6146145793a7c61705a1602cf5e9ac3d3a)

tags: added: in-stable-havana
Revision history for this message
Pavel Kirpichyov (pavel-kirpichyov) wrote :

After pulling this change to havana it breaking port tagging (deletes port with tag, creates port without tag)

Changed in neutron:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-3 → 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.