[Webinar] Streamline your web hosting managementRegister Today


Xen 5.5 scheduled offline backup (not snapshot)

Posted on 2010-04-05
Medium Priority
Last Modified: 2013-11-11
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.  
Question by:quibbly

Accepted Solution

ToxicPig earned 1500 total points
ID: 30135788
Referencing a previous answer of mine for the script:


All you would need to do would be take the script, and put it into a cronjob that you dump into /etc/crontab at the appropriate time for you.  Note there are new and better ways of taking backups and doing DR using Citrix StorageLink.

Author Closing Comment

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

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

mount // -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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Understanding the various editions available is vital when you decide to purchase Windows Server 2012. You need to have a basic understanding of the features and limitations in each edition in order to make a well-informed decision that best suits …
If you need to complete a Physical to Virtual (P2V), Virtual to Virtual (V2V) conversion to a VMware product (VMware Workstation, Player or VMware vSphere (ESXi) ) for FREE, then there is some good news...
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question