[libvirt] F10: how to save snapshot back to image?

In Fedora 10 I've managed to get libvirt to call the emulator with custom arguments so I can invoke -snapshot. I just replaced the emulator in /usr/bin with my own script which adds the argument and then calls the original emulator. This works fine. And the snapshot works fine. I can make lots of changes and when I shutdown and restart then all the changes are forgotten. Now after I'm satisfied with some changes I want to save the snapshot back to the image file. I've tried "Ctrl-Alt-s", but this does not work. I tried finding the QEMU console, but Serial Console is grayed out in the menu. I don't know if that would help anyway since this was a raw image and not qcow2 so I don't think 'savevm' and 'loadvm' would work with raw. Can someone tell me how to save these snapshots back to the image file? Thanks. Regards, Gerry

Gerry Reno wrote:
In Fedora 10 I've managed to get libvirt to call the emulator with custom arguments so I can invoke -snapshot. I just replaced the emulator in /usr/bin with my own script which adds the argument and then calls the original emulator. This works fine. And the snapshot works fine. I can make lots of changes and when I shutdown and restart then all the changes are forgotten. Now after I'm satisfied with some changes I want to save the snapshot back to the image file. I've tried "Ctrl-Alt-s", but this does not work. I tried finding the QEMU console, but Serial Console is grayed out in the menu. I don't know if that would help anyway since this was a raw image and not qcow2 so I don't think 'savevm' and 'loadvm' would work with raw. Can someone tell me how to save these snapshots back to the image file? Thanks.
We need a way to these things: 1. Have sysadmins enable the "monitor" when necessary. 2. Be able to issue multi-Ctrl key (preferably user-defineable) sequences for performing actions with the hypervisor. 3. Have every aspect of every command available in "monitor" available from an API. Right now, I cannot gain access to the "monitor" in libvirt. Therefore I cannot issue something like "savevm", "loadvm", or "commit hda" or any of these commands necessary for working with snapshots. I also am unable to send Ctrl key sequences such as Ctrl-a-s to write the snapshot to the image file. Therefore, all routes are closed. The current approach of just locking everything down is wrong. That decision should be left up to the user as to how much security they wish to enable in their particular environment. Regards, Gerry

On Mon, Apr 20, 2009 at 04:24:28PM -0400, Gerry Reno wrote:
Right now, I cannot gain access to the "monitor" in libvirt. Therefore I cannot issue something like "savevm", "loadvm", or "commit hda" or any of these commands necessary for working with snapshots. I also am unable to send Ctrl key sequences such as Ctrl-a-s to write the snapshot to the image file. Therefore, all routes are closed. The current approach of just locking everything down is wrong. That decision should be left up to the user as to how much security they wish to enable in their particular environment.
Your POV, my point of view is that an API should be provided if you can provide it consistently and reliably, otherwise it should not be turned into an API. libvirt was not designed as an API for QEmu internals, maybe it's what you need, but that would have to be offered by the QEmu people themselves ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Mon, Apr 20, 2009 at 12:08:48PM -0400, Gerry Reno wrote:
In Fedora 10 I've managed to get libvirt to call the emulator with custom arguments so I can invoke -snapshot. I just replaced the emulator in /usr/bin with my own script which adds the argument and then calls the original emulator. This works fine. And the snapshot works fine. I can make lots of changes and when I shutdown and restart then all the changes are forgotten. Now after I'm satisfied with some changes I want to save the snapshot back to the image file. I've tried "Ctrl-Alt-s", but this does not work. I tried finding the QEMU console, but Serial Console is grayed out in the menu. I don't know if that would help anyway since this was a raw image and not qcow2 so I don't think 'savevm' and 'loadvm' would work with raw.
Can someone tell me how to save these snapshots back to the image file? Thanks.
That's not supported at this time. The built in QCow2 snappshotting in QEMU is also rather dangerous with it known to corrupt data in a number of circumstances. We'd like to expose this functionality in libvirt eventually, but we've not made it a priority yet since its not really considered stable upstream either. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Gerry Reno