Neutron doesn't delete Designate entry when port is deleted

Bug #1812168 reported by Kobi Samoray
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Salvatore Orlando

Bug Description

When a port with a FIP and DNS association is deleted, Neutron integration is not deleting the DNS entry from Designate.

To reproduce use the following flow:

# Create a Designate zone and associate with a tenant network
openstack zone create --email <email address hidden> example.org.
neutron net-create net1 --dns-domain example.org.
neutron subnet-create --name sub1 net1 192.168.1.0/24

# Create a router, and attach tenant network to a public network
neutron router-create rtr
neutron router-interface-add rtr sub1
neutron router-interface-add rtr sub2
neutron router-gateway-set rtr public

# Create a port, associate with a FIP
PORT_ID=$(neutron port-create --name testport --dns-name testport net1 | awk '/ id /{print $4}')
neutron floatingip-create --port-id $PORT_ID public

# Entry should be seen in Designate recordset
openstack recordset list example.org.

# Delete port
neutron port-delete $PORT_ID

# Entry is expected to be deleted from Designate recordset. Yet it isn't
openstack recordset list example.org.

Changed in neutron:
importance: Undecided → High
tags: added: designate dns
Miguel Lavalle (minsel)
Changed in neutron:
assignee: nobody → Miguel Lavalle (minsel)
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

@Miguel: Are you actively working on this? Otherwise maybe better unassign yourself?

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

In my opinion the problem is that disassociate_floating_ips (https://opendev.org/openstack/neutron/src/branch/master/neutron/db/l3_db.py#L1576) operates directly on DB models but has not interaction with the external DNS server, so when the port is deleted any existing DNS record associated to the floating IP will stay until the floating IP is reassociated.

I wonder if it's ok to just call _process_dns_floatingip_delete (https://opendev.org/openstack/neutron/src/branch/master/neutron/db/dns_db.py#L179)
this because we know that upon disassociation we will have a non-empty previous name and an empty current name. It might be therefore redundant to call _process_dns_floatingip_precommit and _process_dns_floatingip_postcommit (and following this process might require larger code changes)

Changed in neutron:
assignee: Miguel Lavalle (minsel) → Salvatore Orlando (salvatore-orlando)
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/691640

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

Reviewed: https://review.opendev.org/691640
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4379310846078c45df140071688f740cd900c1d6
Submitter: Zuul
Branch: master

commit 4379310846078c45df140071688f740cd900c1d6
Author: Salvatore Orlando <email address hidden>
Date: Mon Oct 28 09:06:33 2019 +0000

    Remove Floating IP DNS record upon associated port deletion

    Port deletion triggers disassociate_floatingips. This patch ensures
    that method not only clears the port association for a Floating IP,
    but also removes any DNS record associated with it.

    Change-Id: Ia6202610c09811f240af35e2523126447bf02ca5
    Closes-Bug: #1812168

Changed in neutron:
status: In Progress → Fix Released
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/693706

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

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/693707

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

Reviewed: https://review.opendev.org/693707
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a9b4a4553ecd27e764e3b4789e51ba1d84c2ab4e
Submitter: Zuul
Branch: stable/stein

commit a9b4a4553ecd27e764e3b4789e51ba1d84c2ab4e
Author: Salvatore Orlando <email address hidden>
Date: Mon Oct 28 09:06:33 2019 +0000

    Remove Floating IP DNS record upon associated port deletion

    Port deletion triggers disassociate_floatingips. This patch ensures
    that method not only clears the port association for a Floating IP,
    but also removes any DNS record associated with it.

    Change-Id: Ia6202610c09811f240af35e2523126447bf02ca5
    Closes-Bug: #1812168
    (cherry picked from commit 4379310846078c45df140071688f740cd900c1d6)

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

Reviewed: https://review.opendev.org/693706
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5c5e17bd7d57be715ad5cd37089ad3a4cb4a81c6
Submitter: Zuul
Branch: stable/train

commit 5c5e17bd7d57be715ad5cd37089ad3a4cb4a81c6
Author: Salvatore Orlando <email address hidden>
Date: Mon Oct 28 09:06:33 2019 +0000

    Remove Floating IP DNS record upon associated port deletion

    Port deletion triggers disassociate_floatingips. This patch ensures
    that method not only clears the port association for a Floating IP,
    but also removes any DNS record associated with it.

    Change-Id: Ia6202610c09811f240af35e2523126447bf02ca5
    Closes-Bug: #1812168
    (cherry picked from commit 4379310846078c45df140071688f740cd900c1d6)

tags: added: in-stable-train
tags: added: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.4

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

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

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

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

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/702767

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

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

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

Reviewed: https://review.opendev.org/702767
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9def99f3d20df5253bafba24bd1ca2ea9c99a032
Submitter: Zuul
Branch: stable/rocky

commit 9def99f3d20df5253bafba24bd1ca2ea9c99a032
Author: Salvatore Orlando <email address hidden>
Date: Mon Oct 28 09:06:33 2019 +0000

    Remove Floating IP DNS record upon associated port deletion

    Port deletion triggers disassociate_floatingips. This patch ensures
    that method not only clears the port association for a Floating IP,
    but also removes any DNS record associated with it.

    Change-Id: Ia6202610c09811f240af35e2523126447bf02ca5
    Closes-Bug: #1812168
    (cherry picked from commit 4379310846078c45df140071688f740cd900c1d6)

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

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

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

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/718209

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

Reviewed: https://review.opendev.org/718209
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0d3d689a4e8c97ca25841444e7d425614b6c977d
Submitter: Zuul
Branch: stable/queens

commit 0d3d689a4e8c97ca25841444e7d425614b6c977d
Author: Salvatore Orlando <email address hidden>
Date: Mon Oct 28 09:06:33 2019 +0000

    Remove Floating IP DNS record upon associated port deletion

    Port deletion triggers disassociate_floatingips. This patch ensures
    that method not only clears the port association for a Floating IP,
    but also removes any DNS record associated with it.

    Change-Id: Ia6202610c09811f240af35e2523126447bf02ca5
    Closes-Bug: #1812168
    (cherry picked from commit 4379310846078c45df140071688f740cd900c1d6)
    (cherry picked from commit 9def99f3d20df5253bafba24bd1ca2ea9c99a032)

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

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