pyvmomi-community-samples
pyvmomi-community-samples copied to clipboard
How to get the ESXi host serial number
Hello team,
I have been using vim.host.SystemIdentificationInfo to get the ESXi host serial number (physical host serial number, in my case it is Cisco UCS Blade). Sometimes it is successful but most of the times I'm not getting the serial number. What is the right method to get the ESXi host serial number. Any help?
Note: I'm connecting to vCenter, getting all the ESXi host in the cluster and for each ESXi host I'm getting enic driver, fnic driver and host serial numbers.
Hello team,
Any help or comments?
si = SmartConnect()
containerHost = si.content.viewManager.CreateContainerView(si.content.rootFolder, [vim.HostSystem], True)
for host in containerHost.view:
device = {}
device["sn"] = 'NA'
sn = 'NA'
for info in host.hardware.systemInfo.otherIdentifyingInfo:
if info.identifierType.key == 'ServiceTag':
device["sn"] = info.identifierValue