Backups

local-lvm can store only Disk image and Container. Hence all backups will be on the local storage (proxmox logical volume "root").

Mount a diferent disk in the default backup location /var/lib/vz/dump

Mode

Backup modes for Containers:

stop mode

Stop the container for the duration of the backup. This potentially results in a very long downtime.

suspend mode

This mode uses rsync to copy the container data to a temporary location (see option --tmpdir). Then the container is suspended and a second rsync copies changed files. After that, the container is started (resumed) again. This results in minimal downtime, but needs additional space to hold the container copy.

When the container is on a local file system and the target storage of the backup is an NFS/CIFS server, you should set --tmpdir to reside on a local file system too, as this will result in a many fold performance improvement. Use of a local tmpdir is also required if you want to backup a local container using ACLs in suspend mode if the backup storage is an NFS server.

snapshot mode

This mode uses the snapshotting facilities of the underlying storage. First, the container will be suspended to ensure data consistency. A temporary snapshot of the container’s volumes will be made and the snapshot content will be archived in a tar file. Finally, the temporary snapshot is deleted again.

vzdump ${ContainerID} --mode snapshot

Migration

You can clone a container to a different node using vzdump output piped to a pct restore command ran over SSH.

The SSH connection must be configured with SSH keys for passwordlesso authentication!

screen -R migration -L -Logfile ~/migration-$(date +%s)
pct stop 102
time vzdump 102 --dumpdir /var/lib/vz/dump --stdout  | ssh root@remote-server-ip pct restore --rootfs ${disk size} --storage=${remote storage} 102 -

You need to manually specify the rootfs size on the destiantion, to match the source

- at the end is needed to fetch the container backup from stdout