3 Methods to Backup VMware ESXi Host Configuration

Delia
4 min readMay 20, 2022

Do you need to backup vmware host?

In most cases, it is not necessary to back up the VMware host, because reconfiguring an ESXi host is not difficult. And if you have too many VMware hosts to configure, there are many automated deployment tools to choose from, for example, vSphere Auto Deploy. What really matters is to backup VMware ESXi VMs, which contains almost all the data you need.

However, if you only have one vmware host, or if reconfiguring your VMware ESXi host is considered complex and time-consuming, then you can back up your host to reduce the impact of host failure, and save time.

In this article I will introduce 3 ways to back up VMware ESXi host configuration using official tools.

How to backup VMware ESXi host configuration

In this section, I will introduce you 3 ways to back up VMware ESXi host configuration:

  • Using ESXi command line to back up ESXi host configuration, you do not need to install additional software.
  • VMware PowerCLI is a collection of PowerShell Modules to manage VMware infrastructure. It’s convenient for windows users since PowerShell is installed by default with Windows OS or Windows Server.
  • The vSphere CLI provides perl based tools, allows you to run common system administration commands against ESXi systems from any machine with network access to those systems. But since it is deprecated in vSphere 7.0, reliance on vSphere CLI is not recommended.

Method 1. Use ESXi command line to backup ESXi host configuration

1. Enable Secure Shell (SSH), and connect to your ESXi host via SSH.

2. Since every hour the ESXi host configuration is automatically saved in the /bootblank/state.tgz file, you need to first run the following commands to save the current ESXi host configuration in that file, that is, to synchronize the changed configuration with the persisitent storage.

vim-cmd hostsvc/firmware/sync_config

3. Now you can back up the ESXi host configuration by running the following commands:

vim-cmd hostsvc/firmware/backup_config

It will output a link below for you to download the configuration file with a web browser.

4. Replace the * in this link with your own ESXi host IP/FQDN, and navigate to this link from the web browser.

5. The backup file will be in the /downloads directory (default is browser or choose to download to a specific directory) with the name configBundle-HostFQDN.tgz.

Method 2. Use VMware Power CLI to backup ESXi host configuration

1. Install and configure VMware Power CLI module.

2. Run Power CLI as administrator, and run the following commands to connect to your ESXi host:

Connect-VIServer ESXi_IP_address -user user_name -password your_password

Note: The bold text in commands is what you need to replace with your information.

3. Now you can run the following commands to back up your ESXi host configuration:

Get-VMHostFirmware -VMHost ESXi_host_IP_address -BackupConfiguration — DestinationPath output_directory

Then your ESXi host configuration will be backed up in tgz format to the directory you specified.

Method 3. Use vSphere CLI to backup ESXi host configuration

1. Install and configure vSphere CLI. You can refer to the official documentation and references: vSphere CLI

2. Run the following command to back up the ESXi host configuration:

vicfg-cfgbackup — server= ESXi_host_IP_address — username=root -s output_file_name

In vSphere CLI for Windows:

2. Navigate to C:\Program Files\VMware\VMware vSphere CLI\bin in Command Prompt.

Note: the 64 bit version of PowerCLI is installed in C:\Program Files, and the 32 bit version is in C:\Program Files (x86).

3. Run the following command to back up the ESXi host configuration:

vicfg-cfgbackup.pl — server=ESXi_host_IP_address — username=root -s output_file_name

Then a backup text file will be saved in the current working directory where you run the vicfg-cfgbackup script.

Summary

In most cases, backing up the VMware ESXi host configuration is not necessary. Redeploying the host is quick and easy, and can be assisted with automated deployment tools.

However, if you manage smaller sites, you may not want to set up the host from scratch. In this article I summarized 3 ways of using official tools to back up VMware ESXi host configuration. They can be helpful in this case.

--

--

Delia
0 Followers

Sharing tips and solutions about Windows 10, data protection, disk partition, etc.