volume/snapshots takes very long to delete

Bug #889299 reported by Gaurav Gupta
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Pádraig Brady

Bug Description

I have a large number of snapshots created from a volume. These are COW snapshots so the actual disk space they take is not large, but when I try to delete them using the OSAPI, it takes a very long time to delete each one of them. The volumes and snapshots are based on LVM.

Looking at the code, nova-volumes clears the volume/snapshots using "dd if=/dev/zero of=/dev/mapper/<vol-name>", which is what takes a long time for large volumes/snapshots. This should be done in a lazy fashion (as mentioned in a TODO comment in the code).

Revision history for this message
Brian Waldon (bcwaldon) wrote :

Yep, I've seen this, too. It would be great to speed this up, but it isn't clear how to do so.

tags: added: volume
Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Vish Ishaya (vishvananda) wrote :

Perhaps a periodic callback, with a utils.synchronized so only one delete can be happening at once? We could put them into a new state that isn't shown to the api, but not actually mark them deleted until the dd is done.

Revision history for this message
Beraldo (beraldo) wrote :

Is there any problem with doing just a "lvremove"?

James Troup (elmo)
tags: added: canonistack
Revision history for this message
Vish Ishaya (vishvananda) wrote :

Beraldo: yes, the lvremove happens after the dd. If you don't dd the data, a subsequent lvcreate can leak the data that was on the old volume. This is a security issue.

Revision history for this message
Beraldo (beraldo) wrote :

Understand.

If we can pass this option to user decide ? a -f option for a fast and insecure ? (only lvremove) and a normal option that does a full dd + lvremove ?

Revision history for this message
Tushar Patil (tpatil) wrote :

Because of this problem, we cannot contribute volume snapshot blackbox tests to tempest.
In my environment, I have observed deletion of volume is faster than snapshot.

Changed in nova:
assignee: nobody → Pádraig Brady (p-draigbrady)
status: Confirmed → In Progress
Revision history for this message
Pádraig Brady (p-draigbrady) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/72656
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=71946855591a41dcc87ef59656a8a340774eeaf2
Submitter: Jenkins
Branch: master

commit 71946855591a41dcc87ef59656a8a340774eeaf2
Author: Pádraig Brady <email address hidden>
Date: Tue Feb 11 11:51:39 2014 +0000

    libvirt: support configurable wipe methods for LVM backed instances

    Provide configurable methods to clear these volumes.
    The new 'volume_clear' and 'volume_clear_size' options
    are the same as currently supported by cinder.

    * nova/virt/libvirt/imagebackend.py: Define the new options.
    * nova/virt/libvirt/utils.py (clear_logical_volume): Support the
    new options. Refactor the existing dd method out to
    _zero_logic_volume().
    * nova/tests/virt/libvirt/test_libvirt_utils.py: Add missing test cases
    for the existing clear_logical_volume code, and for the new code
    supporting the new clearing methods.
    * etc/nova/nova.conf.sample: Add the 2 new config descriptions
    to the [libvirt] section.

    Change-Id: I5551197f9ec89ae2f9b051696bccdeb1af2c031f
    Closes-Bug: #889299

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.