Temporary snapshot may remain during creating volume by source_volid

Bug #1312718 reported by lirenke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
John Griffith
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

When creating LVM volume by source volume, cinder create source volume's snapshot first, then destination volume and active it, at last copy the volume.

Step:
1. self.create_snapshot
2.self._create_volume
3.self.vg.activate_lv
4.volutils.copy_volume

But If we create or active target volume fail since insufficient free space or other system error for example, the source volume's snapshot wouldn't be remove.

Temporary snapshot would remain, and what is worse we can't delete the source volume successfully.

lirenke (lvhancy)
Changed in cinder:
assignee: nobody → lirenke (lvhancy)
Revision history for this message
Mike Perez (thingee) wrote :

The rest of those calls should be in the try block so that finally block happens.

https://github.com/openstack/cinder/blob/master/cinder/volume/drivers/lvm.py#L294

Changed in cinder:
status: New → Triaged
milestone: none → juno-1
importance: Undecided → Low
Revision history for this message
lirenke (lvhancy) wrote :

yes,agree with you.

Changed in cinder:
milestone: juno-1 → juno-2
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/107414

Changed in cinder:
assignee: lirenke (lvhancy) → John Griffith (john-griffith)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/107414
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=38ed0523125efeaf8383b36d1db169b42e2f5eb6
Submitter: Jenkins
Branch: master

commit 38ed0523125efeaf8383b36d1db169b42e2f5eb6
Author: John Griffith <email address hidden>
Date: Wed Jul 16 08:49:37 2014 -0600

    Don't leave snapshots on the floor

    The current cloning process in the LVM
    driver uses a snapshot to do the data
    copy in the background. Trouble here
    is that if the creation or activation
    of the new volume fails, we don't
    cleanup the snapshot we created.

    Just move the create_volume and activate
    calls down into the try block so the finally
    clause can do the cleanup for us.

    Change-Id: If0fbab9d9f39102cdc7d287527be22c4a2b35934
    Closes-Bug: #1312718

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/108202

Changed in cinder:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/icehouse)

Reviewed: https://review.openstack.org/108202
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=63ba651c128907fc9c95a8d3b8c2a599657e4c41
Submitter: Jenkins
Branch: stable/icehouse

commit 63ba651c128907fc9c95a8d3b8c2a599657e4c41
Author: John Griffith <email address hidden>
Date: Wed Jul 16 08:49:37 2014 -0600

    Don't leave snapshots on the floor

    The current cloning process in the LVM
    driver uses a snapshot to do the data
    copy in the background. Trouble here
    is that if the creation or activation
    of the new volume fails, we don't
    cleanup the snapshot we created.

    Just move the create_volume and activate
    calls down into the try block so the finally
    clause can do the cleanup for us.

    Change-Id: If0fbab9d9f39102cdc7d287527be22c4a2b35934
    Closes-Bug: #1312718
    (cherry picked from commit 38ed0523125efeaf8383b36d1db169b42e2f5eb6)

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-2 → 2014.2
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.