delete lbaasv2 can't delete lbaas namespace automatically.

Bug #1495430 reported by Hong Hui Xiao on 2015-09-14
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
High
Unassigned
Kilo
High
Unassigned
Mitaka
High
Unassigned
Newton
High
Unassigned
Ocata
High
Unassigned
octavia
Fix Released
High
Zhou Zhihong
neutron-lbaas (Ubuntu)
High
Unassigned
Xenial
High
Unassigned
Yakkety
High
Unassigned
Zesty
High
Unassigned

Bug Description

Try the lbaas v2 in my env and found lots of orphan lbaas namespace. Look back to the code and find that lbaas instance will be undelployed, when delete listener. All things are deleted except the namespace.
However, from the method of deleting loadbalancer, the namespace will be deleted automatically.
The behavior is not consistent, namespace should be deleted from deleting listener too.

Hong Hui Xiao (xiaohhui) on 2015-09-14
Changed in neutron:
assignee: nobody → Hong Hui Xiao (xiaohhui)
description: updated

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

Changed in neutron:
status: New → In Progress
P Ingle (pingle) wrote :

On Kilo release with LBaaS v2, it was observed that the lbaas namespace does not get deleted even after loadbalancer object is deleted.

:~# neutron lbaas-loadbalancer-list
+--------------------------------------+------+-------------+---------------------+----------+
| id | name | vip_address | provisioning_status | provider |
+--------------------------------------+------+-------------+---------------------+----------+
| f5b74cd4-df4c-48f9-a004-98190d2cc091 | lb1 | 8.8.8.6 | ACTIVE | haproxy |
+--------------------------------------+------+-------------+---------------------+----------+
:~# ip netns | grep f5b74cd4-df4c-48f9-a004-98190d2c
qlbaas-f5b74cd4-df4c-48f9-a004-98190d2cc091
:~# neutron lbaas-listener-delete listener1
Deleted listener: listener1
:~# ip netns | grep f5b74cd4-df4c-48f9-a004-98190d2c
qlbaas-f5b74cd4-df4c-48f9-a004-98190d2cc091
:~# neutron lbaas-loadbalancer-delete lb1
Deleted loadbalancer: lb1
:~# ip netns | grep f5b74cd4-df4c-48f9-a004-98190d2c
qlbaas-f5b74cd4-df4c-48f9-a004-98190d2cc091

Same problem with V1 also
As of now my pool and vip are deleted. I still see the namespace.
When we delete the vip, we are deleting all the info in /var/lib/neutron/lbaas/<pool_id> except namespace.

when delete_pool, we are checking if this namespace exists by connecting to the namespace using socket created during create_vip.
This will fail, so we don't even attempt to delete it.

[root@controller-01 ~]# ip netns exec qlbaas-779dc094-0436-479b-ad49-95b10a8a8e9e ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 0 (Local Loopback)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@controller-01 ~]# file /var/lib/neutron/lbaas/779dc094-0436-479b-ad49-95b10a8a8e9e/sock
/var/lib/neutron/lbaas/779dc094-0436-479b-ad49-95b10a8a8e9e/sock: cannot open (No such file or directory)
[root@controller-01 ~]#

There is should be a different way to find out if the pool exists

    def delete_pool(self, pool):
        if self.exists(pool['id']):
            self.undeploy_instance(pool['id'], delete_namespace=True)

as you see self.exists fails

I was wondering if I can modify
    def delete_vip(self, vip):
        #self.undeploy_instance(vip['pool_id'])
        self.undeploy_instance(vip['pool_id'],delete_namespace=True)
# is the old code.
Why we don't do this in delete_vip? create_vip creates namespace and plugs it as well.

Changed in neutron:
assignee: Hong Hui Xiao (xiaohhui) → Zhou Zhihong (shuihushen)
Edward Hope-Morley (hopem) wrote :

Since r.o.o failed to auto-associate the most recently submitted patch, here it is:

https://review.openstack.org/#/c/343963/

Changed in neutron:
importance: Undecided → High
affects: neutron → octavia

Reviewed: https://review.openstack.org/343963
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=9073940a82d3adf6581643941c059bf1d8bb8615
Submitter: Jenkins
Branch: master

commit 9073940a82d3adf6581643941c059bf1d8bb8615
Author: Zhou Zhihong <email address hidden>
Date: Thu Jul 21 03:59:28 2016 -0700

    The lb namespace can not be deleted

    When delete the last listener, the lb instance was undeployed.
    But the lb namespace was not deleted at this time. After that,
    when delete the loadbalancer, the lb namespace will not be
    deleted for the exists() check always return False.

    Closes-Bug: #1495430
    Change-Id: Ic3cb25a6bd2bf86f8c30ef62ae323c3bab0c82fc

Changed in octavia:
status: In Progress → Fix Released

This issue was fixed in the openstack/neutron-lbaas 10.0.0.0b3 development milestone.

Reviewed: https://review.openstack.org/426209
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=16a323dbf740d80bfb8f816025719e6bbf69d4e7
Submitter: Jenkins
Branch: stable/newton

commit 16a323dbf740d80bfb8f816025719e6bbf69d4e7
Author: Zhou Zhihong <email address hidden>
Date: Thu Jul 21 03:59:28 2016 -0700

    The lb namespace can not be deleted

    When delete the last listener, the lb instance was undeployed.
    But the lb namespace was not deleted at this time. After that,
    when delete the loadbalancer, the lb namespace will not be
    deleted for the exists() check always return False.

    Closes-Bug: #1495430
    (cherry picked from commit 9073940a82d3adf6581643941c059bf1d8bb8615)
    Change-Id: Ic3cb25a6bd2bf86f8c30ef62ae323c3bab0c82fc

tags: added: in-stable-newton
Changed in neutron-lbaas (Ubuntu Zesty):
status: New → Fix Released
Changed in neutron-lbaas (Ubuntu Yakkety):
status: New → Triaged
Changed in neutron-lbaas (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → High
Changed in neutron-lbaas (Ubuntu Yakkety):
importance: Undecided → High
Changed in neutron-lbaas (Ubuntu Zesty):
importance: Undecided → High
Corey Bryant (corey.bryant) wrote :

This is fixed upstream in stable/newton. We'll need to cherry-pick that or pick it up in a stable point release and carry patches in the packages for kilo, liberty, and mitaka.

This issue was fixed in the openstack/neutron-lbaas 9.2.1 release.

no longer affects: neutron
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers