ProxMox: Backup - Restore - Live Migration
Introduction
Backup is one of the most important integrated features of Proxmox VE.
Backup with VZDump
VZDump is an utility to make consistent snapshots of running Virtual Machines (OpenVZ containers and KVM). It basically creates a tar archive of the Virtual Machines private area, which also includes the configuration files.
There are several ways to provide consistency:
- stop: Stop the VE during backup (very long downtime)
- suspend: Use suspend/resume (minimal downtime with OpenVZ, long downtime with KVM VMs)
- snapshot: Use LVM2 (no downtime, online)
VZDump stores the backup on the disk in a single file. This file should go to a tape backup for archiving. You can copy the file directly to a remote storage for easy tape backup (e.g. on a windows file server).
For details regarding OpenVZ commandline version see Backup of a running container with vzdump
Also check out the man pages:
man vzdump
Web Interface
Proxmox VE provides a web interface to define the backup jobs. First step is to define a backup storage. Most people simply use a NFS share on their NAS/SAN. Simply select content 'VZDump Backups' when you configure the storage. See also Storage Model
Next you can define the backup job using that storage.
The resulting configuration is saved as cron job to '/etc/cron.d/vzdump'. That file is syncronized to all cluster nodes.
Restore with vzrestore and qmrestore
To restore a Virtual Machine, just copy the tar file to the host where you want to restore. Depending on the type of virtual machine, use 'vzrestore' to restore OpenVZ containers, or 'qmrestore' to restore KVM machines.
Example1: Restore the backup of KVM VM 555 (backup file: vzdump-qemu-555.tar) to CT 500
qmrestore vzdump-qemu-555.tar 500
Example2: Restore the backup of OpenVZ container CT 777 (backup file: vzdump-openvz-777.tar) to CT 600
vzrestore vzdump-openvz-777.tar 600
Example3: Restore the backup of KVM VM 555 (backup file: vzdump-qemu-555.tgz) to CT 500 in Storage with the Name raid1data
qmrestore --storage raid1data vzdump-qemu-555.tgz 500
Live Migration
Proxmox VE support live migration of Virtual Machines via web interface. To migrate from one physical host to another, you need at least two Proxmox VE servers, see Proxmox_VE_Cluster.