Proposal: support for atomic snapshot of all VM disks at once
Ivaylo Markov
ivaylo.markov at storpool.com
Fri Oct 4 15:54:39 CEST 2024
Greetings,
I am the maintainer of StorPool’s external storage plugin for PVE[0]
which integrates our storage solution as a backend for VM disks. Our
software has the ability to create atomic (crash-consistent) snapshots
of a group of storage volumes. I’d like to use this feature in our
plugin so that customers can perform whole VM snapshots, but that does
not seem possible currently - the snapshot creation method is called
individually for every disk.
I was directed here to discuss this proposal and my implementation idea
after an initial post in Bugzilla[1]. The goal is to give storage
plugins the option to perform atomic crash-consistent snapshots of the
virtual disks associated with a virtual machine where the backend
supports it (e.g. Ceph, StorPool, and ZFS) without affecting those
without such a feature.
I would add a `can_snapshot_volume_group` method to the base
`PVE::Storage::Plugin` class, which would accept an array of the VM’s
disks, and return a binary result whether an atomic snapshot is
possible. The default implementation would return 0, but plugins with
support can override it based on backend capabilities. For example, ZFS
supports atomic snapshot of volume groups, but requires all volumes to
be in the same pool.
The actual snapshot can be performed by a `snapshot_volume_group
method`, which is not expected to be called unless the driver supports
this operation.
In `PVE::AbstractConfig::snapshot_create` these two methods can be used
to check and perform the atomic snapshots where possible, otherwise it
would keep the current behavior of creating a snapshot for each disk
separately. If the VM has drives with completely different storage
backends (e.g. ZFS and LVM for whatever reason), the driver check can be
skipped, and the current behavior used again.
[0] https://github.com/storpool/pve-storpool
[1] https://bugzilla.proxmox.com/show_bug.cgi?id=5752
Best regards,
--
Ivaylo Markov
StorPool Storage
https://www.storpool.com
More information about the pve-devel
mailing list