How to take backup and restore openvz (Proxmox Virtual Environment)?

Well, I am not that sound in playing with the tools of openvz but through the assistance of professionals, I came to learn how to take backup of openvz and restore it in another proxmox virtual environment. In order to understand this tutorial, you must have a little knowledge of Linux and its basic commands. The following steps more or less clearifies the process:

[dfads params=’groups=-1′]


  1. Login to your proxmox via root.
  2. Check whether there is sufficient space to take backup. Use the command below to check the available space on the system:

    moon:~# df -h

    Filesystem Size Used Avail Use% Mounted on

    /dev/mapper/pve-root 95G 15G 76G 16% /

    tmpfs 16G 0 16G 0% /lib/init/rw

    udev 10M 632K 9.4M 7% /dev

    tmpfs 16G 0 16G 0% /dev/shm

    /dev/mapper/pve-data 723G 272G 452G 38% /var/lib/vz

    /dev/sda1 504M 44M 435M 10% /boot

  3. In order to list out the virtual machines type the following command:

    moon:~# vzlist


    101 67 running

    103 206 running

    201 92 running

    240 64 running

    242 78 running

    410 109 running

  4. Note down the CTID for which you are taking the backup. CTID is an identifier which uniquily represents the respective virtual machine.
  5. Follow the command below to take the backup of the virtual machine:

    moon:~# sudo vzdump –dumpdir /var/lib/vz/dump/ 103 –suspend –compress

The above command takes a complete backup of the virtual machine whose CTID is 103 at the location /var/lib/vz/dump/. The backup process will take approximately an hour to complete. In order to confirm the successfull backup change the directory to /var/lib/vz/dump/ and execute the command ls or dir. Two files are generated prefixed by vzdump-openvz-*.

  1. Copy the backup to another proxmox using the following command:

    moon:~# scp vzdump-openvz-103-2014_06_24-17_22_53.tgz root@

  2. In order to restore, first of all login to your proxmox via GUI.
  3. Delete the virtual machine if there is insufficient space or make some space to restore the backup.
  4. Now, Login to your proxmox using ssh or putty. Change your directory to /var/lib/vz/dump/ (location of the backup) . Execute the following command:

    earth:~# vzrestore vzdump-openvz-103-2014_06_24-17_22_53.tgz 103

The above command will restore the backup creating a complete new virtual machine. It takes approximately an hour to complete the process.

  1. Login to your proxmox via GUI. A new virtual machine will be visible. Before starting the machine modify the IP Address in order to prevent the IP conflict.
  2. If the macnine contains MySQL binded with the IP then modify the IP from the file /etc/mysql/my.conf

[dfads params=’groups=-1′]

Leave a Reply

Your email address will not be published.