Hello,
2 questions when using the VMWare SDK for VI3 (how) is it possible to do the following
1. Detect that the Host you are connecting to is part of a Virtual Center (the way the VI Client does when it warns you that a server is being managed by Virtual Center)
2. I can't find anything in the API that will give me the ESX host's Serial Number
Thanks,
Dave
Dave,
The first question is easy if you're running ESX 3.5 or ESXi. Just get the HostListSummary object and pull out the managementServerIp field... (http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.host.Summary.html). You can see if using the MOB.
The second question is more difficult because I'm not sure what you want... the Host's UUID? The mother-board ID? VMware Software Serial #?
Tom
Hello - thanks for the reply.
My software automatically documents VMWare ESX Hosts including 3, 3.5 and 3i so I need a property that is available to all of them, is there another field that is available to the Version 3 of ESX?
I want the hosts physical serial number i.e. if this is a HP Proliant DL380 I can get the make and manufacturer but not its serial number. This is because my software is also used for managing hardware inventory.
Thanks,
Dave
Hi!
Possibly this can help you: http://communities.vmware.com/message/866538
Dunno where to find the serial...
Tos2k
#2: dmidecode | grep Serial
Read the contents w/o grep and you'll likely see a section starting with Base Board which is the one you want.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Hal,
I tried this and it does work for the 3.5 systems, unfortunately, its not a solution for the ESXi systems (no console O/S). I suspect the only solution there would be via CIM. I see in the CIM_SDK that there is a serial number in the CIM_BIOSElement object but I'm not sure if that would be the same as the base board's serial number, and I'm not familiar enough with CIM to test it out.
Perhaps someone who knows CIM can post some sample code that would work on both ESX 3.5 and ESXi systems?
Tom
Good luck with that. I believe you are on the right track, but I'm not so good with CIM yet myself.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Dave (or anyone else),
Has anyone figured out how to get the serial number from ESXi hosts? I can see the serial number in my vSphere client "Hardware Status" tab as part of the system summary, but I haven't found any way to get that through the web API yet. Just wondering if anyone has another (automated) method.
Thanks,
Maarten
You can get it from the CIM provider using the vSphere CLI. I have modified one of the provided wsman scripts that come with the vSphere CLI to query the CIM for serial info.
Syntax is
perl get-hw-serial.pl --server <server> --username <username> --password <password>
See attached for source code.
You can access by (vb.net) :
Dim host As HostSystem = ...
host.Hardware.SystemInfo.OtherIdentifyingInfo() is an array of info. Inside we can find .label = SERVICETAG and .value = hardware s/n ????.
The big problem is that OtherIdentifyingInfo() contains this information rarely (i have 2 of 29 host) and don't know why... Very embarrassing. Where is vsphere always get this information in the tab "Hardware status" ?
Has anyone managed to get this working - I also get the Access denied - ecven after using alternate credentials as suggested.
I would dearly like to run this script to get the serials of all the hosts - they are all HP servers
Thanks
In ESXi 5, I do this :
Or is this serial you want is something else???
I think the goal of the thread is to get the serial using either vCLI or PowerCLI.
To retireve the serial, you can use ESXCLI which is part of the vCLI install:
~ # esxcli hardware platform get
Platform Information
UUID: 0x42 0x2e 0x6d 0x4c 0x8e 0xd5 0x53 0x7e 0x48 0xa3 0x4a 0x6f 0x53 0x27 0x65 0x62
Product Name: VMware Virtual Platform
Vendor Name: VMware, Inc.
Serial Number: VMware-42 2e 6d 4c 8e d5 53 7e-48 a3 4a 6f 53 27 65 62
IPMI Supported: false