[nova] Can OpenStack support snapshot rollback (not creating a new instance)?
Hello, I use Ceph as the storage backend for Nova, Glance, and Cinder. If I create a snapshot for a instance, It create a new image in glance. And I can use the image to create a new instance. This feels to me more like creating an image based on the current state of the VM rather than creating a VM snapshot. I want to ask: 1、Can I create and revert a VM snapshot like I would in virtual machine software? 2、When a VM uses multiple disks/volumes, does OpenStack support taking a snapshot of all disks/volumes of the VM as a whole? 3、Can OpenStack snapshot and save the memory state of a VM? If it is not currently supported, are there any simple customization implementation ideas that can be recommended? Thank you for any help and suggestions. Best wishes. Han
Le dimanche 26 mars 2023, 20:50:22 CEST 韩光宇 a écrit :
Hello,
Hello,
I use Ceph as the storage backend for Nova, Glance, and Cinder.
If I create a snapshot for a instance, It create a new image in glance. And I can use the image to create a new instance.
This feels to me more like creating an image based on the current state of the VM rather than creating a VM snapshot.
The term "snapshot" is not ideal, as it miss-leads every virtualization platform users (VMware, Hyper-V...).
I want to ask: 1、Can I create and revert a VM snapshot like I would in virtual machine software?
In fact, if you don't user boot from volume instances, you could have something similar of snapshots by rebuilding your VM with the image create by the snapshot.
2、When a VM uses multiple disks/volumes, does OpenStack support taking a snapshot of all disks/volumes of the VM as a whole?
No, but you can take snapshot of the volumes. It won't be coherent, in a single transaction.
3、Can OpenStack snapshot and save the memory state of a VM?
I think not. When the instance is suspended, it's done, but even if you snapshot it, it would not take that memory state with the image.
If it is not currently supported, are there any simple customization implementation ideas that can be recommended?
You really need to think differently. OpenStack is a Cloud platform, made to consume Infrastructure as a Service, with Infra as code tools (like Terraform). You should have disposable instances, that could be destroyed and rebuild when you want easily. Use clusters for your middlwares (mariadb, redis...), use load balancer : Octavia our you own HAproxy, in front of your several web frontends / backends... Keep your data on additional volumes, and also do backups in object storage (Swift/S3, handled by Ceph). Make restoration easy and test it. Deploy different environments of your projects in different OpenStack projects, to test changes. That way of thinking will make it easier for you when you will begin to think about containers and Kubernetes.
Thank you for any help and suggestions. Best wishes.
Han
On Mon, 2023-03-27 at 20:01 +0200, Gilles Mocellin wrote:
Le dimanche 26 mars 2023, 20:50:22 CEST 韩光宇 a écrit :
Hello,
Hello,
I use Ceph as the storage backend for Nova, Glance, and Cinder.
If I create a snapshot for a instance, It create a new image in glance. And I can use the image to create a new instance.
This feels to me more like creating an image based on the current state of the VM rather than creating a VM snapshot.
The term "snapshot" is not ideal, as it miss-leads every virtualization platform users (VMware, Hyper-V...).
nova snapshots are snapshots of the root disk not of the disk and memory.
I want to ask: 1、Can I create and revert a VM snapshot like I would in virtual machine software?
In fact, if you don't user boot from volume instances, you could have something similar of snapshots by rebuilding your VM with the image create by the snapshot.
if its just the root disk state you can do that now for boot form volume or non boot from voluem isntances. regardless of the storage backend you use. nova snapshots are only of the vms root disk. cinder snapshots are only of the volume content. enitehr supprot capturing the ram state. one of the main reason rebuild exist is to allow rolling back the vm root disk state. cinder volume snapshots have the same usecase. its better to think of it as backup and restore then vitrualbox style snapshots.
2、When a VM uses multiple disks/volumes, does OpenStack support taking a snapshot of all disks/volumes of the VM as a whole?
No, but you can take snapshot of the volumes. It won't be coherent, in a single transaction.
well yes and no. if you have the qemu quest agent you can quiese all writes to all file systems during the snapshot cinder allso supprot voluem groups i belive and i think they allow you to do a consitent snapshot of all volumes in a group at once. you cant as far as i am aware do a consitent snapshot of all voluem and the root disk at the same time however.
3、Can OpenStack snapshot and save the memory state of a VM?
I think not. When the instance is suspended, it's done, but even if you snapshot it, it would not take that memory state with the image.
no we almost can. for the libvirt driver we implement suspend as manage save. this dumps the guest ram to disk liek virtual box does for its snapshots but we don thave a way to then snapshot that and use it to restore later. to get what you are asking for would actully be an extention to shelve or snapthos that would require the guest to be stopped while the disk and memeory snapshot is done. it woudl requrie use to assocate 2 images with teh snapshot the ram and disk iamge. there would be security consideration with saving hte ram like this too. its a feature that might be doable but i dont know if it coudl be done for other hypervieros liek powervm, hyperv or vmware. it obviouly woudl not work with ironic.
If it is not currently supported, are there any simple customization implementation ideas that can be recommended?
if we were to do this i woudl see it as an extention to shelve i think. i think this is not really inline with the normal cloud usage model and defintly feel more like classic virutaliastion. in general im not sure if it woudl be an acceptable change to the nova api but it would be a new feature.
You really need to think differently. OpenStack is a Cloud platform, made to consume Infrastructure as a Service, with Infra as code tools (like Terraform).
You should have disposable instances, that could be destroyed and rebuild when you want easily. Use clusters for your middlwares (mariadb, redis...), use load balancer : Octavia our you own HAproxy, in front of your several web frontends / backends... Keep your data on additional volumes, and also do backups in object storage (Swift/S3, handled by Ceph). Make restoration easy and test it.
Deploy different environments of your projects in different OpenStack projects, to test changes.
That way of thinking will make it easier for you when you will begin to think about containers and Kubernetes.
this is often refered to as the pets vs cattel view. we supprot backup and restore type functionality in nova and cinder and that is unliekly to go away. so this request is not ensirely out of scope but i twould require a lot of work and testing to enable. on the nova side it would requrie extenstion to the rebuild, shelve/unshleve and the backup/create iamge apis. it would be a preat large change to implemenet and im not sure it would reach a quorm of agreemnt to accept. however this week is the upstream vPTG. if you want to ask for feedback syncronosely you could add it as a topic to the nova adgenda https://etherpad.opendev.org/p/nova-bobcat-ptg, operator pain point adgenda https://etherpad.opendev.org/p/march2023-ptg-operator-hour-nova or continue async on the mailing list or vai a nova spec.
Thank you for any help and suggestions. Best wishes.
Han
participants (3)
-
Gilles Mocellin
-
Sean Mooney
-
韩光宇