]> git.proxmox.com Git - pve-qemu.git/commit - debian/patches/series
implement support for backup fleecing
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 11 Apr 2024 15:38:26 +0000 (17:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 11 Apr 2024 18:05:02 +0000 (20:05 +0200)
commit20209d8d73158e9593ef2514f71282bb034ff337
tree8748346e2ec21190e09f7399e7c79d3b7af3aa97
parent47bdd042444fe756f8f8df5a019bd031465986cb
implement support for backup fleecing

Excerpt from Fiona's v3 cover-letter [0]:

When a backup for a VM is started, QEMU will install a
"copy-before-write" filter in its block layer. This filter ensures
that upon new guest writes, old data still needed for the backup is
sent to the backup target first. The guest write blocks until this
operation is finished so guest IO to not-yet-backed-up sectors will be
limited by the speed of the backup target.

With backup fleecing, such old data is cached in a fleecing image
rather than sent directly to the backup target. This can help guest IO
performance and even prevent hangs in certain scenarios, at the cost
of requiring more storage space.

With this series it will be possible to enable backup-fleecing via
e.g. `vzdump 123 --fleecing enabled=1,storage=local-lvm` with fleecing
images created on the storage `local-lvm`. The fleecing storage should
be a fast local storage which supports thin-provisioning and discard.
If the storage supports qcow2, that is used as the fleecing image
format. If the underlying file system does not support discard, with
qcow2 and preallocation=off, at least already allocated parts of the
image can be re-used later.

Fleecing images are created by qemu-server via pve-storage and
attached to QEMU before the backup starts, and cleaned up after the
backup finished or failed. The naming schema for fleecing images is
'vm-ID-fleece-N(.FORMAT)'. The allocated images are recorded in the
guest configuration, so that even after a hard failure, clean-up can
be re-attempted. While not too bad, it's a non-trivial amount of code
and I'm not 100% sure about the cost-benefit, so sending those as RFC.

The fleecing image needs to be the exact same size as the source, but
luckily, an explicit size can be specified when attaching a raw image
to QEMU so there are no size issues when using storages that have
coarser allocation/round up. For qcow2, it seems that virtual size can
be nearly arbitrary (i.e. modulo 512 byte granularity) during
allocation.

[0]: https://lists.proxmox.com/pipermail/pve-devel/2024-April/062815.html

Originally-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/patches/pve/0046-block-copy-before-write-fix-permission.patch [new file with mode: 0644]
debian/patches/pve/0047-block-copy-before-write-support-unligned-snapshot-di.patch [new file with mode: 0644]
debian/patches/pve/0048-block-copy-before-write-create-block_copy-bitmap-in-.patch [new file with mode: 0644]
debian/patches/pve/0049-qapi-blockdev-backup-add-discard-source-parameter.patch [new file with mode: 0644]
debian/patches/pve/0050-copy-before-write-allow-specifying-minimum-cluster-s.patch [new file with mode: 0644]
debian/patches/pve/0051-backup-add-minimum-cluster-size-to-performance-optio.patch [new file with mode: 0644]
debian/patches/pve/0052-PVE-backup-add-fleecing-option.patch [new file with mode: 0644]
debian/patches/series