VMware Cloud Community
edelldieguez
Contributor
Contributor

Help: Upgrade VM hardware to vmx-09 and update VMtools Script

Good mornig Guys,

I will appreciate any help on this, i need to Upgrade virtual hardware and tools in several VMs in 8 clustes, if i do this manually i will take me a too much time to complete and only have one day for this, here is what i need. we reecently upgrade to ESXi 5.1.

Is any way to do this?, we have 8 Clusters in our Datacenter.

What the script does:

1- Script checks all VMs that need virtual hardware and vmware tools upgrade/update in all clusters (Power On VMs Only, we have VMs with the latest hardware and tools running so these are fine).

2- Shutdown only the VMs that need virtual hardware and vmware tools upgrade/update.

3- Take a Snapshot ( No Quiesce Guest Selected or the VM Memory )

4- Upgrade Virtual Hardware and power On VM

5- Update VMware Tools and restart VM

6- Delete ( merges the changes ) the Snapshot in case was successfully.

How the script does it:

Well, i want to do this one Cluster at a time and one Vm at a time if its possible, also i would like the option on the script to write the Cluster name ( we have a test Cluster so i can test it first in that cluster without affect others), or in case i only can do 4 clusters in one day or need to leave out any cluster for some reason:

Cluster_1

1- Shutdown the VM in any order ( wait 180 sec to shutdowm, if fail then Power Off the VM )

2- Create snapshot name "VM_Upgrade"

2- Upgrade virtual hardware ( just if the VM is powered  Off )

3- Turn On VM ( wait 180 sec after Power On the VM )

4- Update VM tools then Restart VM

5- Wait 120 sec and check if hardware and tools are upgraded/updated, if everything is fine:

- Start with another VM

If something fail ( hardware or tools are not upgraded/updated for some reason ), use the Delete Snapshot option in the snapshot manager and go to the previous Good VM state, then delete the faulty snapshot so no changes are merging with the parent.

In this case: send an email to user_1 with the warning that the upgrade or update failled and is deleting the snapshot, after complete this continue with the following VM.

6- After finished Cluster_1 start Cluster_2

7- After all selected clusters are done, generate a report in .csv with the: Cluster name, Vm names, *NEW* Virtual hardware version, *NEW* VM tools Version  and the VMs that had failed.

I'm not sure if this can be done but will be great have something like this.

I did try a LucD script which work nice upgrading the virtual hardware to vmx-9 but i have to do it one by one and only work in power Off VMs.

Thank you guys in advance for your help, for sure this will help many of you that are in the same dilema i am right now and want to use powercli to make our life ease and go home early that weekend Smiley Wink

Ed.

0 Kudos
1 Reply
CRad14
Hot Shot
Hot Shot

Although it is possible. I think the easiest and quickest solution though would be to use Update Manager, it inherently will take snapshots before updating. and stage/remediate both VMware tools and VMware Hardware.

I feel like in my head the way I would set it up would be to use update manager to update/upgrade everything. Then after I would use powercli, to report on the version of VMware Tools/Hardware, and use that report to send the email you describe.

The other thing to note, is that VMTools are updated Before hardware updates.

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos