vCenter ESXi Config Backup Script
When using VMware vCenter, you may only occasionally need a configuration backup of each VMware ESXi host. However, there are some situations where having a config backup of each ESXi host is nice to have.
I didn’t want to back up each ESXi host manually, as it doesn’t scale well. Instead, I created a PowerShell script called vCenter ESXi Config Backup to do everything for me.
You can find the script on my GitHub. https://github.com/thedxt/VMware#vcenter-esxi-config-backup
Prerequisites
- VMware PowerCLI installed (here’s the Broadcom documentation on how to do that)
- VMware vCenter certificate installed. My blog post, Install VMware vCenter Certificate in Windows, covers how to do this.
How It Works
The vCenter ESXi config backup script connects to VMware vCenter, uses vCenter to connect to each ESXi host, and takes a configuration backup for each host. Because the script uses vCenter, you don’t need to enable SSH on any of the ESXi hosts for the backup to work.
By default, the vCenter ESXi config backup script assumes you are not connected to vCenter and will prompt you to connect to vCenter. You can suppress this behavior if you are already connected to vCenter by setting the optional parameter named connected to the value of Yes.
The script checks to see if the backup folder you defined exists. If the folder does not exist, the script will create it.
Next, the vCenter ESXi config backup script enumerates all of the ESXi hosts in vCenter, it connects to each one and takes a configuration backup. The script outputs the backup into the folder you defined.
…


