Snapshots for NFS/GlusterFS created in error state, but can't be deleted

Bug #1156686 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Eric Harney

Bug Description

$ cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 89679639-b2f8-4e1b-b94e-1b36db5a90a7 | available | None | 1 | None | false | |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
$ cinder snapshot-create 89679639-b2f8-4e1b-b94e-1b36db5a90a7
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| created_at | 2013-03-18T16:09:44.041355 |
| display_description | None |
| display_name | None |
| id | 2c44b518-46a0-465a-90e6-c01b2f3f8dae |
| metadata | {} |
| size | 1 |
| status | creating |
| volume_id | 89679639-b2f8-4e1b-b94e-1b36db5a90a7 |
+---------------------+--------------------------------------+
$ cinder snapshot-list
+--------------------------------------+--------------------------------------+--------+--------------+------+
| ID | Volume ID | Status | Display Name | Size |
+--------------------------------------+--------------------------------------+--------+--------------+------+
| 2c44b518-46a0-465a-90e6-c01b2f3f8dae | 89679639-b2f8-4e1b-b94e-1b36db5a90a7 | error | None | 1 |
+--------------------------------------+--------------------------------------+--------+--------------+------+
$ cinder snapshot-delete 2c44b518-46a0-465a-90e6-c01b2f3f8dae
$ cinder snapshot-list
+--------------------------------------+--------------------------------------+----------------+--------------+------+
| ID | Volume ID | Status | Display Name | Size |
+--------------------------------------+--------------------------------------+----------------+--------------+------+
| 2c44b518-46a0-465a-90e6-c01b2f3f8dae | 89679639-b2f8-4e1b-b94e-1b36db5a90a7 | error_deleting | None | 1 |
+--------------------------------------+--------------------------------------+----------------+--------------+------+

The error for the snapshot is expected, since snapshots are not supported. But, the snapshot can't be deleted.

In cinder-volume log:

2013-03-18 12:09:53.389 DEBUG cinder.volume.manager [req-473f1bd4-492b-46b2-98f6-bf6c88a27d99 9022a713a98e4678ac54507edc74a001 b9d869ad0a7246e6a3a1aec831d15d76] snapshot snapshot-2c44b518-46a0-465a-90e6-c01b2f3f8dae: deleting from (pid=28964) delete_snapshot /opt/stack/cinder/cinder/volume/manager.py:478
2013-03-18 12:09:53.437 ERROR cinder.openstack.common.rpc.amqp [req-473f1bd4-492b-46b2-98f6-bf6c88a27d99 9022a713a98e4678ac54507edc74a001 b9d869ad0a7246e6a3a1aec831d15d76] Exception during message handling
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/openstack/common/rpc/amqp.py", line 430, in _process_data
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/openstack/common/rpc/dispatcher.py", line 133, in dispatch
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/manager.py", line 490, in delete_snapshot
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp {'status': 'error_deleting'})
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp self.gen.next()
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/manager.py", line 479, in delete_snapshot
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp self.driver.delete_snapshot(snapshot_ref)
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp File "/opt/stack/cinder/cinder/volume/drivers/nfs.py", line 72, in delete_snapshot
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp raise NotImplementedError()
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp NotImplementedError
2013-03-18 12:09:53.437 TRACE cinder.openstack.common.rpc.amqp

This is because the default driver class in Grizzly does a raise NotImplementedError() for both create_snapshot and delete_snapshot. For delete_snapshot, the driver needs to do nothing rather than raise this exception. For NFS and Gluster, this can be done in RemoteFsDriver.

Eric Harney (eharney)
Changed in cinder:
assignee: nobody → Eric Harney (eharney)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/24651
Committed: http://github.com/openstack/cinder/commit/ea10f1b8291cb07962577699abe13648a4bdca58
Submitter: Jenkins
Branch: master

commit ea10f1b8291cb07962577699abe13648a4bdca58
Author: Eric Harney <email address hidden>
Date: Mon Mar 18 12:21:40 2013 -0400

    Allow snapshot_delete for NFS/GlusterFS drivers

    RemoteFsDriver should allow snapshot_delete, since snapshot_create
    for NFS and GlusterFS volumes will create a snapshot in the error
    state which cannot be deleted afterward.

    snapshot_delete() should allow this to be removed rather than
    throwing NotImplementedError.

    Fixes bug: 1156686

    Change-Id: I4307878fa97fbce5bd733a83fa172509e2fba8ce

Changed in cinder:
status: In Progress → Fix Committed
Changed in cinder:
importance: Undecided → High
milestone: none → grizzly-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/25098

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (milestone-proposed)

Reviewed: https://review.openstack.org/25098
Committed: http://github.com/openstack/cinder/commit/e35c357ec070a16887c62062b2cd1c46aeabba45
Submitter: Jenkins
Branch: milestone-proposed

commit e35c357ec070a16887c62062b2cd1c46aeabba45
Author: Eric Harney <email address hidden>
Date: Mon Mar 18 12:21:40 2013 -0400

    Allow snapshot_delete for NFS/GlusterFS drivers

    RemoteFsDriver should allow snapshot_delete, since snapshot_create
    for NFS and GlusterFS volumes will create a snapshot in the error
    state which cannot be deleted afterward.

    snapshot_delete() should allow this to be removed rather than
    throwing NotImplementedError.

    Fixes bug: 1156686

    Change-Id: I4307878fa97fbce5bd733a83fa172509e2fba8ce
    (cherry picked from commit ea10f1b8291cb07962577699abe13648a4bdca58)

Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-rc2 → 2013.1
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.