Container Backup Feature¶
The container backup feature is used to block level backup container filesystems to local storage.
The feature is designed to use the snapshotting capabilities of copy-on-write file systems. We had started by first supporting ZFS, however due to licensing issues we switched to using BTRFS. Subutai containers use BTRFS sub-volumes for their filesystem backing stores. We take snapshots off these file systems.
The backup process analyzes a list of container mount-points and creates separated snapshots for each of them. If the backup is to be incremental, a file will be generated with a list of changed files between the current and last backup snapshot. The backup process then calculates binary deltas representing changed blocks between the two snapshots. It dumps these changed blocks into an archive to be permanently stored.
Backup storage structure:
/var/snap/subutai/common/lxc/backups/ |-- container_name | |-- 1477297700_Full | | |-- home | | |-- opt | | |-- rootfs | | `-- var | `-- 1477298237 | |-- home | |-- opt | |-- rootfs | `-- var |-- container_name_1477297700_Full.tar.gz |-- container_name_1477297700_Full_changelog.txt |-- container_name_1477298237.tar.gz `-- container_name_1477298237_changelog.txt
Changelog generating only for incremental backups. It is contain list of modified files between last and current snapshot. To generate changelog used rsync tool. Example of changelog file:
#cat container_name_1477298237_changelog.txt modified /var/cache/ added /var/cache/apt/ added /var/cache/apt/pkgcache.bin modified /var/lib/apt/ deleted /roor/somefile