Backing up and restoring ESXi using CLI

If your infrastructure is not that big, you can perform individual backups of the ESXi servers using CLI. This might not be a good approach for larger infrastructures, for which you might prefer to automate the whole task.

To perform an individual backup using CLI, perform the following steps:

  1. Connect to the ESXi server using SSH
  2. Run the following command:  vim-cmd hostsvc/firmware/sync_config And vim-cmd hostsvc/firmware/backup_config 
  3. As an output, you will receive a URL, from which you can download the backup file

To restore an individual ESXi server, perform the following steps:

  1. Upload the backup file to the ESXi hypervisor (either using the SCP protocol with WinSCP, for example, or by directly uploading the file to the datastore).
  2. Connect to the ESXi server over SSH.
  3. Enter Maintenance Mode using  vim-cmd hostsvc/maintenance_mode_enter. 
  4. The backup file should be located in the /tmp/ folder. To copy the file to the location, you can use the cp command: cp /vmfs/volumes/datastore1/RESTORE/configBundle-
    esxi-prod-4.learnvmware.local.tgz /tmp/configBundle.tgz
    .   
  5. Restore the configuration usin vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz.   
  6. ESXi will automatically reboot so be prepared for this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.190.144