ESXi 5.0 / ESXi 5.1 Host Backup & Restore GUI Utility (PowerCLI based)
This is a little bit of a fun project I have been working on in bits of spare time I find. It is all written in PowerCLI 5.0 / 5.1 / PowerShell and the GUI was laid out using Primal Forms Community Edition.
Updates (17-02-2013) – version 1.3:
- Hosts are retrieved using a new method (for both backup and restore options)
Updates (29-12-2012) – version 1.2:
- Added ESX/ESXi host validation into utility – will now test that the host is valid and either connected or in maintenance mode before attempting backup or restore (See the script’s new “Check-VMHost” function for those interested)
- Minor UI improvements
Updates (29-10-2012) – version 1.1:
- This utility has been tested on ESXi 5.1 Hosts and confirmed to be able to successfully create a backup archive file of these.
- Be sure your DNS is working correctly on the system you run the Backup utility on – it relies on DNS to find your ESXi hosts as they are named in the dropdown when you select the host to backup. (See comments for troubleshooting)
- Restore to new hardware (force restore) option added
- Fixed labels and connection box label description
What it is essentially, is a GUI that allows you to Backup ESXi 5.0 or ESXi 5.1 hosts to a destination of your choice on a local drive. It also allows you to restore ESXi Host configuration bundle backups taken, to other Hosts. I had other plans to integrate cloud storage options in (Amazon S3) as a backup target, but I thought that this doesn’t really offer anything valuable and I would just keep it relatively simple for now – therefore I have disabled this functionality. The PowerCLI script is fairly long – and I know there are plenty improvements I could make to better it and shorten the code, but for now it does the job. I have added various catches for exceptions / errors so you should get visual feedback if you have entered an invalid path, or username for example.
Anyway, hopefully this proves useful to some! As always, take care using the backup / restore functionality of this utility. The restore functionality works by first putting the ESXi host into Maintenance mode (if it isn’t already in this mode) and then applying a backup bundle to the host (Restore). The Host will reboot immediately following this. The Backup and Restore is implemented using Get-VMHostFirmware and Set-VMHostFirmware cmdlets so you can read the help descriptions for an idea on how exactly these work. The Host Backup Bundles are stored in a path of your choice and when restoring from a path the cmdlet works by looking for a bundle filename that matches the name of your ESXi host selected to restore to. Note that the file browser module I have implemented here (used to select paths) is a modification of the work done by Ravikanth Chaganti on his PowerShell Help Browser GUI. I simply adapted his code to list the contents of local drives in a tree view instead of PowerShell Help cmdlets. The only limitation here is that I have not implemented code to browse further than one level into the root of each drive. If you can provide this modification yourself, please feel free to contribute in the comments! I have just not spent the extra time to do this myself yet.
Here are a couple of quick screenshots of the Utility / GUI:
Current version (1.3):
(Version 1.3) Download ESXi 5 Host Backup & Restore GUI Utility (9717)
(Version 1.2) Download ESXi 5 Host Backup & Restore GUI Utility (3571)
(Version 1.1) Download ESXi 5 Host Backup & Restore GUI Utility (1623)
(Version 1.0) Download ESXi 5 Host Backup & Restore GUI Utility (3126)