Backing Up Configuration Information with vicfg-cfgbackup
After you configure an ESXi host, you can back up the host configuration data. Always back up your host configuration after you change the configuration or upgrade the ESXi image.
Important The vicfg-cfgbackup command is available only for ESXi hosts. The command is not available through a vCenter Server system connection. No equivalent ESXCLI command is supported.
Backup Tasks
During a configuration backup, the serial number is backed up with the configuration. The number is restored when you restore the configuration. The number is not preserved when you run the Recovery CD (ESXi Embedded) or perform a repair operation (ESXi Installable).
You can back up and restore configuration information as follows.
1
2
3
When you restore a configuration, you must make sure that all virtual machines on the host are stopped.
Backing Up Configuration Data
You can back up configuration data by running vicfg-cfgbackup with the -s option.
vicfg-cfgbackup <conn_options> -s /tmp/ESXi_181842_backup.txt
For the backup filename, include the number of the build that is running on the host that you are backing up. If you are running vCLI on vMA, the backup file is saved locally on vMA. Backup files can safely be stored locally because virtual appliances are stored in the /vmfs/volumes/<datastore> directory on the host, which is separate from the ESXi image and configuration files.
Restoring Configuration Data
If you have created a backup, you can later restore ESXi configuration data. When you restore configuration data, the number of the build running on the host must be the same as the number of the build that was running when you created the backup file. To override this requirement, include the -f (force) option.
To restore ESXi configuration data
1
2
3
Run vicfg-cfgbackup with the -l flag to load the host configuration from the specified backup file. Specify one of the options listed in Connection Options in place of <conn_options>.
vicfg-cfgbackup <conn_options> -l /tmp/ESXi_181842_backup.tgz
vicfg-cfgbackup <conn_options> -l /tmp/ESXi_181842_backup.tgz -q
To restore the host to factory settings, run vicfg-cfgbackup with the -r option:
vicfg-cfgbackup <conn_options> -r
Using vicfg-cfgbackup from vMA
To back up a host configuration, you can run vicfg-cfgbackup from a vMA instance. The vMA instance can run on the target host (the host that you are backing up or restoring), or on a remote host.
To restore a host configuration, you must run vicfg-cfgbackup from a vMA instance running on a remote host. The host must be in maintenance mode, which means all virtual machines (including vMA) must be suspended on the target host.
For example, a backup operation for two ESXi hosts (host1 and host2) with vMA deployed on both hosts works as follows:
To back up one of the host’s configuration (host1 or host2), run vicfg-cfgbackup from the vMA appliance running on either host1 or host2. Use the --server option to specify the host for which you want backup information. The information is stored on vMA.
To restore the host1 configuration, run vicfg-cfgbackup from the vMA appliance running on host2. Use the --server option to point to host1 to restore the configuration to that host.
To restore the host2 configuration, run vicfg-cfgbackup from the vMA appliance running on host1. Use the --server option to point to host2 to restore the configuration to that host.