Using PowerCLI to find ESX/ESXi BIOS Versions

A few weeks ago I updated the BIOS on several Dell R810 servers running ESXi 4.1U1. After applying the update I disabled the C-States and C1E settings as described here: http://enterpriseadmins.org/blog/virtualization/vmware-esxi-psod-on-dell-server/. Once I had all my updates completed, I wanted to validate that each host was reporting the latest BIOS version. A quick search of the PowerCLI forums turned up this article where @LucD had already provided the required code http://communities.vmware.com/message/1785476

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

I ran into problems where only 3 of 16 hosts reported any BIOS Version. A little more searching, and I found some code that looks like someone else had encountered the same issue: http://www.sandfordit.com/vwiki/index.php?title=VI_Toolkit_(PowerShell). In the referenced WIKI article, the author checked the Hardware.BiosInfo, and if it wasn’t available they parsed Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo. This second method worked on all 16 of 16 hosts I was interested in (sample code below):

$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

This code block is on the road map for a future release of vCheck. I’m actually planning to only show clusters that contain hosts with different BIOS versions; if the cluster is good there shouldn’t be a reason to report on the issue.

2 comments

  1. […] While it is possible to query the BIOS version remotely via PowerCLI and it’s even displayed in the vSphere Client GUI under Processor Information, I haven’t […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.