virtualdive
VMware Employee
VMware Employee

To get the BIOS and Firmware info. from PowerCLI

Jump to solution

Hi All,

Can anyone please share a PowerCLI script to get the below information on all the hosts in vCenter?

1. BIOS Version

2. BIOS Date

3. Firmware Version

4. Firmware Date

I have this but it only shows for one server and only BIOS details. I want for all the hosts in the vCenter.

$VMHost = Get-VMHost 'Server01' | Get-View
$VMHost.Hardware.BiosInfo

Thank you

Nick

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

To run this for multiple ESX(i) servers you can do

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},   
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

Note that the presence of these values depends on the HW you are using.

There are several HW types from different vendors that do not populate these values correctly.

Not sure what you mean with the firmware properties.

Are these displayed in the vSphere Client ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
10 Replies
LucD
Leadership
Leadership

To run this for multiple ESX(i) servers you can do

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},   
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

Note that the presence of these values depends on the HW you are using.

There are several HW types from different vendors that do not populate these values correctly.

Not sure what you mean with the firmware properties.

Are these displayed in the vSphere Client ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
virtualdive
VMware Employee
VMware Employee

Bam! Cheers Luc........I recieved your Book Automating vSphere Administration yesterday. That is awsome piece of work, really helpful and recommended to all who wants to get started or play with PowerCLI.

Nick...

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
0 Kudos
LucD
Leadership
Leadership

Thanks Nic, I hope you will find many useful ideas in the book.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
virtualdive
VMware Employee
VMware Employee

Hey Luc,

Just a quick one, the script you sent ran successfully on the HP Blades but this isn't working on the Dell PowerEdge 900 servers. Am I missing something?

thanks

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
0 Kudos
brwuchner
VMware Employee
VMware Employee

Luc,

I'm a big fan of your work.  I had an idea on using this code to verify that all hosts in a cluster had the same BIOS version.  I'm running into a slight problem though, and wanted to see if you could help.  I have two 8 node clusters made up of identical hardware.  When running this code against those 16 boxes in vCenter, only 3 of them return Bios Version info.  However, if I connect to each host directly the Bios Version is available.  Also, when looking at the 'Hardware Status' tab all hosts are reporting the same version.  Any ideas on how I could troubleshoot this?

Thanks,

Brian

0 Kudos
LucD
Leadership
Leadership

Strange, I have no immediate explanation for the behaviour you are seeing.

Can you perhaps include the script you are using ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AureusStone
Expert
Expert

I have seen this bug before, but I am not aware of any resolution.  I think it is probably a vSphere bug and not the hardware vendors fault.

Just using the HostSystem object from the api has the same issue.  The host is reporting all of the information correctly via IPMI.

Not really helpful, but I would like to know the reason also. Smiley Happy

0 Kudos
brwuchner
VMware Employee
VMware Employee

I was using the code provided above:

Get-View -ViewType HostSystem | Select Name,@{N="BIOS version";E={$_.Hardware.BiosInfo.BiosVersion}},    
   @{N="BIOS date";E={$_.Hardware.BiosInfo.releaseDate}}

It worked fine if I would connect-viserver to the individual ESXi hosts, but when pointing at vCenter it only worked for 3 of 16 hosts.  After a little bit of Googling, I think I found someone else who has encountered this problem -- http://www.sandfordit.com/vwiki/index.php?title=VI_Toolkit_(PowerShell)

That page has a "ESX Inventory Getter" script that checks for the Hardware.BiosInfo value and uses it if available.  However, it will fail to a section that parses the Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo information if needed. I switched to just the Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo section and can now get the BIOS values for all 16 hosts.  The code isn't as clean as what you provided, but appears to work on all my hosts:

$report = @()
Get-View -ViewType HostSystem | %{ 
     $row = "" |Select Name, "BIOS Version", "BIOS Date"
     $row.name = $_.name
     $biosTemp = ((($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo | Where {$_.Name -like "*BIOS*"}).Name -split "BIOS ")[1] -split " ")
     $row."BIOS Version" = $biosTemp[0]
     $row."BIOS Date" = $biosTemp[1]
     $report += $row
}
$report
0 Kudos
LucD
Leadership
Leadership

Like it is also mentioned in that Wiki, this depends on the CIM provider from the HW vendor.

While it will work on HP HW, this will probably not work on other vendor's HW.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
brwuchner
VMware Employee
VMware Employee

Yeah, I'm not a big fan of anything that requires splitting on text and assuming that the order will be consistent.  I have tested the code on 2 HP servers, ~40 Dell servers and 2 nested ESXi VMs and appear to be getting expected results cross vendor - at least for now.

0 Kudos