Backing Up and Restoring VMware ESXi Configuration Settings

Prerequisites:

  • SSH access enabled on the VMware ESXi host.

  • Administrative credentials for the ESXi host.

  • A secure location to store the backup file.

Backing Up ESXi Configuration

Steps:

  1. Enable SSH Access:

    • Ensure SSH access is enabled on your ESXi host. Refer to the guide on "Enabling SSH Access on VMware ESXi" if needed.

  2. SSH into the ESXi Host:

    • Use an SSH client to connect to the ESXi host. Login with your administrator credentials.

  3. Run the Backup Command:

    • Execute the following command to back up the ESXi configuration:

      vim-cmd hostsvc/firmware/backup_config
    • This command outputs a URL containing the backup file location, typically in the format of /scratch/downloads/[date]-[time].tgz. Note this URL, as you will need it to download the backup file.

  4. Download the Backup File:

    • Access the ESXi host using a web browser or an SCP client. Navigate to the provided URL or directory, and download the .tgz backup file to a secure location.

Restoring ESXi Configuration

Prerequisites:

  • The ESXi host must be in maintenance mode before restoring the configuration.

  • The backup .tgz file you previously saved.

Steps:

  1. Enter Maintenance Mode:

    • Connect to the ESXi host via SSH.

    • Execute the following command to put the host into maintenance mode:

      esxcli system maintenanceMode set --enable true
  2. Restore the Configuration:

    • Ensure the backup file is accessible from your local machine or a location that the ESXi host can access.

    • Use the following command to restore the configuration from the backup file:

      vim-cmd hostsvc/firmware/restore_config /path/to/backup_file.tgz
    • Replace /path/to/backup_file.tgz with the actual path to your backup file.

  3. Reboot the Host:

    • After successfully restoring the configuration, reboot the host for the changes to take effect:

      reboot
  4. Exit Maintenance Mode:

    • Once the host has rebooted, exit maintenance mode by connecting via SSH and running:

      esxcli system maintenanceMode set --enable false

Last updated