How to reliably determine the hardware version of a VMWare Guest from inside the guest

vmware-esxi

I am attempting to determine the "hardware" version of numerous VMWare VMs. I don't have access to the vSphere console.

The VMWare Tools Service is installed, and C:\Program Files\VMWare\VMWare Tools\vmtoolsd.exe --cmd "info-get" looks promising, however I cannot find any details about what key name to specify.

Is there some other method such as looking at VMWare device driver versions or perhaps a wmic query?

Best Answer

In theory what you are asking should be possible.

however it appears it isn't particularly well implemented by VMWare.

The extended options should be query-able from the guest with VMToolsd.exe available, as you correctly say. However it doesn't seem to work.

vmtoolsd.exe --cmd "info-get virtualHW.version"

Should return the hardware version contained in the vmx file, however it doesn't.

a post in this thread by simonbaev seems to highlight a problem, requiring hypervisor level changes to allow this information to be queried from the guest : https://communities.vmware.com/message/2184934

$ vmware-cmd --config esxi-24 "[DS_104.24_150] LTSP2/LTSP2.vmx" setguestinfo myTest "hello world"  
setguestinfo(myTest hello world) = 1  
$ vmware-cmd --config esxi-24 "[DS_104.24_150] LTSP2/LTSP2.vmx" getguestinfo myTest  
getguestinfo(myTest) = hello world  
$ vmtoolsd --cmd "info-get guestinfo.myTest"  
No value found  
$ vmtoolsd --cmd "info-get myTest"  
Invalid key name supplied  
$ vmware-cmd --config esxi-24 "[DS_104.24_150] LTSP2/LTSP2.vmx" setguestinfo guestinfo.myTest "bla-bla-bla"  
setguestinfo(guestinfo.myTest bla-bla-bla) = 1  
$ vmware-cmd --config esxi-24 "[DS_104.24_150] LTSP2/LTSP2.vmx" getguestinfo guestinfo.myTest  
getguestinfo(guestinfo.myTest) = bla-bla-bla  
$ vmtoolsd --cmd "info-get guestinfo.myTest"  
bla-bla-bla  

Meaning you'd need assistance from your virtualisation team to get that information displayed as you need it.

However at that point you may as well just get them to run a script to extract that information in a way that doesn't require them to hack about with configuration files of all their production servers (and probably have to reboot everything too).

eg in PowerCLI

Get-VM | Get-VMAdvancedConfiguration -key virtualHW.version