Disk snapshots in OpenNebula


I have two questions about disk snapshots in OpenNebula:

  1. Why can the “active snapshot” not be deleted? As far as I understand, the snapshot is just a copy of the virtual disk image with the latter being the version the VM is working on; why then is the snapshot file still needed if the user decides that he or she does not want to go back to that snapshot?

  2. When doing a snap_flatten, the file of the selected snapshot is moved to where the virtual disk image was before. But afterwards, the snapshot is still visible in "onevm show ", though nothing can be done now with it because it was moved away. Is that how it is supposed to be?


Honestly, I do not understand much about disk snapshots in opennebula. What is this whole parent-children hierarchy used for? I added some debug output in /var/lib/one/remotes/tm/shared/snap_create and found out that the only parent of a snapshot is the VM virtual disk image, never another snapshot. And I cannot delete any of the snapshots, I either get “Cannot delete the active snapshot” or “Cannot delete snapshot with children”, even after adding ALLOW_ORPHANS to the shared TM_MAD definition in oned.conf, restarting OpenNebula, deleting the VM and the image, and then recreating recreating the disk image and the VM.

And, when I do a snapshot from a persistent image, I can revert to it from Instances->VMs->${VMID}->Storage afterwards, but I cannot from Storage->Images->${IMAGE_ID}->Snapshots, with error message “Snapshot is already the active one”. Why is this? It makes the snapshot completely useless if it is impossible to revert to it.

Hey Christoph … may be this is useful for you regarding question 1.


What exactly could go wrong?

once i did some tests reverting the disks snapshots and the tried to restore the VM State afterwards. This has failed for some reasons