Tag Archives: ploop

Ploop backups

Image-based backup

Assuming you have a running container identified by $CTID. The following needs to be done:

# Known snapshot ID
ID=$(uuidgen)
VE_PRIVATE=$(VEID=$CTID; source /etc/vz/vz.conf; source /etc/vz/conf/$CTID.conf; echo $VE_PRIVATE)

# Take a snapshot without suspending a CT and saving its config
vzctl snapshot $CTID --id $ID --skip-suspend --skip-config

# Perform a backup using your favorite backup tool
# (cp is just an example)
cp $VE_PRIVATE/root.hdd/* /backup/destination

# Delete (merge) the snapshot
vzctl snapshot-delete $CTID --id $ID

File-based backup

Assuming you have a running container identified by $CTID. The following needs to be done:

# Known snapshot ID
ID=$(uuidgen)

# Directory used to mount a snapshot
MNTDIR=./mnt
mkdir $MNTDIR

# Take a snapshot without suspending a CT and saving its config
vzctl snapshot $CTID --id $ID --skip-suspend --skip-config

# Mount the snapshot taken
vzctl snapshot-mount $CTID --id $ID --target $MNTDIR

# Perform a backup using your favorite backup tool
# (tar is just an example)
tar cf backup.tar.xz $MNTDIR

# Unmount the snapshot
vzctl snapshot-umount $CTID --id $ID

# Delete (merge) the snapshot
vzctl snapshot-delete $CTID --id $ID

OpenVZ ploop advantages

  • File system journal is not bottleneck anymore
  • Large-size image files I/O instead of lots of small-size files I/O on management operations
  • Disk space quota can be implemented based on virtual device sizes; no need for per-directory quotas
  • Number of inodes doesn’t have to be limited because this is not a shared resource anymore (each CT has its own file system)
  • Live backup is easy and consistent
  • Live migration is reliable and efficient
  • Different containers may use file systems of different types and properties

In addition:

  • Efficient container creation
  • [Potential] support for QCOW2 and other image formats
  • Support for different storage types

How to start?

In global VZ configuration file /etc/vz/vz.conf:

VE_LAYOUT=ploop