Tobias Brunner
2013-Aug-20 15:13 UTC
Re: [libvirt-users] Creating a snapshot from a KVM VM fails
Hi, Thanks a lot for the answer.> An internal snapshot of a VM requires that the VM has at least one disk > using a QCOW2 volume or similar. The memory state is saved in that > image. Your VM has only a RAW disk image and thus it can't be used for > internal snapshot.Ok, that makes sense...> You can either use an external snapshot (the memory image is stored > separately), but the support for external snapshots isn't finished yet > (they can't be reverted automatically).How can I create an external snapshot?> The second option is to convert your VM to a qcow2 image file.....>> <disk type='network' device='disk'> >> <driver name='qemu' type='raw' cache='none'/> >> <source protocol='rbd' name='one/one-5-5-0'/> >> <target dev='hda' bus='ide'/> >> <alias name='ide0-0-0'/> >> <address type='drive' controller='0' bus='0' target='0' >> unit='0'/> >> </disk>As you can see, I'm using RBD as storage backend. So converting to a qcow2 is not an option. Any idea how to achieve internal snapshots using RBD as storage backend? F.e. attach an additional qcow2 disk just for the snapshot? Cheers, Tobias
Eric Blake
2013-Aug-21 18:56 UTC
Re: [libvirt-users] Creating a snapshot from a KVM VM fails
On 08/20/2013 09:13 AM, Tobias Brunner wrote:> Hi, > > Thanks a lot for the answer. > >> An internal snapshot of a VM requires that the VM has at least one disk >> using a QCOW2 volume or similar. The memory state is saved in that >> image. Your VM has only a RAW disk image and thus it can't be used for >> internal snapshot. > > Ok, that makes sense... > >> You can either use an external snapshot (the memory image is stored >> separately), but the support for external snapshots isn't finished yet >> (they can't be reverted automatically). > > How can I create an external snapshot?Add '--disk-only' for an offline domain, or use 'virsh snapshot-create-as --memspec' instead of 'snapshot-create' for an online guest (you can also use snapshot-create for an external snapshot, but you have to write appropriate XML for the case, rather than relying on the no-arg option that provides a default XML for an internal snapshot; so I find snapshot-create-as a lot easier to work with).> >> The second option is to convert your VM to a qcow2 image file.. > > ... > >>> <disk type='network' device='disk'> >>> <driver name='qemu' type='raw' cache='none'/> >>> <source protocol='rbd' name='one/one-5-5-0'/> >>> <target dev='hda' bus='ide'/> >>> <alias name='ide0-0-0'/> >>> <address type='drive' controller='0' bus='0' target='0' unit='0'/> >>> </disk> > > As you can see, I'm using RBD as storage backend. So converting to a > qcow2 is not an option. Any idea how to achieve internal snapshots using > RBD as storage backend? F.e. attach an additional qcow2 disk just for > the snapshot?Internal snapshots require qcow2 (or the less-used qed) file format, full stop. If you want your snapshots to live on RBD storage backend, then you either layer the qcow2 file on top of that backend, or you use external snapshots. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Nicolas Sebrecht
2013-Aug-22 12:15 UTC
[libvirt-users] Re: Creating a snapshot from a KVM VM fails
The 21/08/13, Eric Blake wrote:> On 08/20/2013 09:13 AM, Tobias Brunner wrote:> Internal snapshots require qcow2 (or the less-used qed) file format, > full stop. If you want your snapshots to live on RBD storage backend, > then you either layer the qcow2 file on top of that backend, or you use > external snapshots.And another option would be to use LVM on top of RBD. -- Nicolas Sebrecht