PowerCLI

 View Only
Expand all | Collapse all

To get the BIOS and Firmware info. from PowerCLI

  • 1.  To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jun 20, 2011 07:07 PM

    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



  • 2.  RE: To get the BIOS and Firmware info. from PowerCLI
    Best Answer

    Posted Jun 20, 2011 07:21 PM

    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 ?



  • 3.  RE: To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jun 20, 2011 07:30 PM

    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...



  • 4.  RE: To get the BIOS and Firmware info. from PowerCLI

    Posted Jun 20, 2011 08:05 PM

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



  • 5.  RE: To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jun 23, 2011 02:19 PM

    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



  • 6.  RE: To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jul 06, 2011 12:12 AM

    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



  • 7.  RE: To get the BIOS and Firmware info. from PowerCLI

    Posted Jul 06, 2011 07:04 AM

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

    Can you perhaps include the script you are using ?



  • 8.  RE: To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jul 06, 2011 12:12 PM

    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
    


  • 9.  RE: To get the BIOS and Firmware info. from PowerCLI

    Posted Jul 06, 2011 12:54 PM

    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.



  • 10.  RE: To get the BIOS and Firmware info. from PowerCLI

    Broadcom Employee
    Posted Jul 06, 2011 01:33 PM

    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.



  • 11.  RE: To get the BIOS and Firmware info. from PowerCLI

    Posted Jul 06, 2011 07:59 AM

    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. :smileyhappy: