delete_subnet is not called in IPAM driver on subnet deallocation if ML2 plugin is used

Bug #1510653 reported by Pavel Bondar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-infoblox
Fix Released
High
Pavel Bondar
neutron
Fix Released
High
Pavel Bondar

Bug Description

ML2 plugin redefines [1] delete_subnet from db_base_plugin_v2,
but it does call to delete_subnet from pluggable IPAM implementation.

Subnets are correctly deleted from Horizon UI, but call to third-party IPAM provider is not done,
so subnets persist on IPAM provider.

[1] https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L880

Pavel Bondar (pasha117)
Changed in neutron:
assignee: nobody → Pavel Bondar (pasha117)
Revision history for this message
John Belamaric (jbelamaric) wrote :

This will need to be ported back to stable/liberty, too. Is there a unit test for this? The reference driver must suffer the same issue.

tags: added: liberty-backport-potential
Revision history for this message
Pavel Bondar (pasha117) wrote :

I believe refence IPAM driver suffers from it too, but have not verified it yet. Looks like existent UT do not catch undeleted subnets in reference IPAM driver, so need to add one.

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/239885

Changed in neutron:
status: New → In Progress
Pavel Bondar (pasha117)
Changed in neutron:
importance: Undecided → High
Changed in networking-infoblox:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Pavel Bondar (pasha117)
Changed in neutron:
assignee: Pavel Bondar (pasha117) → Armando Migliaccio (armando-migliaccio)
Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → Pavel Bondar (pasha117)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 99573f62d1fc79a4308784ab2c799d836b7a3d74
Author: Pavel Bondar <email address hidden>
Date: Wed Oct 28 12:22:52 2015 +0300

    Add call to pluggable IPAM from ml2 delete_subnet

    ml2 plugin overrides delete_subnet and do not call super(),
    so pluggable IPAM action defined in db_base_plugin_v2 are not called.
    As a result subnets can not be deleted from IPAM driver if ml2 plugin
    is used.

    Added ipam.delete_subnet call into ml2 delete_subnet.
    Patch includes UT to verify IPAM driver is called on subnet
    allocation and deallocation.
    Test class is inherited from TestMl2SubnetsV2, so all SubnetV2 tests are
    additionally executed for ml2 plugin with reference IPAM driver.

    Closes-Bug: #1510653

    Change-Id: I2b7ddfe70a1275a141af38e18151e1fc000e2682

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/244012

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

Reviewed: https://review.openstack.org/244012
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2e098ce2efe2ba6557473353a09d57b3cec3b2fd
Submitter: Jenkins
Branch: stable/liberty

commit 2e098ce2efe2ba6557473353a09d57b3cec3b2fd
Author: Pavel Bondar <email address hidden>
Date: Wed Oct 28 12:22:52 2015 +0300

    Add call to pluggable IPAM from ml2 delete_subnet

    ml2 plugin overrides delete_subnet and do not call super(),
    so pluggable IPAM action defined in db_base_plugin_v2 are not called.
    As a result subnets can not be deleted from IPAM driver if ml2 plugin
    is used.

    Added ipam.delete_subnet call into ml2 delete_subnet.
    Patch includes UT to verify IPAM driver is called on subnet
    allocation and deallocation.
    Test class is inherited from TestMl2SubnetsV2, so all SubnetV2 tests are
    additionally executed for ml2 plugin with reference IPAM driver.

    Closes-Bug: #1510653

    Change-Id: I2b7ddfe70a1275a141af38e18151e1fc000e2682
    (cherry picked from commit 99573f62d1fc79a4308784ab2c799d836b7a3d74)

tags: added: in-stable-liberty
tags: removed: liberty-backport-potential
Pavel Bondar (pasha117)
Changed in neutron:
status: Fix Committed → Fix Released
Changed in networking-infoblox:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0b1

This issue was fixed in the openstack/neutron 8.0.0.0b1 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 7.0.1

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