]> git.proxmox.com Git - pve-docs.git/blobdiff - vzdump.adoc
vzdump: drop overly scary & outdated warning about fleecing
[pve-docs.git] / vzdump.adoc
index add40dce3a2b8d36d1d0fb167c43a15bdc9ab1a8..79d4bbc993d9666342fcbb8247133523e8df8ef0 100644 (file)
@@ -33,34 +33,26 @@ of the backups and downtime of the guest system.
 
 {pve} backups are always full backups - containing the VM/CT
 configuration and all data.  Backups can be started via the GUI or via
-the `vzdump` command line tool.
+the `vzdump` command-line tool.
 
 .Backup Storage
 
-Before a backup can run, a backup storage must be defined. Refer to
-the Storage documentation on how to add a storage. A backup storage
-must be a file level storage, as backups are stored as regular files.
-In most situations, using a NFS server is a good way to store backups.
-You can save those backups later to a tape drive, for off-site
-archiving.
+Before a backup can run, a backup storage must be defined. Refer to the
+xref:chapter_storage[storage documentation] on how to add a storage. It can
+either be a Proxmox Backup Server storage, where backups are stored as
+de-duplicated chunks and metadata, or a file-level storage, where backups are
+stored as regular files. Using Proxmox Backup Server on a dedicated host is
+recommended, because of its advanced features. Using an NFS server is a good
+alternative. In both cases, you might want to save those backups later to a tape
+drive, for off-site archiving.
 
 .Scheduled Backup
 
-Backup jobs can be scheduled so that they are executed automatically
-on specific days and times, for selectable nodes and guest systems.
-Configuration of scheduled backups is done at the Datacenter level in
-the GUI, which will generate a job entry in /etc/pve/jobs.cfg, which
-will in turn be parsed and executed by the `pvescheduler` daemon.
-These jobs use the xref:chapter_calendar_events[calendar events] for
-defining the schedule.
+Backup jobs can be scheduled so that they are executed automatically on specific
+days and times, for selectable nodes and guest systems. See the
+xref:vzdump_jobs[Backup Jobs] section for more.
 
-Since scheduled backups miss their execution when the host was offline or the
-pvescheduler was disabled during the scheduled time, it is possible to configure
-the behaviour for catching up. By enabling the `Repeat missed` option
-(`repeat-missed` in the config), you can tell the scheduler that it should run
-missed jobs as soon as possible.
-
-Backup modes
+Backup Modes
 ------------
 
 There are several ways to provide consistency (option `mode`), 
@@ -72,7 +64,7 @@ depending on the guest type.
 
 This mode provides the highest consistency of the backup, at the cost
 of a short downtime in the VM operation. It works by executing an
-orderly shutdown of the VM, and then runs a background Qemu process to
+orderly shutdown of the VM, and then runs a background QEMU process to
 backup the VM data. After the backup is started, the VM goes to full
 operation mode if it was previously running. Consistency is guaranteed
 by using the live backup feature.
@@ -100,8 +92,8 @@ https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;f=backup.txt[here].
 NOTE: {pve} live backup provides snapshot-like semantics on any
 storage type. It does not require that the underlying storage supports
 snapshots. Also please note that since the backups are done via 
-a background Qemu process, a stopped VM will appear as running for a 
-short amount of time while the VM disks are being read by Qemu.
+a background QEMU process, a stopped VM will appear as running for a
+short amount of time while the VM disks are being read by QEMU.
 However the VM itself is not booted, only its disk(s) are read.
 
 .Backup modes for Containers:
@@ -144,6 +136,41 @@ not included in backups. For volume mount points you can set the *Backup* option
 to include the mount point in the backup. Device and bind mounts are never
 backed up as their content is managed outside the {pve} storage library.
 
+VM Backup Fleecing
+~~~~~~~~~~~~~~~~~~
+
+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.
+Use e.g. `vzdump 123 --fleecing enabled=1,storage=local-lvm` to enable backup
+fleecing, with fleecing images created on the storage `local-lvm`.
+
+The fleecing storage should be a fast local storage, with thin provisioning and
+discard support. Examples are LVM-thin, RBD, ZFS with `sparse 1` in the storage
+configuration, many file-based storages. Ideally, the fleecing storage is a
+dedicated storage, so it running full will not affect other guests and just fail
+the backup. Parts of the fleecing image that have been backed up will be
+discarded to try and keep the space usage low.
+
+For file-based storages that do not support discard (e.g. NFS before version
+4.2), you should set `preallocation off` in the storage configuration. In
+combination with `qcow2` (used automatically as the format for the fleecing
+image when the storage supports it), this has the advantage that already
+allocated parts of the image can be re-used later, which can still help save
+quite a bit of space.
+
+WARNING: On a storage that's not thinly provisioned, e.g. LVM or ZFS without the
+`sparse` option, the full size of the original disk needs to be reserved for the
+fleecing image up-front. On a thinly provisioned storage, the fleecing image can
+grow to the same size as the original image only if the guest re-writes a whole
+disk while the backup is busy with another disk.
+
 Backup File Names
 -----------------
 
