Back-Up and Restore the VMware ESXi Host Configuration
Backup is one of the most critical activities for the continuous operation of any IT infrastructure.
Operating servers as virtual machines (VMs) on ESXi hosts in vSphere gives you significant benefits when backing up your VM data.
Host-level backup allows you to use valuable features such as agent-free backup, complete VM backup (VM data + VM configuration), backups to active VMs, and low server load. Having healthy ESXi hosts is the key to success when working with virtual machines.
It is, therefore, better to back up the ESXi configuration. Thus, if something goes wrong with the ESXi host, its structure can be restored in minutes without consuming a lot of time configuring the ESXi server from scratch.
Using the ESXi command line to back up the ESXi host
By utilizing the ESXi command line is the most acceptable method of backing up your ESXi host configuration. To be honest, you do not have to install any additional software in order to use the ESXi command line. You must enable ESXi shell and remote SSH access to the ESXi host.
This process is explained in the ESXCLI blog post. Once you have connected to your ESXi host via SSH, you can execute the commands.
How to reset the ESXi configuration in the ESXi command line
To restore the ESXi configuration, you need to have ESXi of the same version and machine build number. This rule applies to all ESXi configuration recovery methods discussed in this blog post.
Suppose you want to reset the ESXi configuration to an ESXi host installed from scratch (clearly established). In that case, you need to set the IP address for the network interface used for the ESXi management network and enable SSH access.
How to back up ESXi host with vSphere CLI
Another command-line interface provided by VMware for managing ESXi hosts is vSphere CLI (not to be confused with VMware PowerCLI). You need to install vSphere CLI on a Linux or Windows machine to manage ESXi hosts remotely.
Perl is required to install vSphere CLI. Using vSphere CLI is its convenience and bash power in Linux.
How to make backup ESXi configuration automated
If you have a dynamically changing environment and the configuration of ESXi hosts changes frequently, manually copying ESXi hosts may not be rational. In this case, you can automate your ESXi backup configuration by adding a backup command or a backup script that contains multiple orders in the scheduler.
The ESXi configuration backup is done automatically, which is excellent, but there is a drawback. When crontab executes a scheduled command to back up the ESXi configuration, the previous file is overwritten with the new file.
This situation could cause you problems if the jam with the correct ESXi configuration made yesterday is overwritten with a file created today that contains an incorrect ESXi configuration. The right way to prevent such a problem is to back up the ESXi configuration to different files.
Using the ESXi command-line interface is good because you do not need to install additional software. The advantages of vSphere CLI are the remote execution of commands using Linux machines and the automation of the backup ESXi configuration.