vzdump is an utility provided by OpenVZ to backup all VE running on node. It basically creates a tar archive of the VE private area, which also includes the VE configuration files.
There are basic 3 ways to backup VE :
- Stop the VE during backup – VE is stopped till entire VE is backup but it takes too long causing long downtime so not recommended during peak days.
- Use rsync and suspend/resume – this is another method but it also suspends VE during backup but it only advantage is downtime is very low.
- Use LVM2 – this method do not need VE to be stopped during backup so no downtime.
vzdump stores the backup on the disk in a single file.
vzdump OPTIONS [--all â <VEID>]
--compress compress dump file (gzip)
--dumpdir DIR store resulting files in DIR
--xdelta create a differential backup using xdelta
--mailto EMAIL send notification mail to EMAIL
--stop stop/start VPS if running
--suspend suspend/resume VPS when running
--snapshot use LVM snapshot when running
--restore FILENAME restore FILENAME
Command to Backup :
Simply dump VE 110 – file will be stored in default dump directory /vz/dump/.
Use rsync and suspend/resume to create a snapshot (minimal downtime).
vzdump --suspend 110
Backup all VEs and send notification mails to root.
vzdump --suspend --all --mailto root
Use LVM2 to create snapshots (no downtime).
vzdump --dumpdir /space/backup --snapshot 110
Restore above backup to VE 110
vzdump --restore /space/backup/vzdump-110.tar 110