Knowledgebase
emscom > emscom Help Desk > Knowledgebase

Search help:


ESXi 6 Restore configuration across hosts

Solution

 

The following commands are run from the host ESXi server(s) over ssh

ESXi Configuration Backup

To backup the host configuration

vim-cmd /hostsvc/firmware/sync_config

vim-cmd /hostsvc/backup_config

The configuration bundle is written to a gzipped tarball

/scratch/downloads/configBundle-[hostname].tgz

The configuration file can be downloaded using a web browser or copied to a remote system using scp

scp configBundle-[hostname].tgz user@address:/tmp/


Restore configuration

To restore the configuration file on the host it was created the configBundle should be located in the /tmp directory.

mv /tmp/configBundle-[hostname].tgz /tmp/configBungdle.tgz

vim-cmd /hostsvc/maintenance_mode_enter

vim-cmd /hostsvc/firmware/restore_config /tmp/configBundle.tgz force

If successful, the host will reboot automatically.  If unsuccessful,  more information can be elicited using

vim-cmd -d info /hostsvc/firmware/restore_config /tmp/configBundle.tgz force

WARNING: The command interpreter is poorly written and failed to recognise the debug level but defaults to info when the -d flag is given any parameter value.


Restore configuration to Alternate Host

WARNING: Using vim-cmd to restore a configBundle to a host other than the source is not supported.

CAUTION: Only configBundles from hosts with the same ESXi build number may be restored.

Attempting to restore a configBundle to a foreign system using vim-cmd will fail with a mismatched UUID error.  To work around the issue, the Manifest.txt file within the configBundle must be edited to match the target host.  The easiest way to find the target hosts UUID is to create a configBundle on the target host.

To find the target host UUID

cd /tmp

vim-cmd /hostsvc/firmware/backup_config

mv /scratch/download/configBundle-[hostname].tgz .

tar -zxf configBundle-[hostname].tgz

cd configBundle-[hostname].tgz

cat Manifest.txt

Note the UUID.

Edit the configBundle UUID

The configBundle from the source ESXi sever is extracted from the tadball as follows

tar -zxf configBundle-[hostname].tgz

cd confiigBundle-[hostname]

The Manifest.txt file contains the UUID and may be edited on the server with vi, or remotely using an sftp aware text editor

Delete the source UUID and insert the target UUID, before saving the file.

To create a  new configBundle

tar -zcvf Mainfest.txt state.tgz configBundle.tgz

Restore the configBundle

The new configBundle should be moved to /tmp folder.

mv configBundle.tgz /tmp/.

cd /tmp

The configBundle is restored as follows

vim-cmd /hostsvc/enter_maintenance_mode

vim-cmd /hostsvc/restore_config /tmp/configBundle.tgz force

If successful, the host will shutdown and reboot automatically.

 

 
Was this article helpful? yes / no
Related articles ESXi OVF Tool
Article details
Article ID: 88
Category: Virtualisation
Date added: 28-10-2016 10:10:26
Views: 4134
Rating (Votes): Article rated 3.5/5.0 (8)

 
« Go back

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies