STEPS TO TAKE BACKUP :
You will need to install the perl Lchown module on the backup server. So on the backup server run this:
perl -MCPAN -e “install Lchown”
To add a central backup server, first go to admin home -> central backup servers and add the servers by providing the parameters there. The parameters are:
Backup Server Name/Ip
Slave-ID Slave ID is needed if you want the browse backup feature, that allows the end user to browse and restore his own backup files individually. To enable browse-backup, you have to add the backup-server into the hyperVM cluster, and then provide the slave-id of the backup-server here.
SSH Port :
Backup Root Directory : This is the core root directory where the backup will be stored. For instance, /mnt/backup/hypervm/ . The backup of the vps will be stored inside this directory.
Number of Backups : This is the total number of backups to be taken. The default is 3, but you can set upto 7. This many backups will be permanently stored on the backup server.
You can add many backup-servers here.
After adding the backup-servers, go to server home -> central backup config and then set the central Backup Server for this particular slave. Many slaves can share one backup server. If you want the old setup, just add one backup-server, and then set this as the backup-server for all the slaves.
To enable backup for a vps, you will need to set the central backup feature, by going to vps home -> limit and checking the enable central backup
The steps required for backup:
a) You have to create a passwordless ssh channel from the master to each backup server. This is the only ssh access you will need to configure. This can be accomplished by running the scpid.sh script that comes with hypervm.
cd /usr/local/lxlabs/hypervm/httpdocs/
//foreach backupserver
sh ../bin/common/scpid.sh root@servername
The username has to be root, since you need to replicate entire userids on the backup server.
b) Setup Osimages on each backupserver.
cd /usr/local/lxlabs/hypervm/httpdocs/
//foreach backupserver
lphp.exe ../bin/backuposimage.php –backuplocation=root@servername:/full/path/to/backup/directory/ –sshport=$sshport
The above will automaticaly setup all the Osimages from the master in the backup server. The backuplocation is a composite string of the form user@server:/full/path, where ‘full/path’ is the location on the backupserver which is going to the root directory for the backups. Please note that you have to provide full paths, since otherwise the rsnapshot program will not work. The vps backups will be taken relative to the Osimage the vps is created from.
cd /usr/local/lxlabs/hypervm/httpdocs/
lphp.exe ../bin/vpsbackup.php –newarg=true
d) Schedule it everyday in cron. Or whatever period you want the backup to happen.
The central backup flag is managed via the resource plans and also in vps home -> limit . You can enable/disable central backup for VPSes by changing them either in the limits or in the resource plans.
The –newarg=true is to distinguish the current configuration from the old one. If you don’t provide the newarg=true , the backup script will fail and send a warning message to admin.
SOURCE : lxlabs.com