[virt-tools-list] Saved VM state not part of snapshot?

Michael Weiser michael at weiser.dinsnail.net
Thu Nov 14 15:11:13 UTC 2019


Hello Cole,

thanks for getting back to me.

On Tue, Nov 12, 2019 at 12:08:20PM -0500, Cole Robinson wrote:

> > - create a snapshot of this suspended state including disk and memory
> Since the VM is shutoff, this is actually only snapshotting disk
> contents. So it's no different than snapshotting an offline VM.
[...]
> I assume at this last step, you mean 'revert to the saved snapshot'. So
> the disk contents have been reset to the contents at step 3, and the VM
> is shutoff. But the disk contents at step 3 were essentially the mid
> flight disk contents from the 'save' operation.

Correct. Sorry for not laying it out more clearly.

> Yes we need fixes here. Libvirt should be rejecting some of these cases
> I think but virt-manager can help here too.

> * Run/Revert of a snapshot should be rejected if the VM is in the
> 'Saved' state, aka has been 'virsh managedsave'. This should be done at
> the libvirt level for completeness IMO. Maybe the API needs a flag to
> override this behavior if users know what they are doing

> * virt-manager prompts to discard saved state first otherwise it doesn't
> all snapshot revert.

> * Maybe reject snapshot creation when VM is in 'saved' state too, to
> avoid ambiguity, but it's likely not as bad.

Instead of handling the symptoms, might it be easier to try and make the
saved memory state become part of the snapshot then? I could think of
moving the .save file from the qemu/save into the
qemu/snapshot/<snapshot name> directory. Or resume the saved state into
a running but paused VM and snapshot that so it becomes part of the
snapshot by the native qemu mechanism.

> Bug reports and/or patches for these are welcome, I can help provide
> patch guidance if needed

TBH patching libvirt and virt-manager on this scale is a bit beyond what
I can do. But I could certainly open some bug reports and help with
testing.
-- 
Thanks,
Michael





More information about the virt-tools-list mailing list