Help me update and support the tool by donating with PayPal.
Recently I wrote a blog about XenServer and Powershell commands this blog was also published on the Citrix Blog site here. With those commands in hand I wanted to create something that can be used by everyone who uses Citrix XenServer. To mind came a PowerShell VM Backup Script (invoke-XenBackup) and a PowerShell Forms GUI tool to also schedule your Backup of XenServer VM’s. The tool has the following functions:
- Create a backup folder with date.
- Take a snapshot of a running or stopped VM.
- Export the snapshot to a XVA file.
- Optionally Zip the backup folder.
- Optionally Email backup log.
- Shedule a backup as a Windows Scheduled Task.
- Run and delete scheduled backup tasks.
- Saves your XenServer Password in a Encrypted Vault.
- Now support for network drives, enter a path like \\DOMAIN\Share at Enter backup path and the tool will mount the drive. The task user does need to have write permissions on the share.
- Temp issue fixed, the tmp file created by the export will now be written to the backup destination instead of C drive.
- GUI hangs on run now backup is fixed, run now backups will now be set as a windows task that runs directly. You can manage your RUN NOW tasks in the scheduled tasks window.
- Performance improvements.
- Minimal Windows 7 or 2008R2
- PowerShell V3 (for win7 and 2008R2 please install: https://www.microsoft.com/en-us/download/details.aspx?id=34595
- Backup sheduling only works on windows 2012 / or 8 and up
- Tool is tested with XenServer 6.5 , 7.x
- “Set-ExecutionPolicy Unrestricted” must be set.
The heart of the tool is a PowerShell script I created named invoke-XenBackup. The script does require the XenServer PowerShell module installed. The GUI Tool will do this automatically. To do this manually download the PowerShell module here under the development section. And extract it to your PowerShell Module folder.
Example how to use the script:
Invoke-XenBackup -ExportPath “C:\Backup” -VMnames “VM01″,”VM02″,”VM03” -username “root” -password “P@ssw0rd” -XenHost “XenHost01” -LogPath “C:\Temp” -Email -SMTPServer “smtp.domain.com” -FromEmail “firstname.lastname@example.org” -ToEmail “email@example.com” -ZIP
This will backup VM01, VM02 and VM03 from XenHost01 in C:\Backup. Username and Password are for XenHost01. After the backup the folder will be ZIP’d and the backup logfile will be send in a email to firstname.lastname@example.org
There is now also a multi-threaded version of the script thanks to Bill Rogge. The script uses 6 threads by default but you change that under thread count.
I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me: