Snapshot entire vm backed by custom storage driver

I have created my own storage drivers for both ZFS and LizardFS file systems. My drivers store the disk images as a group via datasets in ZFS and directory in LizardFS. My drivers were written for older ONE before snapshots were supported. I would like to update the drivers to support snapshots.

Using ONE 5.6, I did a bit of experimenting to see what facilities are called when creating a snapshot. When I try to snap a VM, I see the script /var/tmp/one/vmm/kvm/snapshot_create is called. However, the script just returns error “unsupported configuration: internal snapshot for disk hda unsupported for storage type raw” I’m guessing it expects qcow type images for snapshots. However, technically I can still perform snaps for raw images because the filesystems I use support creating a snapshot of anything. For VM’s that have multiple disk images, I get a consistent snapshot by snapping the entire dataset or directory.

It seems like there should be a way for the KVM (or any other hypervisor driver) to pass the snap request down to the storage driver(s).

How best should I go about implementing this functionality? Should I modify the kvm vmm driver? I would prefer not to do that since it would make future ONE upgrades require merging my changes. Is there some other way that I’m not aware of?

Thanks in advance,

Hi Gary,

Here is how I’ve resolved the matter for addon-storpool.

If you take a look at the optional arguments for the VMM_MAD there is the hint:

#    -l <actions[=command_name]> actions executed locally, command can be
#        overridden for each action.
#        Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
#        An example: "-l migrate=migrate_local,save"

Digging deeper in the code I’ve figured out that the VM snapshot actions are also valid ( snapshotcreate,snapshotrevert,snapshotdelete):wink:

Take a note that the defined with -l actions will be executed on the front end /var/lib/one/remotes/vmm/kvm/*. The local script should need to ssh to the host to execute the snapshot command. Also to tell OpenNebula to keep the snapshot’s records metadata during migrate you must set KEEP_SNAPSHOTS=YES in the VM_MAD conf.

Hope this helps.

Best Regards,
Anton Todorov

Thank you, Anton! This seems like exactly what I need to add support for snapshots to my ONE environment.