qemu-server/PVE
Fiona Ebner 98209f99a1 backup: implement backup for external providers
The state of the VM's disk images at the time the backup is started is
preserved via a snapshot-access block node. Old data is moved to the
fleecing image when new guest writes come in. The snapshot-access
block node, as well as the associated bitmap in case of incremental
backup, will be made available to the external provider. They are
exported via NBD and for 'nbd' mechanism, the NBD socket path is
passed to the provider, while for 'file-handle' mechanism, the NBD
export is made accessible via a file handle and the bitmap information
is made available via a $next_dirty_region->() function. For
'file-handle', the 'nbdinfo' and 'nbdfuse' binaries are required.

The provider can indicate that it wants to do an incremental backup by
returning the bitmap ID that was used for a previous backup and it
will then be told if the bitmap was newly created (either first backup
or old bitmap was invalid) or if the bitmap can be reused.

The provider then reads the parts of the NBD or virtual file it needs,
either the full disk for full backup, or the dirty parts according to
the bitmap for incremental backup. The bitmap has to be respected,
reads to other parts of the image will return an error. After backing
up each part of the disk, it should be discarded in the export to
avoid unnecessary space usage in the fleecing image (requires the
storage underlying the fleecing image to support discard too).

[WB: - instead of backup_vm_available_bitmaps call
       backup_vm_query_incremental, which provides a bitmap-mode
       instead, pass this along and use just the storage id as bitmap
       name]
[FE: Move construction of $devices parameter to after sizes are
     available. They were undef before.
     Adapt to changed backup-access QMP interface not requiring an
     explicit bitmap name anymore.]

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Link: https://lore.proxmox.com/20250404133204.239783-14-f.ebner@proxmox.com
2025-04-06 20:18:52 +02:00
..
API2 pve machine versions: unify information into single hash and rework use sites 2025-04-06 19:11:21 +02:00
CLI vm stop-cleanup: allow callers to decide error behavior 2025-03-06 16:33:14 +01:00
QemuConfig config: make attempts at writing out NoWrite configs fatal 2025-02-18 15:06:04 +01:00
QemuServer pve machine versions: unify information into single hash and rework use sites 2025-04-06 19:11:21 +02:00
VZDump backup: implement backup for external providers 2025-04-06 20:18:52 +02:00
Makefile config: add special class that prevents writing the configuration 2025-02-18 15:06:04 +01:00
QemuConfig.pm config: add special class that prevents writing the configuration 2025-02-18 15:06:04 +01:00
QemuMigrate.pm migrate: add transfer summary 2025-04-03 16:40:59 +02:00
QemuServer.pm machine: bump pve machine version and reverse the s3/s4 defaults 2025-04-06 19:08:31 +02:00
QMPClient.pm tree-wide: fix various typos in comments 2024-12-05 12:33:24 +01:00