]> git.proxmox.com Git - qemu-server.git/commit - PVE/VZDump/QemuServer.pm
backup: implement fleecing option
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 11 Apr 2024 09:29:37 +0000 (11:29 +0200)
committerFiona Ebner <f.ebner@proxmox.com>
Fri, 19 Apr 2024 13:47:42 +0000 (15:47 +0200)
commit5d8572828211c13e1498b4432d0aa8b060fa159d
tree85a126151c2c88bea9e2ba38d8ef6b65dd0f3ae6
parent36377acfbd58c97afaa6703bbd2a18ab96b1c195
backup: implement fleecing option

Management for fleecing images is implemented here. If the fleecing
option is set, for each disk (except EFI disk and TPM state) a new
fleecing image is allocated on the configured fleecing storage (same
storage as original disk by default). The disk is attached to QEMU
with the 'size' parameter, because the block node in QEMU has to be
the exact same size and the newly allocated image might be bigger if
the storage has a coarser allocation or rounded up. After backup, the
disks are detached and removed from the storage.

If the storage supports qcow2, use that as the fleecing image format.
This allows saving some space even on storages that do not properly
support discard, like, for example, older versions of NFS.

Since there can be multiple volumes with the same volume name on
different storages, the fleecing image's name cannot be just based on
the original volume's name. The schema vm-ID-fleece-N(.FORMAT) with N
incrementing for each disk is used.

Partially inspired by the existing handling of the TPM state image
during backup.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/VZDump/QemuServer.pm