[fedora-virt] How to revert an external snapshot

Cole Robinson crobinso at redhat.com
Wed Mar 4 17:01:53 UTC 2015

On 03/04/2015 11:43 AM, Dario Lesca wrote:
> Il giorno mer, 04/03/2015 alle 09.49 -0500, Cole Robinson ha scritto:
>> On 03/04/2015 09:16 AM, Dario Lesca wrote:
>>> I have generate an external snapshot with this command:
>>> ...
>>> There is some way to revert my vm to previous state?
>> You can do it by hand: Power off the VM, edit the XML to point at the desired
>> disk image.
> Ok, thanks Cole, I have modify the point at the disk image to original
> root disk image:
>         before "<source file='/virt/win7-64-snap1.qcow2'/>"
>         after "<source file='/virt/win7-64.qcow2'/>"
> Then I have remove the image overlay /virt/win7-64-snap1.qcow2
> Now all work fine.
>> However, if you point at the root file and make disk changes, the snapshot
>> overlay will then become invalid. So if you want to use the root contents
>> again, you'll need to create another overlay based on the root image, and
>> point your VM at that. This confusion is one of the reasons that stuff isn't
>> implemented in libvirt yet
> But now when I list snapshot the snapshot removed is showed:
>> [root at dodo:/virt]# virsh snapshot-list win7-64
>> Nome                 Creation Time             Stato
>> ------------------------------------------------------------
>> win7-64-snap1        2015-03-04 14:21:15 +0100 shutoff
> So, I have remove the machine and recreate it and the snapshot is gone
> away.

For that last bit, you should be able to do:

sudo virsh snapshot-delete --metadata $snapshot-name

- Cole

More information about the virt mailing list