VMware vSphere Hypervisor (ESXi) is a leading virtualization solution known for its reliability and performance. For users under a budget, the free version is a popular option since it provides sufficient capabilities if centralized management of multiple machines is not needed. However, backup becomes a problem because most commercial ESXi backup programs require the Data Protection API which isn't available in the free ESXi version, which means you not only need to buy an expensive ESXi backup software but also upgrade your ESXi license -- the total cost can amount to more than one thousand dollars per year for a single machine.

For this reason we ported our popular general-purpose backup tool, Duplicacy to ESXi and built Vertical Backup, a high performance and low cost ESXi backup tool. Unlike most others, Vertical Backup doesn't rely on the Data Protection API so it runs smoothly on the free ESXi version. Thanks to our state-of-the-art deduplication algorithm, Vertical Backup can outperform much more expensive commercial backup software in terms of backup speed and storage usage.

We'll show you how easily you can back up ESXi virtual machines with Vertical Backup.

Enable SSH

Vertical Backup runs directly on the ESXi host, so as the first step you'll need to log in to the ESXi host via SSH. If SSH isn't enabled, you can follow this guide to turn it on.

To start an SSH session, run this command on a Linux or macOS computer:

    ssh root@esxi_hostname_or_ip

On Windows, you may need to install and use putty instead of SSH.

Download

After you log in to the ESXi host via SSH, you can create a directory for storing the Vertical Backup executable to be downloaded. This directory will also serve as the working directory for running various commands later This directory can be placed anywhere, but a subdirectory under a datastore is recommanded, as directories outside of a datastore may be removed after the ESXi host reboots.

    mkdir /vmfs/volumes/datastore1/verticalbackup
    cd /vmfs/volumes/datastore1/verticalbackup                    
                

Now you are ready to download Vertical Backup. After that, change the executable permission of the downloaded file so that it can be runnable:

    wget http://verticalbackup.com/esxi/vertical
    chmod u+x vertical
            

Initialization

The init command initializes the working directory as well as the remote storage:

    ./vertical init esxi67 sftp://esxi@192.168.1.100/storage

Here we use esxi67 as the host id. Each ESXi host should have a unique host id. Multiple ESXi hosts can back up to the same storage, and in fact this is the recommended way as this enables cross-host deduplication.

The directory named storage under the home directory of the user esxi on the server 192.168.1.100 will be initialized as the remote storage for storing backups, which will be uploaded via the SFTP file transfer protocol. The init command will prompt you to enter the password for logging in to the storage server.

As another example, if you plan to use an Amazon S3 bucket as the remote storage, the init command should be like this:

    ./vertical init esxi67 s3://bucket

The specified bucket will be initialized as the remote storage. You'll be prompted to enter your S3 access id and secret key.

In additional to SFTP and Amazon S3 storages, Vertical Backup also supports local and NFS disks, other S3-compatiable cloud storages (such as wasabi), Backblaze B2, and Microsoft Azure.

Backup

This command backs up a virtual machine named vmname> :

    ./vertical backup vmname 

Vertical Backup assigns increasing revision numbers to backups, starting at 1 for the first backup. We can list previous backups using the list command:

    ./vertical list 

Restore

The restore command restores a virtual machine to a previous revision:

    ./vertical restore vmname -r 1 --power-off --power-on

Schedule

This command sets the virtual machine vm-ubuntu to be backed up 10 minutes after every hour:

    ./vertical cron 10 vmname 

We can also provide the time in the hh:mm format to schedule a daily backup job:

    ./vertical cron 11:30 vmname 

Email notification

To set up email notifications, first run the email command:

    ./vertical email smtp.gmail.com 587 username password from@gmail.com to@gmail.com 

Then when we can run the backup command with the --email option. An email will be send to to@gmail.com after the backup is finished.

    ./vertical backup vm-ubuntu --email 

The --email option can also be provided to the cron command to enable email notifications for a scheduled backup job:

    ./vertical cron 0:30 vm-ubuntu --email