<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 3 Jan 2021 at 15:30, Peter Krempa <<a href="mailto:pkrempa@redhat.com" target="_blank">pkrempa@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi,<br></blockquote><div><br></div><div><br></div><div><div>Hi Peter,</div><div><br></div><div>Thanks a lot for the prompt reply and for pointing me to the direction ("virsh restore" among all) and apologies for my very late reply. <br></div><div>In the past couple of weeks I had a thorough look at past messages in the mailing list as well as linked tutorials, notes and slides.  </div></div><div><br></div><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The memory image created by libvirt this way is actually in the same<br>
image format as 'virsh save' and 'virsh restore' uses. <br> [...]<br></blockquote><div><br></div><div> I think I bumped into two limitations for my particular use case, but I'd like to double check with you, just in case I'm again missing something.</div><div><div><br></div><div>1) When creating an external online snapshot (disks+memory) of a qemu-KVM VM, I'd like to store the backing files in a separate folder and rename the newly-created delta files with the respective names of the original disks (now the backing files). Is this possible at all? Say a VM has a disk vm/disk1.qcow2 and I take an external snapshot, I'd like the backing file to appear in snap/disk1.qcow2 and the new delta disk to appear as vm/disk1.qcow2. Currently I wait for the VM to be shutdown by the user before I move around disks as desired and run qemu-img rebase in unsafe mode to update the delta disks. Can I accomplish the same result while the VNF is running?</div><div><br></div><div>2) As you suggested, I now use "virsh restore" to launch a VM with the memory state I had previously backed up. The "virsh restore" API applies to a VM that is not running. However, I see that for internal snapshots, libvirt also supports a snapshot-revert operation on a /live/ VM. Is this possible at all with an external snapshot? If so, what are the commands needed? My current way of automating a snapshot-revert with an external online snapshot only applies to a shutdown VM. It consists in:</div><div>- shutting down the VM;</div><div>- erasing all its delta disks, replacing them with new ones;</div><div>- executing "virsh restore" on the memory state, making sure that the disk paths referenced in the embedded XML file are correct.<br></div><div>Does this seem reasonable? Can I do the same while the VNF is running?<br></div><div>I suppose that for a snapshot-delete operation on a live VM I just need to run "virsh blockpull" on each disk, but I couldn't figure out how to do a revert.</div><div><br></div><div></div><div></div><div>Thanks again!</div><div><br></div><div>Riccardo</div></div></div></div>
</div>