14 September, 2009

Automatic backup of XenServer vm with vm-export

Hi,

I needed to schedule a weekly backup of my VM's in my XenServer.
When I googled it I found a script written by Jeff Riechers, this script was good but did not help me because I did not have enough storage to take a snapshot to each VM.
I had to tweak it and I improved the method of retrieving the uuid (no more temp files...).

The final script reads from a file (named serverlist.txt) the vm name and the host on it resides. This is because I noticed that when I shut down the VM it gets a deferent home server, so I forced it to start on a specific host.

Just schedule it with cscript and your good to go.

Link to the script