No notification sent deleting a volume that doesn't have a real backing volume

Bug #1257053 reported by Jay Bryant on 2013-12-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
High
Jay Bryant
Havana
Undecided
Unassigned

Bug Description

If you try to delete a cinder volume that only exists in the database and doesn't refer to a real SAN volume, the volume is deleted from the database, but no AMQ notification is sent. Therefore third party GUI's that watch for notification events do not know that they should refresh, so the user must refresh the GUI manually.

There are situations where volume creation fails during the scheduling phase, which results in a volume getting created in the database, but no real volume is created on the SAN. The volume in the database is left in Error state.

The reason for this issue is that in cinder/volume/api.delete(), it finds that there is no volume['host'], and so it just removes the volume from the database, but never attempts to delete the actual volume (because there is no actual volume). The notifications are only sent when it deletes the actual volume.

It seems like it should be ok to send an AMQ notification so that the GUI can catch the fact that a delete had started and then handle the fact that there is no host further down the line. Perhaps there is an easier way to just send a notification.

It looks like other places in the code they do a 'notify_about_volume_usage' with a delete.start and a delete.end . Is there a reason that isn't done before and after the db.volume_destroy in volume.api.delete() ? It appears adding the notifications there could resolve the user's problem.

Jay Bryant (jsbryant) on 2013-12-03
Changed in cinder:
assignee: nobody → Jay Bryant (jsbryant)

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

Changed in cinder:
status: New → In Progress

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

commit a347b99c261dc1c761a8bc51c2aee99d20161ca6
Author: Jay S. Bryant <email address hidden>
Date: Tue Dec 3 21:31:17 2013 -0600

    delete.start/delete.end notification for hostless

    Third party GUIs may rely on notifications to track the
    progress of volume creation and deletion. In the case that
    a volume is being deleted after a failed attempt to create
    (the volume is listed in the database but is not actually
    resident in a backing store) the path that is taken in
    volume.api.delete() makes no notifications of deletion
    occurring.

    This patch adds a volume_utils.notify_about_volume_usage
    call to the beginning and end of the delete with a
    delete.start and delete.end respectively. The notifications
    serve as triggers for GUIs to refresh the state of the
    volume. This change makes the hostless delete path's
    functionality more consistent with the other paths through
    the delete code.

    Change-Id: I091b9d277834b341105569d41a48ef5c1fc105ce
    Closes-Bug: 1257053

Changed in cinder:
status: In Progress → Fix Committed
Jay Bryant (jsbryant) on 2013-12-11
Changed in cinder:
importance: Undecided → High
tags: added: havana-backport-potential
Thierry Carrez (ttx) on 2014-01-22
Changed in cinder:
milestone: none → icehouse-2
status: Fix Committed → Fix Released

Reviewed: https://review.openstack.org/61484
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=56ac7e2614b499fbc7e145de9021df9b9e79b5ca
Submitter: Jenkins
Branch: stable/havana

commit 56ac7e2614b499fbc7e145de9021df9b9e79b5ca
Author: Jay S. Bryant <email address hidden>
Date: Tue Dec 3 21:31:17 2013 -0600

    delete.start/delete.end notification for hostless

    Third party GUIs may rely on notifications to track the
    progress of volume creation and deletion. In the case that
    a volume is being deleted after a failed attempt to create
    (the volume is listed in the database but is not actually
    resident in a backing store) the path that is taken in
    volume.api.delete() makes no notifications of deletion
    occurring.

    This patch adds a volume_utils.notify_about_volume_usage
    call to the beginning and end of the delete with a
    delete.start and delete.end respectively. The notifications
    serve as triggers for GUIs to refresh the state of the
    volume. This change makes the hostless delete path's
    functionality more consistent with the other paths through
    the delete code.

    Change-Id: I091b9d277834b341105569d41a48ef5c1fc105ce
    Closes-Bug: 1257053
    (cherry picked from commit a347b99c261dc1c761a8bc51c2aee99d20161ca6)

tags: added: in-stable-havana
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers