Backup and Restore VM Host

  1. To back up ESXi configuration:
    1. Run the following command to sync the configuration: vim-cmd hostsvc/firmware/sync_config
    2. Run the following command to generate a backup file: vim-cmd hostsvc/firmware/backup_config
    3. Download the configuration file by going to the URL in the output. (Replace * in the URL with the IP address.)
      Putty
    4. If unable to download the config file through the browser, it can be found in /scratch/downloads/<<GUID from output in step b>>/configBundle-hostname.local.tgz. Use WinSCP to transfer the file from ESXi to the local machine or copy it to a datastore
  2. Restore configuration back to ESXi host:
    1. Make sure the same ESXi build from which the backup was taken is installed back onto the host.
    2. Copy the backup file back to the ESXi host. Use WinSCP to copy the config file back to the host /tmp directory.
    3. Rename the file from configBundle-<host name>.tgz to configBundle.tgz.
      Example:
      cp configBundle-esxi7001.vmlab.local.tgz configBundle.tgz
    4. Run this command to put the host into maintenance mode:
      esxicli system maintenanceMode set --enable yes
    5. Restore backup. Run command: Recommand modifying the UUID on the backup set before restore. Please skip to step g.
      vim-cmd hostsvc/firmware/restore_config /backup_location/configBundle.tgz
    6. If there is an error stating UUID mismatch, then add a 1 to force the override of the Universal Unique Identifier (UUID). 
      vim-cmd hostsvc/firmware/restore_config 1 /tmp/configBundle.tgz
    7. You can find the UUID by running the command and copying the ID for the next step
      vsxcfg-info -u
    8. Unpack the backup ser set, go to the tmp directory, and run the command:
      vtar zxvf configBudle.tgz
    9. Modify the UUID in the Manifest.txt, run the vi command:
      vi Manifest.txt
    10. Save the Manifest.txt file, run the vi command:
      :WQ
    11. After saving the change, run the command:
      tar zcvf configBudle.tgz
    12. Restore the config file by running this command, and the host will reboot you can access the host with the original IP.
      vim-cmd hostsvc/firmware/restore_config /backup_location/configBundle.tgz

Comments

Popular posts from this blog

Extracting and using a modified VMWare Player BIOS or UEFI firmware

OpenVBX v1.2.21 r79 - Twilio JS Version 1.5.2

SonicWall firmware Sonic OS 5.9.1.13