Bug 982693

Summary: [RFE][cinder] allow to delete a volume with all it's snapshots
Product: Red Hat OpenStack Reporter: Dafna Ron <dron>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED DUPLICATE QA Contact: lkuchlan <lkuchlan>
Severity: low Docs Contact:
Priority: high    
Version: unspecifiedCC: abaron, amureini, eharney, jkt, mlipchuk, rhos-maint, scohen, sgotliv, ylavi
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: 9.0 (Mitaka)   
Hardware: x86_64   
OS: Linux   
URL: https://blueprints.launchpad.net/cinder/+spec/del-vols-with-snaps
Whiteboard: storage upstream_milestone_none upstream_status_slow-progress upstream_definition_obsolete
Fixed In Version: Doc Type: Enhancement
Doc Text:
A new option, --cascade, has been added to the cinderclient command-line tool for the "delete" subcommand. As a result, users can now run "cinder delete --cascade VOLUME" to delete a volume and all its snapshots. This option is available in cinderclient version 1.7.0 or later.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-05 12:41:36 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:
Embargoed:
Attachments:
Description Flags
logs none

Description Dafna Ron 2013-07-09 15:15:20 UTC
Created attachment 771096 [details]
logs

Description of problem:

if we want to delete a volume that has snapshots we need to manually delete the snapshots before deleting the volumes. 
I think that the user should be given a choice if they want to either remove the volume with all its snapshots or not. 

Version-Release number of selected component (if applicable):

openstack-cinder-2013.1.2-3.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. create a volume
2. create a snapshot from the volume
3. try to remove the volume

Actual results:

we will not be able to remove the volume and there is no force param to force remove volume + its snapshots

Expected results:

we should allow the user to remove the volume + its snapshots if they wish instead of having the user delete the snapshots manually. 

Additional info:

[root@opens-vdsb ~(keystone_admin)]# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 7b7acdc1-c1fe-4654-93f9-7c3afc03b395 | available |     test     |  10  |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
[root@opens-vdsb ~(keystone_admin)]# cinder delete 7b7acdc1-c1fe-4654-93f9-7c3afc03b395
ERROR: Invalid volume: Volume still has 1 dependent snapshots
[root@opens-vdsb ~(keystone_admin)]# cinder help delete 
usage: cinder delete <volume>

Remove a volume.

Positional arguments:
  <volume>  ID of the volume to delete.

Comment 1 Eric Harney 2013-07-17 13:04:17 UTC
This should probably be done by having the client perform snapshot-delete and delete volume calls.

Comment 2 Eric Harney 2013-07-22 15:14:23 UTC
Moving back to openstack-cinder, as a different approach has been proposed upstream.

Comment 3 Ayal Baron 2013-12-18 07:55:06 UTC
(In reply to Eric Harney from comment #2)
> Moving back to openstack-cinder, as a different approach has been proposed
> upstream.

Eric, any progress made upstream?

Comment 4 Eric Harney 2013-12-18 13:27:33 UTC
(In reply to Ayal Baron from comment #3)
> Eric, any progress made upstream?

No, I don't think anyone is actively pursuing this at this time.

Comment 6 Yogev Rabl 2014-01-27 09:03:41 UTC
Eric can you please check the test plan for this bug: https://tcms.engineering.redhat.com/plan/12155/openstackcinderrfesdelete-volume-with-snapshot#reviewcases 

and give some feedback.

Comment 7 RHEL Program Management 2014-02-02 10:36:11 UTC
Product Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Comment 8 Maor 2015-05-31 12:39:48 UTC
Is there any chance we can re-discuss this RFE?

removing a volume through an external application will make the process more complex if it will also have to remove all the redundant snapshots as well.

Comment 9 Yaniv Lavi 2015-06-02 13:15:56 UTC
Can you please add a reason for the nack here?

Comment 10 Sergey Gotliv 2015-06-04 07:22:45 UTC
I reopened that case for 8.0.

Comment 11 Sean Cohen 2015-08-24 04:23:26 UTC
Moving to POST as https://review.openstack.org/#/c/201748/ was merged upstream
Sean

Comment 12 Eric Harney 2015-08-24 13:50:28 UTC
(In reply to Sean Cohen from comment #11)

This still needs code written, moving out of POST for now.

Comment 13 Sergey Gotliv 2015-08-27 14:04:41 UTC
Moving to 9.0, it's not ready for 8.0.

Comment 14 Eric Harney 2016-03-10 00:59:52 UTC
Mitaka now supports "cinder delete --cascade" which accomplishes this.

Comment 15 Yaniv Lavi 2016-03-23 09:01:48 UTC
I see the patch is merged, can we backport this to OSP 8?

Comment 16 Mike McCune 2016-03-28 22:33:16 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 17 Sean Cohen 2016-05-05 12:41:36 UTC

*** This bug has been marked as a duplicate of bug 1293185 ***