what exactly happens when in sunstone, under Instances->VMs->$VMID->Snapshots, I click on “Take snapshot”? When I click on it, the VM goes to some temporary state in which a snapshot is taken that I can afterwards delete or revert, but I can neither find out what scripts are called to perform these actions, nor can I see any results on disk like a newly created file after creating a snapshot, or a removed file after deleting a snapshot.
AFAIK these scrips are called /var/lib/one/remotes/vmm/kvm/snapshot_{create,delete,revert} But I am not sure for which drivers they are working as expected…
when in sunstone, under Instances->VMs->$VMID->Storage, I take a snapshot from one of the disks, a file is created on disk and I can see the snapshot in Instances->VMs->$VMID->Storage, but I cannot see it in Storage->Images->$DISKID->Snapshots. And after terminating the VM, the file is still present on disk, but I have no access to it from the sunstone interface so that I have to call rm to delete it.
it seems that the whole interface for disk snapshots works correctly only for persistent images. Though snapshots are created for non-persistent images, they are not shown in Storage->Images->$DISKID->Snapshots and they cannot be deleted through the OpenNebula Interface after the corresponding VM has been terminated. With persistent images, the snapshot is shown in Storage->Images->$DISKID->Snapshots and can be deleted there after VM termination.
Additionally, I discovered that CDROM images are never persistent. They can be set to persistent and then, when they are in use by a VM, their state is shown as USED_PERS, but in the VM->Storage information, CDROM images are always shown as not persistent.
I think it is a good idea to disable snapshot creation for non-persistent images.
As already said it smell as a bug - these snapshots should be deleted on VM termination besides the non-persistent images. The NON-PERSISTENT images are “clones” of an image in the storage->images and their snapshots are based on the clones not on the master image.
This issue is already reported and according to the issue record it will be fixed in 5.4.
Please allow me to suggest better idea - you can fill a bug report in the dev portal and then the developers or volunteers could fix the issue in the next or bug-fix release.