Backing up ESXi host configuration

Sharing is caring!

vCli, or Virtual command Line Interface is a free tool from VMware, and it’s 25+ cmdlets that allows you to do certain things. The easiest way to get it is the log onto the web interface for you ESXi host, and you’ll find a link that will take you right to the download site.
 

 
ESXCLI commands
Run –help at any level of the hierarchy for information
about both commands and namespaces available from that level.

For example to Backup ESXI configuration , First, you have to be in vCli to run this command
 
The vicfg-cfgbackup command backs up ESXi configuration data and restores them later. You can back up the host configuration, restore the configuration to the host, force the restore of the configuration, and reset the host to factory settings.
Back up ESXi host configuration before you change the configuration or upgrade the ESXi image
 
Parameters:
 
conn_options
Specifies the target server and authentication information if required. Run vicfg-cfgbackup --help for a list of all connection options.
–force | -f
Forces the restore of the configuration.
–help
Prints a help message for each command-specific and each connection option. Calling the script with no arguments or with --help has the same effect.
–load | -l
Restores configuration from onto the host.
–save | -s
Backs up the host configuration.
Include the number of the build that is running on the host that you are backing up in the backup filename. If you are running the vSphere CLI from vMA, the backup file is saved locally on vMA. Local storage for backup files is safe because vMA is stored in the /vmfs/volumes/ directory, which is separate from the ESXi image and configuration files.
–reset | -r
Resets the host to factory settings.
–quiet | -q
Performs all operations without prompting for confirmation
 
Examples
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying the server, user name, and password. Run vicfg-cfgbackup --help for a list of common options including connection options.
Back up the host configuration to the file C:backup.txt:
 vicfg-cfgbackup  -s C:backup.txt
 
Reset the host, that is, restore to factory settings:
 vicfg-cfgbackup  -r
 
Restore a configuration previously saved to C:backup.txt to the host:
 vicfg-cfgbackup  -l C:backup.txt
 
Restore a configuration from C:backup.txt without prompting for user confirmation:
 vicfg-cfgbackup  -l C:backup.txt -q

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.