@@ -194,12 +221,59 @@ Backup Encryption
 For Proxmox Backup Server storages, you can optionally set up client-side
 encryption of backups, see xref:storage_pbs_encryption[the corresponding section.]
 
+[[vzdump_jobs]]
+Backup Jobs
+-----------
+
+[thumbnail="screenshot/gui-cluster-backup-overview.png"]
+
+Besides triggering a backup manually, you can also setup periodic jobs that
+backup all, or a selection of virtual guest to a storage. You can manage the
+jobs in the UI under 'Datacenter' -> 'Backup' or via the `/cluster/backup` API
+endpoint. Both will generate job entries in `/etc/pve/jobs.cfg`, which are
+parsed and executed by the `pvescheduler` daemon.
+
+[thumbnail="screenshot/gui-cluster-backup-edit-01-general.png", float="left"]
+
+A job is either configured for all cluster nodes or a specific node, and is
+executed according to a given schedule. The format for the schedule is very
+similar to `systemd` calendar events, see the
+xref:chapter_calendar_events[calendar events] section for details. The
+'Schedule' field in the UI can be freely edited, and it contains several
+examples that can be used as a starting point in its drop-down list.
+
+You can configure job-specific xref:vzdump_retention[retention options]
+overriding those from the storage or node configuration, as well as a
+xref:vzdump_notes[template for notes] for additional information to be saved
+together with the backup.
+
+Since scheduled backups miss their execution when the host was offline or the
+pvescheduler was disabled during the scheduled time, it is possible to configure
+the behaviour for catching up. By enabling the `Repeat missed` option (in the
+'Advanced' tab in the UI, `repeat-missed` in the config), you can tell the
+scheduler that it should run missed jobs as soon as possible.
+
+[thumbnail="screenshot/gui-cluster-backup-edit-04-advanced.png"]
+
+There are a few settings for tuning backup performance (some of which are
+exposed in the 'Advanced' tab in the UI). The most notable is `bwlimit` for
+limiting IO bandwidth. The amount of threads used for the compressor can be
+controlled with the `pigz` (replacing `gzip`), respectively, `zstd` setting.
+Furthermore, there are `ionice` (when the BFQ scheduler is used) and, as part of
+the `performance` setting, `max-workers` (affects VM backups only) and
+`pbs-entries-max` (affects container backups only). See the
+xref:vzdump_configuration[configuration options] for details.
+
 [[vzdump_retention]]
 Backup Retention
 ----------------
 
 With the `prune-backups` option you can specify which backups you want to keep
-in a flexible manner. The following retention options are available:
+in a flexible manner.
+
+[thumbnail="screenshot/gui-cluster-backup-edit-02-retention.png"]
+
+The following retention options are available:
 
 `keep-all <boolean>` ::
 Keep all backups. If this is `true`, no other options can be set.
@@ -319,6 +393,8 @@ Backup Notes
 You can add notes to backups using the 'Edit Notes' button in the UI or via the
 storage content API.
 
+[thumbnail="screenshot/gui-cluster-backup-edit-03-template.png"]
+
 It is also possible to specify a template for generating notes dynamically for
 a backup job and for manual backup. The template string can contain variables,
 surrounded by two curly braces, which will be replaced by the corresponding
@@ -371,7 +447,7 @@ limit. A bigger per-job limit will only overwrite the per-storage limit if
 you have `Data.Allocate' permissions on the affected storage.
 
 You can use the `--bwlimit <integer>` option from the restore CLI commands
-to set up a restore job specific bandwidth limit.  Kibit/s is used as unit
+to set up a restore job specific bandwidth limit. KiB/s is used as unit
 for the limit, this means passing `10240' will limit the read speed of the
 backup to 10 MiB/s, ensuring that the rest of the possible storage bandwidth
 is available for the already running virtual guests, and thus the backup
@@ -442,6 +518,11 @@ downloaded from such an archive is inherently safe, but it avoids exposing the
 hypervisor system to danger. The VM will stop itself after a timeout. This
 entire process happens transparently from a user's point of view.
 
+NOTE: For troubleshooting purposes, each temporary VM instance generates a log
+file in `/var/log/proxmox-backup/file-restore/`. The log file might contain
+additional information in case an attempt to restore individual files or
+accessing file systems contained in a backup archive fails.
+
 [[vzdump_configuration]]
 Configuration
 -------------
@@ -522,6 +603,9 @@ Use rsync and suspend/resume to create a snapshot (minimal downtime).
  # vzdump 777 --mode suspend
 
 Backup all guest systems and send notification mails to root and admin.
+Due to `mailto` being set and `notification-mode` being set to `auto` by
+default, the notification mails are sent via the system's `sendmail`
+command instead of the notification system.
 
  # vzdump --all --mode suspend --mailto root --mailto admin
 
@@ -554,4 +638,3 @@ file system, using pipes
 ifdef::manvolnum[]
 include::pve-copyright.adoc[]
 endif::manvolnum[]
-