Backup - Restore - Live Migration

From Proxmox VE
Jump to: navigation, search
Yellowpin.svg Note: Article about the outdated Proxmox VE 1.x releases


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

Define a backup storage

Next you can define the backup job using that storage.

Define new backup job

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:

  1. Just copy the tar file to the host where you want to restore.
  2. Use 'vzrestore' to restore OpenVZ containers, or 'qmrestore' to restore KVM machines.

Example1: Restore the backup of OpenVZ container CT 123 (backup file: vzdump-openvz-123.tar) to CT 124

vzrestore vzdump-openvz-123.tar 124

Example2: Restore the backup of KVM VM 123 (backup file: vzdump-qemu-123.tar) to CT 124

qmrestore vzdump-qemu-123.tar 124

Example3: Restore the backup of KVM VM 123 (backup file: vzdump-qemu-123.tgz) to CT 124 in Storage with the Name raid1data

qmrestore --storage raid1data vzdump-qemu-123.tgz 124

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. To make this work, virtual machine must be stored on shared network storage (NFS, iSCSI, ...) accessible from all cluster nodes.