Link to home
Start Free TrialLog in
Avatar of quibbly
quibblyFlag for United States of America

asked on

Xen 5.5 scheduled offline backup (not snapshot)

I have a few Xen 5.5 servers in production and presently I'm not happy with the snapshot feature to a NAS device.  Seems there are a few issues with recovery of snapshots.

What I'm looking for is an automated script that will take the virtual servers offline (shutdown), export to a mounted NAS (I do this already with our NAS).  Once the export is done, start the virtual servers backup.

What I have found with testing is that the export of the virtual server is the only real way to recover a virtual server to another Xen server without any issues.  
ASKER CERTIFIED SOLUTION
Avatar of ToxicPig
ToxicPig
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of quibbly

ASKER

for this to work, I set it up like this:

mkdir /home/backup
mkdir /backup
vi /home/backup/vm_backup.sh

mount //192.168.10.25/Backups -o password= /backup

xe vm-shutdown uuid=408b46f8-80b3-876e-45a3-ce06a0f3c1d0
xe vm-shutdown uuid=c1b49ae2-130c-2e7b-cabf-c7636669cd18


xe vm-export uuid=408b46f8-80b3-876e-45a3-ce06a0f3c1d0 filename=/backup/svr-pm.xva
xe vm-export uuid=c1b49ae2-130c-2e7b-cabf-c7636669cd18 filename=/backup/svr-pdc.xva


xe vm-start uuid=c1b49ae2-130c-2e7b-cabf-c7636669cd18
xe vm-start uuid=408b46f8-80b3-876e-45a3-ce06a0f3c1d0

umount /backup


I then created a cronjob

crontab -e

0 2 * * * /home/backup/vm_backup.sh >> /home/backup/vm_backup.log 2>&1