<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-05-28 11:10 GMT+03:00 Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Thu, May 28, 2015 at 10:57:51AM +0300, NoxDaFox wrote:<br>
> 2015-05-28 10:40 GMT+03:00 Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>>:<br>
><br>
> > On Thu, May 28, 2015 at 10:33:48AM +0300, NoxDaFox wrote:<br>
> > > To create the snapshots I'm using the libvirt command snapshotCreateXML<br>
> > > with no flag set. Does libvirt support consistent snapshotting or shall I<br>
> > > rely on QEMU backup new feature only?<br>
> ><br>
> > According to: <a href="http://wiki.libvirt.org/page/Snapshots" target="_blank">http://wiki.libvirt.org/page/Snapshots</a><br>
> > virDomainSnapshotCreateXML is only consistent if the guest is paused<br>
> > during the operation.<br>
> ><br>
> > The new qemu feature is called drive-backup<br>
> > (<a href="http://wiki.qemu.org/Features/IncrementalBackup" target="_blank">http://wiki.qemu.org/Features/IncrementalBackup</a>).  Unless things<br>
> > changed recently, it is not exposed through libvirt, so the only way<br>
> > to use it is by sending qemu monitor commands<br>
> > (<br>
> > <a href="http://kashyapc.com/2013/03/31/multiple-ways-to-access-qemu-monitor-protocol-qmp/" target="_blank">http://kashyapc.com/2013/03/31/multiple-ways-to-access-qemu-monitor-protocol-qmp/</a><br>
> > ).<br>
> ><br>
> > This is all pretty bleeding edge.  I still think you'd be better off<br>
> > just ignoring snapshots that fail and moving on to the next one.<br>
> ><br>
> > Rich.<br>
><br>
><br>
> I might be missing something then as the guest is actually paused during<br>
> the acquisition of the snapshot.<br>
><br>
> I pause the guest, take a screenshot, a core dump and a snapshot, then I<br>
> resume the guest. Proof is that I can clearly analyse the memory core dump<br>
> without any problem.<br>
<br>
</span>Note a core dump doesn't normally include the guest's disk.  It just<br>
contains the guest's memory, so it's not relevant for consistency.<br>
<span class=""><br>
> Maybe I am breaking the disk's consistency once I extract the dump through<br>
> the qemu-img command?<br>
><br>
> The command is:<br>
> qemu-img convert -f qcow2 -o backing_file=guest_disk.qcow2 -O qcow2 -s<br>
> snapshot_n guest_disk.qcow2 new_disk_for_libguestfs.qcow2<br>
<br>
</span>Is the guest paused when you do this?  If not, then this will create<br>
an inconsistent snapshot.<br>
<span class=""><br>
> Could it be that, as the backing file is pointing to the guest's disk which<br>
> will evolve in time, when guestfs tries to read the data sees<br>
> incosistencies?<br>
<br>
</span>qemu-img convert makes a full copy, so it's not guestfs that's the<br>
problem, but qemu-img.  The copy is not done instantaneously.<br>
<span class=""><br>
> The guest_disk.qcow2 is a COW clone of a base_disk.qcow2, what if I rebase<br>
> the new_disk_for_libguestfs.qcow2 to the base_disk.qcow2?<br>
<br>
</span>Many copies and snapshots.  I'm thoroughly confused ...<br>
<br>
Anyhow, unless you either make a full copy while the guest is paused,<br>
*or* you use a point-in-time snapshot feature of either qemu<br>
(drive-backup) or your host filesystem, you're not making a consistent<br>
snapshot.<br>
<span class=""><br>
Rich.</span></blockquote><div><br></div><div>Ok I definitely got confused with the APIs then.<br><br></div><div>I thought the guest was supposed to be paused only when calling <span class="">virDomainSnapshotCreateXML not also afterwards when creating the new disk file with qemu-img. <br><br></span></div><div><span class="">I made a couple of changes and the hive corruption issue seems to be gone. The "RuntimeError: file receive cancelled by daemon" still persists. From the guestfs trace I can't see any evidence if not what seems a sort of overflow:<br><br>sha1sum: ./Windows/Prefetch/ReadyBoot/Trace2.fx: Value too large for defined data type<br>[   65.347452] perf interrupt took too long (5124 > 5000), lowering kernel.perf_event_max_sample_rate to 25000<br>[  139.668206] perf interrupt took too long (10140 > 10000), lowering kernel.perf_event_max_sample_rate to 12500<br>pclose: /: Success<br>guestfsd: main_loop: proc 244 (checksums_out) took 244.89 seconds<br>libguestfs: trace: checksums_out = -1 (error)<br><br></span></div><div><span class="">Is there something else wrong?<br><br></span></div></div><br></div></div>