From: Peter Krempa Date: Wed, 19 Nov 2025 07:49:04 +0000 (+0100) Subject: kbase: Add note about preserving VM on shutdown to backup article X-Git-Tag: v11.10.0-rc1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=895a973c49926431ac80f7f070306deda8094139;p=thirdparty%2Flibvirt.git kbase: Add note about preserving VM on shutdown to backup article Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/docs/kbase/live_full_disk_backup.rst b/docs/kbase/live_full_disk_backup.rst index be95d9d2e2..37034eae36 100644 --- a/docs/kbase/live_full_disk_backup.rst +++ b/docs/kbase/live_full_disk_backup.rst @@ -1,3 +1,5 @@ +.. role:: since + =============================== Efficient live full disk backup =============================== @@ -84,6 +86,24 @@ This requires libvirt-7.2.0 and QEMU-4.2, or higher versions. 15M -rw-r--r--. 1 qemu qemu 15M May 10 12:22 vm1.qcow2 21M -rw-------. 1 root root 21M May 10 12:23 vm1.qcow2.1620642185 +Shutdown of the guest OS during backup +-------------------------------------- + +The backup job is a long running job, potentially copying a lot of data, which +requires the VM to be active (The backup is done by the qemu process) and +can't be continued if the VM shuts down. This includes shut down initiated by +the guest OS itself. + +:since:`Since libvirt-11.10` the ``virDomainBackupBegin()`` supports the +``VIR_DOMAIN_BACKUP_BEGIN_PRESERVE_SHUTDOWN_DOMAIN`` flag +(``virsh backup-begin --preserve-domain-on-shutdown``) which instructs libvirt +to avoid termination of the VM if the guest OS shuts down while the backup is +still running. The VM is in that scenario reset and paused instead of terminated +allowing the backup to finish. Once the backup finishes the VM process is +terminated. Users can resume the VM (e.g. ``virsh resume``) which causes it +to boot normally using the existing VM process and will continue to run after +completion of the backup job. + Full backup with older libvirt versions =======================================