I am trying to live-snapshot using KVM as per this procedure.
I must have messed up at some point because I'm in a state I don't understand.
My VM is called prod
. It was created in file /srv/vm/prod.qcow2
.
Apparently, there is no running snapshot: I'm working on the base file. I can guess because the modification date of file /srv/vm/prod.qcow2
changes every minute or so. Besides, this command confirms it:
# virsh domblklist prod
Target Source
------------------------------------------------
vda /srv/vm/prod.qcow2
And there is nothing to blockcommit:
# virsh blockcommit prod vda --active --pivot
error: invalid argument: top '/srv/vm/prod.qcow2' in chain for 'vda' has no backing file
However, libvirt keeps trace of an old snapshot:
# virsh snapshot-list prod
Name Creation Time State
------------------------------------------------------------
snap 2015-06-09 12:11:33 +0200 disk-snapshot
Its descriptor file is /var/lib/libvirt/qemu/snapshot/prod/snap.xml
:
<domainsnapshot>
<name>snap</name>
<state>disk-snapshot</state>
<creationTime>1433844693</creationTime>
<memory snapshot='no'/>
<disks>
<disk name='vda' snapshot='external' type='file'>
<driver type='qcow2'/>
<source file='/srv/vm/snap.qcow2'/>
</disk>
</disks>
[...]
The source file /srv/vm/snap.qcow2
was deleted.
Considering the method I'm trying to implement, it is pretty likely that this snapshot was created with the following command:
virsh snapshot-create-as --domain prod snap --diskspec vda,file=/srv/vm/snap.qcow2 --disk-only --atomic
I can't remove it:
# virsh snapshot-delete prod snap
error: Failed to delete snapshot snap
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
So I am in a state where a snapshot was created, is apparently no longer used, and can't be deleted.
Is there something I can do about it?
Should I care or can I just ignore it?
Edit
I just removed the snapshot file descriptor.
# systemctl stop libvirt
# mv /var/lib/libvirt/qemu/snapshot/prod/snap.xml /home/jerome
# systemctl start libvirt
My VM is up again and I don't see any reference to the snapshot anymore.
# virsh snapshot-list prod
Name Creation Time State
------------------------------------------------------------
Nothing in virt-manager either.
Am I fine or is there still some housekeeping to do?
Edit 2
Apparently, passing -–no-metadata
to virsh snapshot-create-as
would avoid this issue by not creating the .xml file, thus keeping no trace of the snapshot.