Bug 1024420 - cannot force delete a volume snapshot (which prevents volume delete in case of snapshot delete fails)
Summary: cannot force delete a volume snapshot (which prevents volume delete in case o...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 3.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 9.0 (Mitaka)
Assignee: Eric Harney
QA Contact: Dafna Ron
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-29 15:48 UTC by Yogev Rabl
Modified: 2020-07-16 08:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Improve force-delete capabilities Reason: Result (if any):
Clone Of:
Environment:
Last Closed: 2016-03-10 14:17:35 UTC
Target Upstream Version:


Attachments (Terms of Use)
debug logs (6.23 KB, text/x-log)
2013-10-29 15:48 UTC, Yogev Rabl
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1221458 0 None None None Never
OpenStack gerrit 68890 0 None ABANDONED Add support for snapshot force-delete 2021-01-28 23:58:24 UTC

Description Yogev Rabl 2013-10-29 15:48:49 UTC
Created attachment 817125 [details]
debug logs

Description of problem:
The 'cinder force-delete' command should remove any volume in any state. The command fails when trying to delete a volume that has a snapshot.

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

openstack-nova-compute-2013.1.4-1.el6ost.noarch
openstack-nova-scheduler-2013.1.4-1.el6ost.noarch
python-django-openstack-auth-1.0.6-2.el6ost.noarch
redhat-access-plugin-openstack-1.2.0-6.el6ost.noarch
openstack-utils-2013.1-8.1.el6ost.noarch
openstack-glance-2013.1.4-1.el6ost.noarch
openstack-selinux-0.1.2-10.el6ost.noarch
openstack-cinder-2013.1.4-2.el6ost.noarch
openstack-nova-api-2013.1.4-1.el6ost.noarch
openstack-nova-console-2013.1.4-1.el6ost.noarch
openstack-nova-conductor-2013.1.4-1.el6ost.noarch
openstack-nova-novncproxy-0.4-6.el6ost.noarch
openstack-nova-cert-2013.1.4-1.el6ost.noarch
openstack-quantum-2013.1.4-3.el6ost.noarch
openstack-dashboard-2013.1.4-1.el6ost.noarch
openstack-keystone-2013.1.4-1.el6ost.noarch
openstack-nova-common-2013.1.4-1.el6ost.noarch
openstack-quantum-openvswitch-2013.1.4-3.el6ost.noarch
openstack-packstack-2013.1.1-0.33.dev695.el6ost.noarch

OS version:
Red Hat Enterprise Linux Server release 6.5 Beta

How reproducible:
everytime

Steps to Reproduce:
1. Create a volume 
2. create a snapshot of the volume
3. try to force-delete the volume

Actual results:
The Cinder won't delete a volume with a snapshot

Expected results:
The volume should be deleted.

Additional info:

Comment 2 Eric Harney 2013-10-29 16:24:41 UTC
The only difference between delete and force-delete currently is that force-delete doesn't check what state the volume is in when attempting the delete.  The operation can still fail for any number of reasons.

# cinder help force-delete
...
Attempt forced removal of a volume, regardless of its state.
..

Comment 3 Dafna Ron 2014-02-04 10:58:43 UTC
changing this bug since the actual problem is that if a snapshot cannot be deleted we also cannot remove the volume. 
to solve the issue, after discussing with Ayal, we should add a way to force delete a snapshot.

Comment 4 Eric Harney 2014-02-04 15:30:35 UTC
There is already a different way to achieve this:

cinder snapshot-reset-state --state error <snap>
cinder delete <snap>

Comment 5 Dafna Ron 2014-02-10 09:06:59 UTC
this is not a way to force remove a snapshot since if a failure happens and we cannot delete the snapshot, resetting the state will not help the second time. 
we need a way to force remove a snapshot regardless of any errors during delete.

Comment 6 Eric Harney 2014-02-10 14:13:28 UTC
(In reply to Dafna Ron from comment #5)

I don't think Cinder can be expected to behave that way.  If Cinder "removes" the snapshot regardless of the state of the storage backend, it's leaving things in an inconsistent state.  At worst, this may break things, or at best, is pretty messy, because then Cinder allows you leak resources (i.e. snapshots / storage use on a SAN) which would cause all kinds of headaches with manual cleanup, actual storage use being more than what the quota allows, etc.

If there is some case where this is desirable, it would have to be put into cinder-manage and not a normal API/client operation.

Comment 7 Dafna Ron 2014-02-10 16:03:50 UTC
There are plenty of cases where we would need this now since both Yogev and I encountered these situation in our tests. 
not sure why this cannot be in API/Client? don't nanny the user... if they use --force it's their problem no?

Comment 8 Geoff Willett 2014-04-24 12:11:09 UTC
I hit this issue when XIV had insufficient room to create the snapshot in the pool - so agree a force-delete for snapshots is required (and up to the user to tidy-up any back-end storage 'orphans').

Comment 13 Sean Cohen 2016-03-10 14:38:14 UTC
See bug 1293185


Note You need to log in before you can comment on or make changes to this bug.