[OVN] Logical router port must have at least one network

Bug #1948457 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Arnau Verdaguer

Bug Description

When adding a LRP into the OVN NB DB, the minimum number of networks should be 1 [1].

Error snippet: https://paste.opendev.org/show/810166/

[1]https://github.com/ovn-org/ovn/blob/0ecc131512b153118260853f6fd494d6dead0dff/ovn-nb.ovsschema#L391-L393

Revision history for this message
Jakub Libosvar (libosvar) wrote :

There was also Red Hat BZ raised about it some time ago: https://bugzilla.redhat.com/show_bug.cgi?id=1948459

Changed in neutron:
importance: Undecided → Medium
tags: added: ovn
Miguel Lavalle (minsel)
Changed in neutron:
assignee: nobody → Miguel Lavalle (minsel)
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

From the BZ link. Arnau updated the bug with the steps to reproduce it:

1. Create a network and a subnet
2. Create a router
3. Attach subnet to router
4. Remove IP from the router port

This will cause to update the port and remove the only IP that it has. Since it's a network:router_port owned this will cause to call ovn_client.update_router_port, who will finally call update_lrouter_port with an empty network list. This will cause an error since the network column has a constraint where the value must be greater than 0.

Changed in neutron:
assignee: Miguel Lavalle (minsel) → Arnau Verdaguer (averdagu)
Changed in neutron:
status: New → In Progress
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/817525
Committed: https://opendev.org/openstack/neutron/commit/fa2179278f064f75e057f7020e4f0c34f358de1b
Submitter: "Zuul (22348)"
Branch: master

commit fa2179278f064f75e057f7020e4f0c34f358de1b
Author: Arnau Verdaguer <email address hidden>
Date: Wed Nov 17 16:59:28 2021 +0100

    [OVN] Prevent deleting the only IP of a router port

    Neutron allows deleting the only IP of a router port but
    the OVN NB DB doesn't, since it expects that the
    network value of a port is greater than 0. This should
    not be possible since it causes that the DB are not
    perfectly sync.

    It is needed to check BEFORE_UPDATE if the port
    that will be updated is of type router owned and
    if it will have an IP after the update. If not
    an error needs to be raised.

    Closes-Bug: #1948457
    Change-Id: I206c31201470f178efdde8839622be7900c6ae3e

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/823377

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/823401

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/823402

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/823407

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/823401
Committed: https://opendev.org/openstack/neutron/commit/f7f083c9da48106ae2450fcb94aa16b9f41de71b
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit f7f083c9da48106ae2450fcb94aa16b9f41de71b
Author: Arnau Verdaguer <email address hidden>
Date: Wed Nov 17 16:59:28 2021 +0100

    [OVN] Prevent deleting the only IP of a router port

    Neutron allows deleting the only IP of a router port but
    the OVN NB DB doesn't, since it expects that the
    network value of a port is greater than 0. This should
    not be possible since it causes that the DB are not
    perfectly sync.

    It is needed to check BEFORE_UPDATE if the port
    that will be updated is of type router owned and
    if it will have an IP after the update. If not
    an error needs to be raised.

    Compared to master patch, this has changed payload to kwargs
    Conflicts:
        neutron/services/ovn_l3/plugin.py

    Closes-Bug: #1948457
    Change-Id: I206c31201470f178efdde8839622be7900c6ae3e
    (cherry picked from commit 935c88032bd3c0e501c70a18c0f1eb3cfc67c1f0)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/823377
Committed: https://opendev.org/openstack/neutron/commit/ca06a2e62b01ab9b0e0c9dee0a7b9d79b95b2894
Submitter: "Zuul (22348)"
Branch: stable/xena

commit ca06a2e62b01ab9b0e0c9dee0a7b9d79b95b2894
Author: Arnau Verdaguer <email address hidden>
Date: Wed Nov 17 16:59:28 2021 +0100

    [OVN] Prevent deleting the only IP of a router port

    Neutron allows deleting the only IP of a router port but
    the OVN NB DB doesn't, since it expects that the
    network value of a port is greater than 0. This should
    not be possible since it causes that the DB are not
    perfectly sync.

    It is needed to check BEFORE_UPDATE if the port
    that will be updated is of type router owned and
    if it will have an IP after the update. If not
    an error needs to be raised.

    Closes-Bug: #1948457
    Change-Id: I206c31201470f178efdde8839622be7900c6ae3e
    (cherry picked from commit fa2179278f064f75e057f7020e4f0c34f358de1b)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/823402
Committed: https://opendev.org/openstack/neutron/commit/34b4a8d5c894c48f98dbb4ec5469f6564167d7eb
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 34b4a8d5c894c48f98dbb4ec5469f6564167d7eb
Author: Arnau Verdaguer <email address hidden>
Date: Wed Nov 17 16:59:28 2021 +0100

    [OVN] Prevent deleting the only IP of a router port

    Neutron allows deleting the only IP of a router port but
    the OVN NB DB doesn't, since it expects that the
    network value of a port is greater than 0. This should
    not be possible since it causes that the DB are not
    perfectly sync.

    It is needed to check BEFORE_UPDATE if the port
    that will be updated is of type router owned and
    if it will have an IP after the update. If not
    an error needs to be raised.

    Comparet to master patch, this has changed payload to kwargs
    Conflicts:
        neutron/services/ovn_l3/plugin.py

    Closes-Bug: #1948457
    Change-Id: I206c31201470f178efdde8839622be7900c6ae3e
    (cherry picked from commit fa2179278f064f75e057f7020e4f0c34f358de1b)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/823407
Committed: https://opendev.org/openstack/neutron/commit/f56def26152c0fcab3594d542ea06480bdfbb466
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit f56def26152c0fcab3594d542ea06480bdfbb466
Author: Arnau Verdaguer <email address hidden>
Date: Wed Nov 17 16:59:28 2021 +0100

    [OVN] Prevent deleting the only IP of a router port

    Neutron allows deleting the only IP of a router port but
    the OVN NB DB doesn't, since it expects that the
    network value of a port is greater than 0. This should
    not be possible since it causes that the DB are not
    perfectly sync.

    It is needed to check BEFORE_UPDATE if the port
    that will be updated is of type router owned and
    if it will have an IP after the update. If not
    an error needs to be raised.

    Compared to master patch, this has changed payload to kwargs
    Conflicts:
        neutron/services/ovn_l3/plugin.py

    Closes-Bug: #1948457
    Change-Id: I206c31201470f178efdde8839622be7900c6ae3e
    (cherry picked from commit fb3f92fcd0bbc4c390c0b40034d3cdbe41460ae1)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 17.3.0

This issue was fixed in the openstack/neutron 17.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.2.0

This issue was fixed in the openstack/neutron 18.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.0.0.0rc1

This issue was fixed in the openstack/neutron 20.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.2.0

This issue was fixed in the openstack/neutron 19.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/networking-ovn train-eol

This issue was fixed in the openstack/networking-ovn train-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron ussuri-eol

This issue was fixed in the openstack/neutron ussuri-eol release.

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.