Delete does not clean up pending resize files

Bug #1308565 reported by John Warren
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Warren

Bug Description

If an instance is deleted while a resize operation is in progress (i.e. before the VM state is RESIZED), the temporary files created during the resize operation (e.g. <instance_id>_resize with libvirt) are not cleaned up. This would seem to be related to bug 1285000, except in that case the temporary files are on a different node. Ideally a fix would address both.

Tags: compute resize
Revision history for this message
Dan Smith (danms) wrote :

This is with master, I assume?

Are you planning to work on this?

Changed in nova:
importance: Undecided → Medium
Tracy Jones (tjones-i)
tags: added: compute
Revision history for this message
John Warren (jswarren) wrote :

I plan on working on this, but at the moment I'm contemplating how to proceed. It may be a while before I submit a fix. I was thinking this would go into the master branch.

melanie witt (melwitt)
Changed in nova:
status: New → Confirmed
Revision history for this message
John Warren (jswarren) wrote :
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Tracy Jones (tjones-i) wrote :

John - can you assign this to yourself if you are working on it?

Changed in nova:
status: In Progress → Triaged
John Warren (jswarren)
Changed in nova:
assignee: nobody → John Warren (jswarren)
status: Triaged → In Progress
Matt Riedemann (mriedem)
tags: added: resize
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/99472
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=98e6891dfd4408c56644f55fe3cff88703beb4bf
Submitter: Jenkins
Branch: master

commit 98e6891dfd4408c56644f55fe3cff88703beb4bf
Author: John Warren <email address hidden>
Date: Wed Jun 11 20:29:28 2014 +0000

    Check for resize path on libvirt instance delete

    If an instance is deleted after the instance's disk image path has
    been renamed by adding the "_resize" suffix to it but before the
    resize operation completes, the libvirt driver will not delete the
    orphaned files and manual intervention is needed to get them deleted.

    This fix addresses the issue by attempting to rename the instance path
    by adding a "_del" suffix and if that fails, renaming the instance path
    with the "_resize" suffix by replacing the "_resize" suffix with the
    "_del" suffix. If both renaming operations fail, the sequence is
    repeated, in case the the disk image path initially had the "_resize"
    suffix and another thread removed it before the second rename operation
    was attempted. These rename operations are used in favor of checking
    for the existence of paths and deleting if found, because rename
    operations are atomic whereas another thread could rename the path
    between the exist check and the deleting.

    Regardless of the outcome of the renaming operations, the existence of
    the instance path with the "_del" suffix is verified and if it exists,
    it is deleted. This is done in case a prior delete operation that
    managed to create the "_del" path was subsequently interrupted before
    all instance files could be deleted.

    Note that the LibvirtConnTestCase.test_delete_instance_files test case
    was removed in order to eliminate redundancy.

    Closes-Bug: #1308565

    Change-Id: Ifcb2e18211347ccf3e5472779c5917a729a6eced

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