Re: recovering from deleted snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 30, 2017 at 12:05:47 +0200, Peter Krempa wrote:
> On Thu, Jun 22, 2017 at 11:02:41 -0400, Doug Hughes wrote:
> 
> [...]
> 
> >  virsh blockcommit $vm $DISK --active --pivot
> > 
> > Normally this works fine, though something went wrong on the 20th.
> > something happened to make the blockcommit fail, but the -snap file got
> > deleted (note to self - check return code from blockcommit command!)
> > 
> > So now I'm in a state. The domain i still running. but it's running off
> > the -snapshot that is in the xml. I googled around for how to recover a
> > blockcommit from a deleted snapshot, but didn't find anything. (pointers
> > welcome)

In fact, it's way simpler. If libvirt still knows about the overlay
image (this is necessary only so that it can say the proper things to
qemu) you can re-do the block commit:

$ virsh list
 Id    Name                           State
----------------------------------------------------
 3     fedora23                       running

$ virsh snapshot-create-as --disk-only --no-metadata fedora23
Domain snapshot 1498817916 created
$ virsh domblklist fedora23
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/fedora23.1498817916
hda        -

$ rm /var/lib/libvirt/images/fedora23.1498817916
$ ls /var/lib/libvirt/images/fedora23.1498817916
ls: cannot access '/var/lib/libvirt/images/fedora23.1498817916': No such file or directory
$ virsh blockcommit --active --pivot fedora23 vda

Successfully pivoted
$ virsh domblklist fedora23
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/fedora23.qcow2
hda        -

Attachment: signature.asc
Description: Digital signature

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users

[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux