Can't delete a v4 csnat port when there is a v6 router interface attached

Bug #1581348 reported by Hong Hui Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Hong Hui Xiao

Bug Description

Reproduce:
1) I enable DVR in devstack. After installation, there is a DVR, an ipv4+ipv6 router gateway in DVR, an ipv4 router interface in DVR, and an ipv6 router interface in DVR.

2) I want to use delete the v4 subnet. So, I delete the ipv4 router gateway.
[fedora@normal-dvr devstack]$ neutron router-interface-delete router1 private-subnet
Removed interface from router router1.

3) I try to delete the v4 subnet, but neutron server tell me that the subnet can't be deleted, because there is still port(s) being used.
[fedora@normal-dvr devstack]$ neutron subnet-delete private-subnet
Unable to complete operation on subnet d0282930-95ca-4f64-9ae9-8c22be9cb3ab: One or more ports have an IP allocation from this subnet.

4) Check the port-list, I found the csnat port is still there.
[fedora@normal-dvr devstack]$ neutron port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------------------------------+

| bf042acf-40d5-4503-b62e-7389a6fc9bca | | fa:16:3e:47:a5:40 | {"subnet_id": "d0282930-95ca-4f64-9ae9-8c22be9cb3ab", "ip_address": "10.0.0.3"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------------------------------+

5) But look into the snat namespace, there is no such port there.

Then I can't delete the subnet, because the port is there. I can't delete the port, because the port has a device owner network:router_centralized_snat. I even can't attach the subnet back to DVR, neutron server will tell me: Router already has a port on subnet.

This problem will not be reproduce if there is no ipv6 subnet attached to DVR.

Expect: Can use ipv4 no matter if there is ipv6 subnet attached to DVR.

Hong Hui Xiao (xiaohhui)
Changed in neutron:
assignee: nobody → Hong Hui Xiao (xiaohhui)
tags: added: l3-dvr-backlog
tags: added: ipv6
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/315926

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/319037

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

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

commit 084173338e5e21ff37f042f69718237b94843665
Author: Hong Hui Xiao <email address hidden>
Date: Fri May 13 07:12:57 2016 +0000

    DVR: Fix check multiprefix when delete ipv4 router interface

    Current code will prevent from deleting router centralized snat port,
    when there is a ipv6 subnet attatched to DVR.

    This is correct when deleting a v6 router centralized snat port, because
    multiple v6 subnets share one router port.

    But it is not correct when deleteing a v4 router centralized snat port,
    because v4 subnet doesn't share router port with v6 subnet. Deleteing a
    v4 router centralized snat port should be allowed no matter if there is
    v6 subnet attached to DVR.

    Change-Id: I2d06c8c79f9ff9a9300a94bcbbae13569e4d963e
    Closes-bug: #1581348

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

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

commit 851d39df908ecdebdd449236488303ff75bd9e85
Author: Hong Hui Xiao <email address hidden>
Date: Fri May 20 02:49:47 2016 +0000

    Rename _find_router_port_by_network_and_device_owner

    This is actually finding the v6 port, rename it base on the discussion
    at https://review.openstack.org/#/c/315926

    Change-Id: Ibc91067be3d38934cb55c82e3d792b2990180fc7
    Related-bug: #1581348

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

Fix proposed to branch: /stable/mitaka
Review: https://review.openstack.org/324139

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

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/324775

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (/stable/mitaka)

Change abandoned by Swaminathan Vasudevan (<email address hidden>) on branch: /stable/mitaka
Review: https://review.openstack.org/324139
Reason: Adandon this patch since there was an issue with the branch.

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

Reviewed: https://review.openstack.org/324775
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f178c3a4079e2a3dc7f73dc5acd73639040dd56e
Submitter: Jenkins
Branch: stable/mitaka

commit f178c3a4079e2a3dc7f73dc5acd73639040dd56e
Author: Hong Hui Xiao <email address hidden>
Date: Fri May 13 07:12:57 2016 +0000

    DVR: Fix check multiprefix when delete ipv4 router interface

    Current code will prevent from deleting router centralized snat port,
    when there is a ipv6 subnet attatched to DVR.

    This is correct when deleting a v6 router centralized snat port, because
    multiple v6 subnets share one router port.

    But it is not correct when deleteing a v4 router centralized snat port,
    because v4 subnet doesn't share router port with v6 subnet. Deleteing a
    v4 router centralized snat port should be allowed no matter if there is
    v6 subnet attached to DVR.

    Change-Id: I2d06c8c79f9ff9a9300a94bcbbae13569e4d963e
    Closes-bug: #1581348
    (cherry picked from commit 084173338e5e21ff37f042f69718237b94843665)

tags: added: in-stable-mitaka
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/neutron 8.1.2

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

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

This issue was fixed in the openstack/neutron 9.0.0.0b2 development milestone.

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.