[Users] Backing up ploop-based containers

Andrew Vagin avagin at parallels.com
Fri Mar 22 02:35:26 EDT 2013


On Thu, Mar 21, 2013 at 08:45:48PM +0100, Toke Høiland-Jørgensen wrote:
> Hi
> 
> I am looking to experiment with ploop-based containers, and am trying to
> figure out how to implement backups. I currently have a backup solution
> consisting of vzdump combined with an rdiff-based offsite storage of the
> resulting dump files.
> 
> Now my question is this: Can this be extended to the ploop case? I.e.
> can I do a ploop snapshot, and then copy the ploop container file off
> somewhere and expect that to be a valid (i.e. consistent and restorable)
> backup of the running container? Or is there something else I need to
> do? Or other files I need to backup (apart from the container config, of
> course)?

Yes, "ploop snapshot" can be used to get a consistent backup and
"LVM snapshot" isn't required in this case.

Below you can find my example:

A list of ploop files before backing up.
# ls -l /vz/private/3333/root.hdd/
drwx------ 4 root root        4096 Oct  8 06:52 cache-private
drwxr-xr-x 2 root root        4096 Oct  8 06:51 cache-root
-rw-r--r-- 1 root root         827 Mar 22 09:57 DiskDescriptor.xml
-rw------- 1 root root           0 Oct  8 06:51 DiskDescriptor.xml.lck
-rw------- 1 root root 10738466816 Mar 22 09:57 root.hds
drwx------ 2 root root        4096 Mar 22 09:57 root.hds.mnt
drwxr-xr-x 3 root root        4096 Oct  8 06:52 templates

Create a snapshot:
# vzctl snapshot 3333
Creating snapshot {58b51034-0bd9-4d5f-b6d5-7f5fdde8ad59}
Creating delta /vz/private/3333/root.hdd/root.hds.{fb865531-cf3d-4d24-ba02-78d93a9659eb} bs=2048 size=20971520 sectors


# ls -l /vz/private/3333/root.hdd/
total 10502168
drwx------ 4 root root        4096 Oct  8 06:52 cache-private
drwxr-xr-x 2 root root        4096 Oct  8 06:51 cache-root
-rw-r--r-- 1 root root        1168 Mar 22 10:01 DiskDescriptor.xml
-rw------- 1 root root           0 Oct  8 06:51 DiskDescriptor.xml.lck
-rw------- 1 root root 10738466816 Mar 22 09:57 root.hds
-rw------- 1 root root     9437184 Mar 22 10:01 root.hds.{fb865531-cf3d-4d24-ba02-78d93a9659eb}
drwx------ 2 root root        4096 Mar 22 09:57 root.hds.mnt
drwxr-xr-x 3 root root        4096 Oct  8 06:52 templates

Now you can see a new file root.hds.{fb865531-cf3d-4d24-ba02-78d93a9659eb}. It's
a new delta, where the ploop saves all new blocks. This file should be skipped
during back up. root.hds will not be changed and it contains all blocks before
snapshot.

Create a reserve copy
# tar -pczf /vz/backup.tar.gz -C /vz/private/3333 . --exclude='root.hds.{fb865531-cf3d-4d24-ba02-78d93a9659eb}'

Simulate a disk corruption.
# rm -rf /vz/private/3333/*

Restore from the reserve copy
# tar -xzf /vz/backup.tar.gz -C /vz/private/3333 .
# vzctl snapshot-switch 3333 --id '{58b51034-0bd9-4d5f-b6d5-7f5fdde8ad59}'
# vzctl snapshot-delete 3333 --id '{58b51034-0bd9-4d5f-b6d5-7f5fdde8ad59}'

> 
> Thanks,
> 
> -Toke



> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://lists.openvz.org/mailman/listinfo/users



More information about the Users mailing list