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

Bug #1581348 reported by Hong Hui Xiao on 2016-05-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
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) on 2016-05-13
Changed in neutron:
assignee: nobody → Hong Hui Xiao (xiaohhui)
tags: added: l3-dvr-backlog
tags: added: ipv6

Fix proposed to branch: master
Review: https://review.openstack.org/315926

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium

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

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

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.

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

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

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  Edit
Everyone can see this information.

Other bug subscribers