Persistent VM snapshots
|Category:||Drivers - VM|
After a poweroff/poweron and migrate cycle, snapshots are discarded by OpenNebula. With new versions of libvirt, this is no longer needed
#7 Updated by Ruben S. Montero over 5 years ago
- Tracker changed from Backlog to Feature
- Category changed from Core & System to Drivers - VM
- Status changed from Pending to New
- Assignee deleted (
- Target version set to Release 4.14
Carlo Daffara wrote:
We are currently looking into this for kvm+libvirt, in a fairly recent fashion (kvm 1.5.3 and libvirt 1.2.8). Can you provide some indication of what is not properly supported? Maybe the cleanup, since the images may remain after the machine lifecycle?
Probably is just a matter of re-testing it. The changes in oned are fairly simple and they are actually done...
Moving this to 4.14 to test if we can preserve snapshots across migrations.
#8 Updated by Stefan Kooman over 5 years ago
According to this post on libvirt-users mailing list there is a workaround possible: https://www.redhat.com/archives/libvirt-users/2013-March/msg00117.html.
#11 Updated by Jaime Melis about 5 years ago
There might be a shortcut for the procedure explained in the message referece by Stefan.
Every time that a new snapshot is created, dump the snapshot to a file. Upon resume, redefine all snapshots.
$ virsh snapshot-list one-$VMID # => returns $SNAPSHOT_ID $ virsh snapshot-dumpxml one-$VMID $SNAPSHOT_ID > snap-$SNAPSHOT_ID.xml $ onevm poweroff $VMID $ onevm resume $VMID $ virsh snapshot-list one-$VMID # => this is emty for the moment $ sed -i s/...../ -$SNAPSHOT_ID # => to replace the uuid with the new uuid $ virsh snapshot-create one-$VMID snap-$SNAPSHOT_ID.xml --redefine $ virsh snapshot-list one-$VMID # => this returns the snapshot, and you can revert back to it TODO: define snapshot-current?
#17 Updated by Peter Loeffler over 4 years ago
We would need VM snapshot too.
We also tried a little hack in the snapshot_create and snapshot_revert shell scripts to be able to do rbd snapshots (without memory in this case).
It checks if there are any rbd-disks attached to the vm and if so, it suspends the domain, do a rbd snapshot of all disks and then resumes the domain.
Basicly it seems to work and we want to share the code as soon as we are ready with it.
The problem here is also that the snapshot in sunstone is gone after any power cycle but the rbd snapshots are left over.