This set of scripts is an automation of the backup and restore procedure for ESXi hosts recommended by MVware, these scripts use command execution via SSH, so they assume that SSH authentication by public key already exists on ESXi hosts.
Execute the following commands to deploy the tool.
# Clone the repo.
git clone https://github.com/usrbinbrain/esxi-respawn.git
# Go to the directory and add the execute permissions to the scripts.
cd esxi-respawn && chmod +x esxi-*
- ESXi BACKUP.
The esxi-backup.sh
script allows you to perform a massive backup task of several ESXi hosts, requiring only one list containing the IP or FQDN of one ESXi host per line.
The backup file is allocated in a directory structure that is created within the script's execution directory.
Example of performing a backup using a list as a parameter.
./esxi-backup.sh esxi_address_list.txt
- ESXi RESTORE.
The esxi-restore.sh
script operates on only one host at a time, and only performs the restore on the remote ESXi if there is no virtualization running.
After uploading the configuration file to the remote host, it requires confirmation to put the host in maintenance mode and perform the host restore, which necessarily requires an ESXi reboot.
This script requires only the IP or FQDN of an ESXi host as the first argument and a configuration file as the second argument.
To perform ESXi configuration restore follow this example.
./esxi-restore.sh esxi_ip_or_fqdn /full/local/path/configfile.tgz