Backing up VMs on ESXi

After putting together my home server along with its 4 VMs, I wanted to have a way to back them up periodically to a NFS datastore. Given that one of my drives in a ZFS pool failed recently, I realized that not having a backup of the ESXi datastore itself on which the VMDKs were hosted was not such a great idea.

As it turns out, there are not too many options for backing up VMs which are also free. Veeam Backup Free Edition could not be installed on my WinXP VM running on Workstation since it needed a more recent version. Trilead VM explorer did not allow for backing up to a NFS datastore, or on the ESXi machine from which it was backing up either. In this case, I could have mounted the external drive as a NFS datastore into ESXi’s filesystem. The only backup target that is allowed in the free version is the local computer itself and since my XP VM only has a 20GB thin disk, this solution would not work.

I came across William Lam’s ghettoVCB script which can handle backup and restore for VMs. It has quite a multitude of options that can be used to specify which VMs to backup, the target datastore to back them to, the type of format to store the VMDKs in and even allows for compressing the backups. Installation was easy, just follow the steps outlined here and you should be good to go. The only caveat is that since the script is in reality installed as a cronjob on ESXi, it might be a bit of an irritation if and when you do choose to upgrade the ESXi version on the host. Since this is a fairly rare occurrence, I am willing to live with this inadequacy for now. One last point to note is that the backups are not incremental but full backups so it might be a good idea to schedule them to run at night, or when the load on the host (and the VMs on it) is not high.

Leave a Reply

Your email address will not be published. Required fields are marked *