On Jun 30, 2017 6:22 AM, "Peter Krempa" <pkrempa@redhat.com> wrote:
>
> 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 -
>
Thanks for the reply! The original image is still there. Only the 1st and only top-level snapshot is deleted.
the blockcommit fails though:
[root@vm1 ~]# virsh blockcommit serv1r2 vda --active --pivot
error: block copy still active: disk 'vda' already in active block job