Bug 1325678

Summary: [RFE] [Neutron] Tenant resources cleanup with a single CLI/API call
Product: Red Hat OpenStack Reporter: Nir Yechiel <nyechiel>
Component: openstack-neutronAssignee: Assaf Muller <amuller>
Status: CLOSED ERRATA QA Contact: Toni Freger <tfreger>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0 (Liberty)CC: amuller, astafeye, chrisw, cshastri, jbuchta, jjoyce, jruzicka, jschluet, nlevinki, nyechiel, oblaut, rhosp-bugs-internal, srevivo, tfreger
Target Milestone: gaKeywords: FutureFeature, Triaged
Target Release: 9.0 (Mitaka)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-neutron-8.0.0-1.el7ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-11 12:16:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1339444    

Description Nir Yechiel 2016-04-10 15:18:17 UTC
Description of problem:

A problem was identified where removing a tenant can leave behind stray routers, ports, etc. For RHOSP customers this was solved till now by manually running a script.

It was suggested that a simple 'neutron purge <tenant_id>' command or similar would simplify the process of cleaning up these stray resources by removing everything associated with the given tenant.

The expectation is that this command would be admin-only, and neutron should not be responsible for deciding whether the action is 'safe'. It should work regardless of whether the given tenant is active or not.

Comment 2 Nir Yechiel 2016-04-10 15:22:46 UTC
The addition of the 'neutron purge' command allows cloud admins to conveniently delete multiple neutron resources associated with a given tenant.

The command will delete all supported resources provided that they can be deleted (not in use, etc) and feedback the amount of each resource deleted to the user. A completion percentage is also given to keep the user informed of progress.

Currently supports deletion of:

*Networks
*Subnets (implicitly)
*Routers
*Ports (including router interfaces)
*Floating IPs
*Security Groups

Comment 4 Nir Yechiel 2016-04-10 17:19:25 UTC
*** Bug 1270836 has been marked as a duplicate of this bug. ***

Comment 5 Alexander Stafeyev 2016-04-17 05:31:18 UTC
(In reply to Nir Yechiel from comment #2)
> The addition of the 'neutron purge' command allows cloud admins to
> conveniently delete multiple neutron resources associated with a given
> tenant.
> 
> The command will delete all supported resources provided that they can be
> deleted (not in use, etc) and feedback the amount of each resource deleted
> to the user. A completion percentage is also given to keep the user informed
> of progress.
> 
> Currently supports deletion of:
> 
> *Networks
> *Subnets (implicitly)
> *Routers
> *Ports (including router interfaces)
> *Floating IPs
> *Security Groups

Hi Nir, 

Are the basic dependencies should prevent the command execution? 
For example- I cannot delete router (nor net/subnet) when we have ports attached to it. What is the expected behavior in this case? 

Tnx

Comment 6 Nir Yechiel 2016-04-17 07:51:40 UTC
(In reply to Alexander Stafeyev from comment #5)
> (In reply to Nir Yechiel from comment #2)
> > The addition of the 'neutron purge' command allows cloud admins to
> > conveniently delete multiple neutron resources associated with a given
> > tenant.
> > 
> > The command will delete all supported resources provided that they can be
> > deleted (not in use, etc) and feedback the amount of each resource deleted
> > to the user. A completion percentage is also given to keep the user informed
> > of progress.
> > 
> > Currently supports deletion of:
> > 
> > *Networks
> > *Subnets (implicitly)
> > *Routers
> > *Ports (including router interfaces)
> > *Floating IPs
> > *Security Groups
> 
> Hi Nir, 
> 
> Are the basic dependencies should prevent the command execution? 
> For example- I cannot delete router (nor net/subnet) when we have ports
> attached to it. What is the expected behavior in this case? 
> 
> Tnx

The command will delete all supported resources provided that **they can be deleted (not in use)**. Also, A resource being in use by another tenant (for example, a shared network) can prevent it from being deleted. Please see http://docs.openstack.org/mitaka/networking-guide/misc-neutron-purge.html

Comment 10 Alexander Stafeyev 2016-07-11 14:00:07 UTC
Ran on 2016-06-05 

build - 2016-04-29.6

Comment 12 errata-xmlrpc 2016-08-11 12:16:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-1597.html

Comment 13 Assaf Muller 2017-02-23 23:02:46 UTC
*** Bug 1426006 has been marked as a duplicate of this bug. ***

Comment 14 Assaf Muller 2017-02-24 14:21:21 UTC
*** Bug 1426450 has been marked as a duplicate of this bug. ***

Comment 15 Assaf Muller 2017-03-10 12:15:42 UTC
*** Bug 1431098 has been marked as a duplicate of this bug. ***