Backup ESXi Host

How to Backup ESXi Host

Do you want to know the easiest methods to backup ESXi Host? Well, you are in the right place at the right time. You can follow the guide to learn three easy methods to easily perform your task.

Wondershare Recoverit Authors

Sep 09, 2020 • Filed to: Take Data Backup • Proven solutions

0
Q: How to backup ESXi Host?
“I am one of those individuals who are very protective of their computer and ESXi host. Many people don’t understand the significance of backing up ESXi Host’s configuration. I want to regularly back up an ESXi Host’s configuration so I can easily restore it late. This will ensure an extra layer of protection to my valuable data. I’m sure making a backup of ESXi Host will reduce the chances of any causalities in the future. However, I’m looking for some simple ways to perform this task, I’m not a technical person, but I surely want to do this.”

Yes, it is quite understandable that you want to make your ESXi host more secure. Well, you have chosen the finest option of backing up ESXi host. Luckily, in this guide, you have easiest ways to backup ESXi Host without any hurdles. Not only this, but we will be explaining the significance of this task side by side in the methods mentioned below in the guide. Make sure you follow the guide until the end and implement the methods step by step.

Q: How to backup ESXi Host?

Making a backup of ESXi host is surely a part of an efficient recovery strategy. You can easily restore a host to a known working configuration using Power CLI, vSphere CLI, or ESXi shell commands. You can export state.tgz using one-liner command and procedure mentioned in the guide. You can also put together a script that backs up the configuration of one or more ESXi hosts. Once you have done that, you can easily automate the process using windows job scheduler or even corn job running on Linux. Restoring a host’s configuration is surely very easy procedure. You can implement the methods mentioned in the guide on earlier releases of ESXi versions too. These are the three methods to conduct your task properly;

Method 1: Using power CLI

The first method requires power CLI. In case you haven’t installed power CLI, you need to download it first to move ahead. Once you have downloaded it. You need to make sure it is run as an administrator. After that you can follow the procedures of backup and restore;

Backup

In order to back up the host configuration, you need to use the “Get-VMHostfrimware” cmdlet. You can clearly view in the picture that the configuration for host “192.168.29.10” is being backed up to the c:\esxi_backups folder on a laptop. Make sure that you have already established a connection to the host using the Connect-VIServer cmdlet.

using-power-cli

Restore

Once you have successfully made the backup. Now, you need to learn how to restore it properly. When it comes to restoring the host’s configuration from the backup file, there are more steps than in backup. Host must first be put in maintenance mode and using the Set-VMHost cmdlet. While you have ESXi maintenance mode, you need to use the “Set-VMHostFirmware” power CLI command to restore the host’s configuration from a previous backup. There are a few things you must keep in mind;

using-power-cli-restore

Note 1: Once you have run the command, the host will reboot automatically. You need to make sure that you have power off or migrated any VMs hosted on it.

Note 2: When it comes to build number and UUID of the host that you are restoring, they must match the one’s backed up. You can skip the UUID check by adding the -force parameter to the Set-VMHost cmdlet. Suppose there is a mismatch in the build number, it will fail to run. You need to keep a proper sight that you are restoring to the correct host.

using-power-cli-3


Method 2: Using the ESX Command line

The ESXi’s vim-cmd is efficient enough to backup and restore the host configuration directly from the shell. You can surely do this by enabling SSH on the host and use putty to log in as root. You need to run two commands mentioned in the picture below. Run them in proper order. You are also given a URL which you will use to download the TGZ bundle from the host using a standard browser. Make sure that you have replaced the * character in the URL with the IP address of the ESXi host.

esx-command-line

It resembles the method mentioned above. You need to put the host in maintenance mode right before you restore from a configuration backup file. You need to use vim-cmd to do this too. Moving on, you need to copy the backup file to a folder on the ESXi host using WinSCP. This will enable the host to reboot and complete the restoring process properly.


Method 3: Using the vSphere CLI

If you do not have the latest version of vSphere CLI, you need to download it first to proceed further. On windows machine, CLI commands consisting of Perl script are run from the default location C:\program files (x86)\VMware\VMware vSphere CLI\bin. As it is the work with the pearl scripts, you must install Perl interpreter side by side. You can download the one which is suggested by VMware.

You can also download strawberry release and once you have done that, you must add c:\strawberry\c\bin to %path% on windows to tackle running into missing DLL issues. First of all, you need to open the administrative prompt and type path=%path%;c:\strawberry \c\bin. The change will only be for the current command session. You can change to stick if you want path, go to system properties and edit it by clicking on the environment variables button in Windows. You need to run this Perl script; vicfg-cfgbackup. This can perform both the task of backup and recovery. You need to follow the procedure to backup ESXi host;

v-sphere-cli-1

Step 1: First of all, you need to open command prompt as administrative.

Step 2: Moving on, you need to run cd\ “program files (x86)\VMware\VMware vSphere CLI\bin.

Step 3: Furthermore, run vicfg-cfgbackup.pl -server=- username=root -s .

Step 4: Lastly, you need to type the ESXi’s root password.

Once you have made the backup, you need to restore it from a specific configuration backup file, you need to follow the same procedure but this time you just have to replace -s parameter with -/. Meanwhile, you will be also warned about that the host will reboot. You need to allow it by typing a yes and the restore process will complete.

vsphere-cli-2


Conclusion

Making the backup of ESXi host is essential for the people who attain proper restore strategy. However, the first thing to do is get the finest software or tool. The tools mentioned in the guide give the users chance to perform every task with simplicity. This makes the stiff method much more-easier than you can imagine. Although, these tools have numerous alternatives, but these are the best. You can also utilize the scheduled backups to create ease for yourself. The only thing that you are required to do is to follow the method carefully, you must never skip a step, it can worsen your condition.

Recoverit author

Amy Dennis

staff Editor

0 Comment(s)
Home > Resources > Take Data Backup > How to Backup ESXi Host