Bulk port creation breaks IPAM module when driver port creation fails

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

Bug Description

This bug is related to https://bugs.launchpad.net/neutron/+bug/1954763.

There is a problem with the IPAM module, [1] and ML2 OVN driver. When a port is created in "create_port_bulk", we first create the IPAM allocations [1], to save time and DB accesses.

However, if one port fails in the driver call, the port is deleted. In this port deletion, the IPAM reservation is deleted too. At the end of "create_port_bulk", the previously created IPAM reservations are deleted too (again). This is what is triggering the error in the Neutron server [2]. The DB now has a port register, a IP allocation register but not an IPAM allocation register. That prevents from deleting manually this port (error 500).

Red Hat bugzilla reference: https://bugzilla.redhat.com/show_bug.cgi?id=2065634

[1]https://review.opendev.org/q/I8877c658446fed155130add6f1c69f2772113c27
[2]https://paste.opendev.org/show/b6e3INfzhPTkOFW5fhPb/

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/834536

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

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

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/+/834651

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/+/834652

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/+/834653

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/+/834656

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

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

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

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

commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/834650
Committed: https://opendev.org/openstack/neutron/commit/2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)

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

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

commit d2b1e3edaafdf5a2fe4b64457a4caa57a194f858
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)
    (cherry picked from commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94)

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/+/834652
Committed: https://opendev.org/openstack/neutron/commit/b053dfe3844aaf024668847aab3498c3af559dc0
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit b053dfe3844aaf024668847aab3498c3af559dc0
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)
    (cherry picked from commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94)

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

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

commit 884418183a6e518d755f4e4dd6e05db7e7eef0ab
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)
    (cherry picked from commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94)

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

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

commit 4f03e76aaafbbc871a6f5c3fc4ecca4298635d6f
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)
    (cherry picked from commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/834657
Committed: https://opendev.org/openstack/neutron/commit/1254f2371864e10dc66f5aa27031088209f74e9e
Submitter: "Zuul (22348)"
Branch: stable/train

commit 1254f2371864e10dc66f5aa27031088209f74e9e
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Mar 16 16:32:31 2022 +0000

    Remove exception ``IpAddressAllocationNotFound``

    This patch removes the ``IpAddressAllocationNotFound`` exception. This
    exception was raised when a IPAM register was called to be deleted
    but not found.

    As reported in the LP bug, this IPAM register deletion can be called
    several times if a port fails during the creation. The IPAM register
    deletion calls the DB deletion but doesn't raise any exception if the
    register does not exist. The code ensures the IPAM register is
    deleted and there is no need to fail if it is not present anymore.

    This patch also removes the exception catch and try in "update_port",
    that was added in [0] as a fix for [1]. That was added because the
    subnet deletion code involved a port update call [2] during the
    IP allocation deletion, if any port was still present in the subnet.
    Since [3], this code is not needed because the subnet deletion does
    not call a port update anymore.

    [0]https://review.opendev.org/c/openstack/neutron/+/373536
    [1]https://bugs.launchpad.net/neutron/+bug/1622616
    [2]https://github.com/openstack/neutron/blob/pike-em/neutron/db/db_base_plugin_v2.py#L1017-L1018
    [3]https://review.opendev.org/c/openstack/neutron/+/713045

    Closes-Bug: #1965807
    Related-Bug: #1954763
    Related-Bug: #1622616

    Conflicts:
        neutron/ipam/exceptions.py

    Change-Id: I5b96b3a91aacffe118ddbb91a75c4892818ba97a
    (cherry picked from commit 83b6ce9e9ec2f0261fed630e18cbe9cfa363a0dd)
    (cherry picked from commit 2a6a4ab5dacc2e92c24d68774bf286c9e6ae2d94)

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

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

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

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

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

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

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/neutron 21.0.0.0rc1

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

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

This issue was fixed in the openstack/neutron 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.