I am trying to find the information which is displayed in the Hardware Status tab. Mainly the summary at the top. I can locate most of the information walking through the managed object browser but what I need are the serial numbers and asset tags that are listed. I need to update a machine database with this information. Attached is a screen shot.
This can simply be done using the CIM API:
From a remote CIM Client issue the following. I use wbemcli (apt-get install wbemcli on Ubuntu)
All this information is avaiable as part of the HostSystemHealthStatusSystem - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.host.Healt...
So when I use the managed object browser I am have no problems locating all of the sensor information etc which is what is listed below the summary... it is just the couple of items located up at the top in the summary I mentioned. I see the bios version info under HostHardwareInfo.biosInfo and I find the manufacturer and model in the HostSystemInfo data object. What I can't locate are the "Serial", "Tag", and "Asset Tag" values. After doing some more digging it looks like the information I need is located here: http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.host.Syste... . When I navigate to this via the MOB though the values are listed as "unset"
For the system summary info, it's actually located here - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.host.Hardw...
This can simply be done using the CIM API:
From a remote CIM Client issue the following. I use wbemcli (apt-get install wbemcli on Ubuntu)
This works for me and I also seemed to be able to get it working with pywbem. I did run into one issue since the host I was testing against had an '@' in the password. Do you know if it is possible to still use the command line against systems which have an '@' in the password? I tried using an escape in front of the @ sign but that did not seem to do the trick.
I figured I would follow up with a little more detail of how I got this working with pywbem:
1. install python and pywbem on a scripting host.
2. Create a workflow or action that uses the ssh plugin.
3. Create a script similar to this on your scripting host:
4. This will actaully only return values for 'OtherIdentifyingInfo' I was using the same script to test against other instance types and spit out any values for Tag and Serial Number as well. I found with some of our older blade systems that the tagging was not consistent. It seems like in newer systems there are always Tags 23 and 23.1 (Host and Chassis) . VMware will display both of these if they are found but in some of the older HP blades there was only tags for the chassis and not the Host. In OtherIdentyingInfo is where they would put the hosts serial which is what we needed. This value seems consistent for the newer blades as well so that is the field we are extracting. Hope this ends up helping some folk in the future.