Disclaimer: use this script at your own risk 😉
In part 1 you could find a script to upgrade your templates to hardware version 7. In this post you’ll find a script that will upgrade your VM’s to hardware version 7.
Note: This script will upgrade the VMware Tools if necessary and will shutdown the VM!!!!!
The script will perform the following actions:
- Connect to vCenter
- Get all the VM’s in the folder you need to specify
- Create a CSV file with some info about the VM. I will post the content later.
- Update the VMware Tools if necessary (The VM will restart after the installation)
- Shutdown the VM
- Upgrade the vHardware to version 7
- Start the VM
- Create an Excel sheet with an overview of the VM’s and their IP settings
During the process of the script, the VM will be unavailable for 5 minutes or less. So be sure that nobody uses the VM.
The beforeHWchange.csv will look like this:
The script in action:
The last step, the creation of an Excel sheet with an overview of the VM’s. Here you can see if the IP Address is changed or not.
To do list:
- Create a proper VM report function (export to csv) so I can capture multiple network adapters.
- Create a before Excel sheet with a nice overview of the environment.