ESXi acts as a really flexible and powerful monster of an operating system which can easily divvy up your server’s physical hardware in to virtualised components. These components can then be shared among tens of virtual machines depending on how you’ve set things up.
Although flexible and powerful, I could not find any straight forward back-up guides for backing up my virtual machines.
Snapshots are in no way shape or form back-ups so that is out of the question. I did take a look at copying the VMs out of the data store either through the vSphere client or SSH but that is a bit messy.
There’s a tool I came across called ghettoVCB – it actually seems like quite an advanced and (potentially) flexible shell script, however it looks like it would take some time to set-up. I may give this a try later down the line and blog about it if I think it will be useful.
After a bit of searching around, I found an inbuilt function in the vSphere client which allows you to export and import OVF templates. After a bit of searching around, I saw people asking similar questions as to whether you can use these as back-ups; there were no definitive answers but after thinking about it, I can’t see why not?
OVF (Open Virtualization Format) templates are most used as … *surprise* … VM templates.
They can be used to take a full dump of a virtual machine in its current state and export it to a file (OVA) or folder of files (OVF). This allows you to store the export somewhere safe and deploy it on the same or other ESXi host as you wish.
I was actually quite surprised as to how easy the entire end-to-end process was. I was expecting it to take me a day or two (seeing as I’ve never backed up/restored a VM) but it actually ended up taking only two hours.
The Process to Back-up – Manual
- Open your vSphere client
- Turn off the VM you want to back-up
- Delete and consolidate any snapshots you may have
- Highlight the VM in the left pane
- Click File — Export OVF Template
- Give your export a name, location to export to and whether you want it in single file or multi file mode. Folder of files (OVF) mode should be used if you want to later deploy the VM over a web server. Single file (OVA) mode should be used if it doesn’t need to be published via a web server. Use if you want to transfer over USB, back-up to some other storage, et cetera.
The Process to Restore
- Open the vSphere client
- Click File — Deploy OVF Template
- Locate the .ova file or input the URL where the .ovf is stored
- Click Next and input name of the new VM and other fields as necessary
The Process to Back-up – Automatic/scripted
I haven’t looked in to automating the back-ups as of yet but I plan on using the vSphere Command-Line Interface to script the entire back-up process.
Subscribe to the blog so you are notified when I post new ESXi related articles 😉