VM snapshots with sunstone


#1

Hello,

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.

Regards
Christoph


(Anton Todorov) #2

Hello,

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…

Kind Regards,
Anton Todorov


#3

As I am using kvm for virtualization, that sounds good, so I added the following lines in /var/lib/one/remotes/vmm/kvm/snapshot_create:

echo DOMAIN=$DOMAIN >> /tmp/snapshot.log
echo SNAP_ID=$SNAP_ID >> /tmp/snapshot.log
echo LIBVIRT_URI=$LIBVIRT_URI >> /tmp/snapshot.log

sync

But after pressing “Take snapshot”, none of the involved hosts has a file /tmp/snapshot.log …

Regards
Christoph


#4

Other problems with snapshots:

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.

Is that how it is supposed to be?


(Anton Todorov) #5

Hi Christoph,

AFAIK Storage->Images->$DISKID->Snapshots interface is for PERSISTENT images only.

On VM termination the storage driver should delete the snapshots of the NON-PERSISTENT images. If not - it is a bug (IMO)

Kind Regards,
Anton Todorov


#6

Hello,

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.

Regards
Christoph


(Anton Todorov) #7

Hi Christoph,

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.

Kind Regards,
Anton Todorov


#8

Done (and now I have to write some more characters just to reach a minimum of 10)