instance memory save and restore

smooney at redhat.com smooney at redhat.com
Mon Aug 7 11:08:26 UTC 2023


On Mon, 2023-08-07 at 06:22 +0000, Tony Liu wrote:
> Hi,
> 
> VMWare vCenter has such feature to snapshot/save instance memory along with disk.
> Then instance can be reverted to that snapshot later when needed.
> 
> OpenStack doesn't seem to support it. Any plan to work on that?
if you are asking in the context of the libvirt driver then no its not supproted with libvirt
and not planeed to be added in the future. we do not have an api action the corresponds to a live
snapshot with memeory capcture so that would likely need a new api action or at least a modifition
to the exsiting snapshot api. snapshots in openstack are defiend ot only be of the root disk.

libvirt has a managed save api which will save the guest ram to file but i do not bleive there
is a version of that that works without interupting the guest exectuion.
> 
> Actually, I'm looking for the motivation/requirement to for that feature.
this has come up in the past but part of the issue is its not really in line with the cloud computing
usage model. there are uscases for it but its not really a generic capability that is protable to diffent
compute drivers. vmware is not a cloud plathform its an enterprise virtualization system so the intended
use is quite different.  i would be interested to know if aws, azure or gce supported memory snapshoting.

> Typically, we snapshot/backup storage, then restore the storage and restart/reboot
> the host/instance. Would that be sufficient? I think there will be a chance of inconsistence
> between memory and storage.

without knowing hte usecase its hard to say but generally snapshoting the disk and rebooting form it
is less error prone then trying to also restore the memeory. snapshots are used for more then just backup and restore
i.e. they can be used to create multipel new vms by first preparing a vm then snapshoting it and cloning it via booting
new vms with the snapshot. we also use the snapshot for shleve/unshelve.

>  That's why we may need to save the state of both memory
> and storage. Does that make sense?

i understand the usecease but in general i don't know if this is a good fit for openstack.
this type of snapshoting is generally only requried for pet vms not generic cloud workloads.
libvirt has the ablity to create vm memory snapshots 
https://libvirt.org/kbase/snapshots.html#overview-of-manual-snapshots
https://libvirt.org/formatsnapshot.html#snapshot-xml

however it would not be safe to use this type of snapshoting on say a database.
even if the database data was stored on cinder volumes restoring the ram will restructure
the dbms state on that node to the older state which could lead to data corruption.

generally this si only safe for things like virtual desktops, or other similar systems.
the other challenge is the storage or the ram image. it would need to be stored in glance and
you would likely want to consider encrypting it.

There are many edgecases that would need to be blocked such as it is not going to be
possibel to restore a snapshot of memory if you have resized the vm since it was taken.
its also likely not going to be possibel to take a memory snapshot of vms with sr-iov devices,
vgpus or other hardware features like amd SEV encyptetd memroy.
With all that in mind this would requrie a detailed nova spec to cover the usecase, proposed changed
and the upgrade/operator/security/testing aspect of the proposal.


> Any opinions is welcome.
> 
> Thanks!
> Tony
> 
> 




More information about the openstack-discuss mailing list