Bug 663586 - Can't remove child snapshot when parent snapshot has been deleted
Summary: Can't remove child snapshot when parent snapshot has been deleted
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Linux
low
high
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-16 09:57 UTC by Justin Clift
Modified: 2015-07-13 04:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-04 17:46:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Justin Clift 2010-12-16 09:57:50 UTC
Description of problem:

  With libvirt 0.8.3, when snapshots are linked to their parent snapshot, if the parent snapshot is deleted, the snapshot chain becomes broken.  Deleting a child snapshot then terminates with an error message:

    error: Domain snapshot not found: no domain snapshot parent with matching 
    name '1291813671'

  I can reproduce this using the following sequence of commands for my test-domain called "test" using a single qcow2 image:

    # virsh snapshot-create test # 1291813670
    # virsh snapshot-create test # 1291813671
    # virsh snapshot-create test # 1291813672
    # virsh snapshot-delete test 1291813671
    # virsh snapshot-delete test 1291813672

  Reverting to such an unlinked snapshot is still possible, but deleting it doesn't work.


Version-Release number of selected component (if applicable):

  0.8.3.


How reproducible:

  Every time.


Expected results:

  The unlinked child snapshot should be deleted when requested, instead of generating the error message about a missing parent snapshot.


Additional info:

  This error was reported by Philipp Hahn on the libvirt developers mailing list:

    https://www.redhat.com/archives/libvir-list/2010-December/msg00386.html

Comment 1 Justin Clift 2010-12-16 22:13:06 UTC
Philipp, how big a problem is this?  Is it a matter of the snapshots hanging around, or does it prevent the guest from operating?

Comment 2 Philipp Hahn 2010-12-17 08:43:58 UTC
(In reply to comment #1)
> Philipp, how big a problem is this?  Is it a matter of the snapshots hanging
> around, or does it prevent the guest from operating?

Snapshots still work: I can revert back to them just fine.
Only if I try to delete a snapshot whichs parent snapshot is already deleted, this operation fails.
This is because the the snapshot contains a reference to the parent snapshot, which is than dangling. If I edit the snapshot file /var/lib/libvirt/qemu/snapshot/$VM_NAME/$SNAPSHOT_NAME.xml by hand and remove the danling /domainsnapshot/parent/name entity, I can than delete the snapshot using libvirt.

Comment 3 Justin Clift 2011-01-04 17:46:58 UTC
This has been fixed upsteam:

  https://www.redhat.com/archives/libvir-list/2010-December/msg00935.html


Note You need to log in before you can comment on or make changes to this bug.