volume is not deleted on instance delete if resize volume is performed on an instance

Bug #1326463 reported by Saurabh Surana
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Shayne Burgess

Bug Description

If volume support is enabled and user performs a resize volume operation on an instance then on the instance delete, corresponding volume in nova is not deleted.

I think the reason for this is that there is no explicit volume delete action that trove performs and it relies on nova to cleanup the volumes on instance delete. But if volume is resized then nova doesn't delete the corresponding volume on instance delete

Revision history for this message
Denis M. (dmakogon) wrote :

Good day, Saurabh.
Could you please provide steps-to-reproduce? Thanks

Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

Yes, I was able to replicate the bug ... experiencing the same ....
this is bad the attach/detach of cinder volume from nova instance is making it bad ....

Seems like on deletion nova just frees the volume resource from nova instance.

Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

Ok I think I got this, when we are creating the instance we allocate volume as the block_device, now with block-device-mapping, while creating nova servers there is an option for "delete-on-terminate" which is set to true by default which is why if we are just creating a nova instance and later delete that from trove with volume support on then with nova instance, the volume also goes.

But when we attach the volume after resize, there is no option to provide a mapping and this parameter/attribute "delete-on-terminate" does not gets set to True, which is why after deletion of Nova instance, volumes are left in the system.

Changed in trove:
assignee: nobody → Sushil Kumar (sushil-kumar2)
Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

Probably the solution lies in simply checking the status of cinder volume after nova server deletion and if it exists, delete the same too.

Revision history for this message
Denis M. (dmakogon) wrote :

It seems that's bug for nova/cinder provisioning. Heat provisioning is not affected.

Changed in trove:
status: New → Triaged
importance: Undecided → Medium
milestone: none → juno-2
Changed in trove:
milestone: juno-2 → juno-3
Changed in trove:
milestone: juno-3 → next
Revision history for this message
Amrith Kumar (amrith) wrote :

Retained importance to "Medium" and marking as unassigned (bugscrub, 2014-10-23)

Changed in trove:
assignee: Sushil Kumar (sushil-kumar2) → nobody
Changed in trove:
assignee: nobody → Shayne Burgess (shayne-burgess)
milestone: next → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

Changed in trove:
status: Triaged → In Progress
Changed in trove:
milestone: kilo-1 → kilo-2
Changed in trove:
assignee: Shayne Burgess (shayne-burgess) → Nikhil Manchanda (slicknik)
Changed in trove:
assignee: Nikhil Manchanda (slicknik) → Shayne Burgess (shayne-burgess)
Changed in trove:
milestone: kilo-2 → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/137452
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=2d4cd5fae1b07e09d5c70ec3736a18737795a6c5
Submitter: Jenkins
Branch: master

commit 2d4cd5fae1b07e09d5c70ec3736a18737795a6c5
Author: shayne-burgess <email address hidden>
Date: Wed Nov 26 10:57:15 2014 -0800

    Deletes volume on instance delete after resize

    When nova deletes a instance, if the volume has been attached
    during the lifetime of the instance it does not delete the volume.
    If a volume is resized we detach-reattach the volume resulting in
    the resource not being cleaned up after delete of trove instance.
    The orphaned volumes will just pile up if there are many resize
    operations.

    Change-Id: I29df5b197bd90c80cf1b98361ae28d05e3c7adc2
    Closes-Bug: #1326463

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: kilo-3 → 2015.1.0
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.