OpenVZ Forum


Home » General » Support » Container backup (no official info) (Cannot find supprted way to backup containers)
Container backup (no official info) [message #52532] Wed, 17 August 2016 19:37 Go to next message
petr.holik is currently offline  petr.holik
Messages: 2
Registered: August 2016
Location: Czech Republic
Junior Member
From: *pe3ny.net
#prlctl backup zimbra
Backing up the CT zimbra
Failed to backed up the CT: Unimplemented. This feature is not implemented yet.
# prlctl --version
prlctl version 7.0.0 internal build
#  cat /etc/virtuozzo-release
OpenVZ release 7.0.0 (3515)


I've checked out git the repo containing prlctl and there is version 7.0.82 which seem to support creating backups.
I also found the https://help.virtuozzo.com/customer/en/portal/articles/2352873

My question is:
1) Is there any solution how to create consistent backup of running container?
2) if not, is there any time estimate when it will be added?
3) Why there is no section about creating backups in manual?

P.S. I am able to create backup with some magic with ploop and editing XML disk descriptors by hand, but its solution which I don't prefer to use in production.

Petr Holik
Re: Container backup (no official info) [message #52533 is a reply to message #52532] Thu, 18 August 2016 21:19 Go to previous messageGo to next message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
From: *msu.montana.edu
Looking at the comparison table (https://wiki.openvz.org/Comparison)... there is a difference between OpenVZ 7 and Virtuozzo 7. For the "Integrated Backup" feature it says OpenVZ no and Virtuozzo 7 yes.

Having said that, in OpenVZ Legacy with ploop-based containers... it was fairly easy to do just by:

1) Make a snapshot
2) Act upon the snapshot in some way
a) Such as mount it read-only
b) rsync from the mount point for a file-based backup
c) unmount the snapshot
3) Merge the snapshot down

I would assume a similar strategy should work in OpenVZ 7 but I haven't tried it yet.


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Re: Container backup (no official info) [message #52547 is a reply to message #52532] Tue, 06 September 2016 19:26 Go to previous messageGo to next message
jmginer is currently offline  jmginer
Messages: 24
Registered: July 2008
Junior Member
From: *hsi.kabel-badenwuerttemberg.de
Very disappointed to know that the "prlctl backup" command is only available in Virtuozzo, in OpenVZ there is no option to make backups.

We are some days working on a solution to integrate #vz7, and when we have started with the backup implementation we have found this issue.

It's very frustrating to know that OpenVZ have removed the vzdump tool without any other alternative.

How anybody will implement OpenVZ if there is no backup options for the CTs/VMs?
Re: Container backup (no official info) [message #52548 is a reply to message #52547] Tue, 06 September 2016 20:13 Go to previous messageGo to next message
petr.holik is currently offline  petr.holik
Messages: 2
Registered: August 2016
Location: Czech Republic
Junior Member
From: *pe3ny.net
Tho solution you described definitely should work.
We have lot of containers, we been using very simlilar solution for OpenVz containers. But now i don't know if this is _permanetly_ unsupported or just not implemented _yet_.
In wiki this look like unsupported permanently but in repository and in tool it look like its only temporary.
I don't want to write own solution if there is plans to get this working.

Re: Container backup (no official info) [message #52549 is a reply to message #52532] Wed, 07 September 2016 08:39 Go to previous messageGo to next message
jmginer is currently offline  jmginer
Messages: 24
Registered: July 2008
Junior Member
From: *hsi.kabel-badenwuerttemberg.de
In the OpenVZ release announce say: The main difference between the Virtuozzo (commercial) and OpenVZ (free)
versions are the EULA, packages with paid features, and Anaconda installer.

Will be possible to buy the backup package?
Re: Container backup (no official info) [message #52630 is a reply to message #52532] Wed, 16 November 2016 08:53 Go to previous messageGo to next message
nebbian is currently offline  nebbian
Messages: 3
Registered: November 2016
Location: Western Australia
Junior Member
From: *lnk.telstra.net
I've come across this issue today. Here's how I did it (based on how it was done in previous versions of OpenVZ).

1) Create /usr/local/bin/vzbackup:

#!/bin/bash
if [ -z $1 -o -z $2 ]
then
         echo "Usage: vzbackup CTID BACKUP-PATH"
         exit 1
fi

CTID=$1
FOLDER=$2
BACKUPPATH=$FOLDER/$CTID-$(date +%F_%H_%M)

#create BACKUP-PATH
mkdir -p $BACKUPPATH

# Known snapshot ID
ID=$(uuidgen)
VE_PRIVATE=$(vzlist -H -o private $CTID)

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

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

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

# remove old backups
rm -rf $( find $FOLDER -type d -name "$CTID*" -exec ls -d1rt "{}" + | head -n-4  )

echo "BACKUP FINISHED."




2) Run this periodically, passing in the container ID and the backup location, eg:
/usr/local/bin/vzbackup MyCT /backup/openvz/current/

Restoring from this backup

1) Create a new container, eg:
prlctl create Test --vmtype ct --ostemplate centos-7-x86_64

2) Determine the UUID of your new container, eg:
prlctl list -a

3) Copy all files in your latest backup directory to /vz/private/{UUID}/root.hdd/, overwriting all the existing hard disk files in there

4) Start the new container, eg:
prlctl start Test


This appears to be working for me. I'm sure that this isn't the best way to do things, but in my case, at least it's A way to back up my containers. I tried using snapshots, but I don't think that these restore the file system (which seems a bit odd to me).

Maybe it will work for someone. Or maybe I'm deluding myself into thinking that this is a valid backup technique.
Re: Container backup (no official info) [message #52715 is a reply to message #52630] Mon, 16 January 2017 11:51 Go to previous message
sgoeldi is currently offline  sgoeldi
Messages: 6
Registered: January 2017
Junior Member
From: *175.0.85.dynamic.wline.res.cust.swisscom.ch
Have you more experience with this in the meantime?
Does the restore work for you on the described way?
Previous Topic: Ploop Backup
Next Topic: application templates
Goto Forum:
  


Current Time: Mon May 29 09:45:25 GMT 2017