VMWare Tools Upgrade Based on ESXi Version

(imported topic written by FITZPAW91)

I have figured out how to update my VMWare Tools based on which version of ESXi that I am running. But I can’t write a relevance for it. Any help would be appreciated.

We have ESXi 4.0 and ESXi 4.1 in our environment, and I want to write the correct tools to the correct client.

Here is what I have so far.

To find out which version of ESXi host the VM is running on, I check

values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”)

If it returns a number starting with 4.0.0, then I know it is a ESXi 4.0, if it returns a number starting with 8 then I know it is a ESXi 4.1

Then I can find out if the tools are up to date by running these 2 analysis, on ESXi 4.0

(first 5 of it = “4.0.0” and following text of first “build-” of it as integer >= 398348) of (values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”))

On ESXi 4.1

(first 10 of it = “8.3.7.4937”) of (values “FileVersion” of version blocks of file (“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”))

I want to combine all these into one relevance, that will tell me if my VM is on a ESXi 4.0 or ESXi 4.1 host, and whether the tools are up to date.

This is going to be used in an Analysis, then once I have it up and running, I will integrate it into a Fixlet Relevance that will update the VMWare Tools based on the information provided.

Thanks

William

(imported comment written by FITZPAW91)

I am glad that I submitted to the forum, as it seems that other people are having problems with this as well as I am. Any help please.

William

(imported comment written by SystemAdmin)

This will only check for 4 or 8,

it says if it = 4 then check the version for 4 else check the version for 8

if (first 1 of it of values 
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe")) = 
"4" then ((first 1 of it = 
"4" and following text of first 
"build-" of it as integer >= 398348) of (values 
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe"))) 

else ((first 10 of it = 
"8.3.7.4937") of (values 
"FileVersion" of version blocks of file (
"C:\Program Files\VMware\VMware Tools\VMwareTray.exe")))

if

(

first 1 of it of values “FileVersion” of version blocks of file

(

“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”

)

)

= “4”

then

(

(

first 1 of it = “4”

and

following text of first “build-” of it as integer >= 398348

)

of

(

values “FileVersion” of version blocks of file

(

“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”

)

)

)

else

(

(

first 10 of it = “8.3.7.4937”

)

of

(

values “FileVersion” of version blocks of file

(

“C:\Program Files\VMware\VMware Tools\VMwareTray.exe”

)

)

)

(imported comment written by SystemAdmin)

Now here’s something to think about… we have thousands of VM Guests on many many VC’s around the world…

what we do here is every 24 hours we run a PS script to gather all of the Guest info from every VC and save it to a single CSV file locally on the BES server.

Then every day the client grabs that file through a POLICY action and then returns data to the console for its self.

We have an analysis then that picks all of that data out of the CSV file for the line that equals the host name of the guest

the problem is if the Guest name does not match the host name…but you can see what guests dont have any data and fix the guest name in the VC

The data i’m currently gathering for each VM Guest is

“Name”,“PowerState”,“Version”,“NumCpu”,“MemoryMB”,“VMHost”,“Uid”,“Cluster”,“Datastore”,“Datastore Capacity”,“Datastore Free”

and there’s tons more information on the VC’s about the guests.

The issue that you have is tying the Guest to the Host its on, with the above Tasks and Analysis’s each guest knows all about the host its on

(imported comment written by FITZPAW91)

That sounds amazing Mark, are you willing to share a copy of that PS script, I would love to use it.

William