How to know ESXi servers BIOS/Firmware version w/PowerCLi

Cover

 

Please meet the Get-VMHostFirmwareVersion function from my PowerCLi Vi-Module module. The function will help you get a Firmware version and release date of your ESXi hosts.

For greater flexibility and convenience, the function is written as a PowerShell filter. A filter is a type of function that runs on each object in the pipeline (Objects[] | Filter).

The Get-VMHostFirmwareVersion can get any number of ESXi hosts. They can be a just hostnames or their objects, returned by the Get-VMHost or Get-View cmdlets (it is about the flexibility).

For example, for a single ESXi host, it may look like this:

'esxprd1.domain.com', 'esxdev2.*' | Get-VMHostFirmwareVersion
Get-VMHost 'esxprd1.*' | Get-VMHostFirmwareVersion

 

If your host, say IBM/Lenovo, you can get something like that:

G0E183BUS-1.83 [12/30/2015]

This is a normal String (character set), consisting of the BIOS version and release date, enclosed in square brackets.

About a convenience. Real advantage of the filters vs functions the fact that with their help is very convenient to add new properties to existing objects. In the PowerShell, this technique is called «calculated properties».

For example, you can take a bulk of ESXi hosts (Get-VMHost/Get-Cluster PROD | Get-VMHost), choose only the properties you are interested in (select Name, Version, Manufacturer, Model) and add a new one and call it BIOS or Firmware (@{N='BIOS'; E={$_ | Get-VMHostFirmwareVersion}}).

Get-VMHost | select Name, Version, Manufacturer, Model, @{N='BIOS'; E={$_ | Get-VMHostFirmwareVersion}} | Format-Table –AutoSize
Get-View -ViewType HostSystem | select Name, @{N='BIOS';E={$_ | Get-VMHostFirmwareVersion}}

 

01.Get-VMHostFirmwareVersion

 

The convenience and flexibility we talked, it remains to discuss performance.

The following comparison shows us that, as in most cases, Get-View cmdlet is more efficient than Get-VMHost.

 

02.Get-VMHostFirmwareVersion

On 55 hosts, the difference was 13 seconds, which is more than 20%! Get-VMHost, of course, more familiar and convenient, but if speed is important, your choice is Get-View.

Get-Help Get-View -Online

Do not forget to take a look at the examples that are provided with the function:

Get-Help Get-VMHostFirmwareVersion –Examples
Get-Help Get-VMHostFirmwareVersion –Full

 

5 thoughts on “How to know ESXi servers BIOS/Firmware version w/PowerCLi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s