Automated ESXi Backup Without Dependencies!

I use VMware’s ESXi in my home lab environment. If you’re a technologist that is always messing with operating systems and applications, it is really the only way to go. But along with running any systems comes maintaining good backups!

There are numerous VMware backup products on the market. The problem is they all cost money. For me and other people who just play with this stuff for fun, that is not desirable. At all.

I created a little script that uses only the built in capabilities of a standalone ESXi host and SSH. The features are:

  • Uses only bash, SSH, and SCP
  • Takes a list of VMs in a config file (not that pretty to do unfortunately – let me know if you have a better way to do it in bash!)
  • Can be run via cron
  • Backs up both powered off AND running VMs. If the VM is running, a snapshot is created to do the backup and removed on completion
  • An email status is sent when backup is complete

I recommend coupling this script with a backup destination on a volume using deduplication to save space. If your environment is like mine, the VMs change very little each backup period, so the deduplication allows a full backup every time without wasting huge amounts of space.

The script is available on my Bitbucket here. If you have any suggestions to improve the script, do let me know. Or even better – fork it and submit a pull request!

One thought on “Automated ESXi Backup Without Dependencies!”

  1. An anonymous peostr stated that this “did not work” and gave no details to go with that. I assure you, this *does* work. I have ESXi 4.1 VMs all running with these changes in effect and I can copy-and-paste just fine between them (where I could not before making these changes). If you have made the changes described here and it “does not work”, can you give more details? Perhaps there is another conflicting setting or perhaps you did not reboot a VM or something?

Leave a Reply

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