Hi All,
Can we pull the ESXi Build version, Host firmware, HBA driver version, HBA firmware version and Host NIC version from power cli at the cluster level?
Thanks
vmk
That could indicate an issue with your DNS setup.
You can try with the IP address instead of the FQDN
$cmdSub = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a'
$cred = Get-Credential -Message "Credentials for all ESXi node in cluster $($clusterName)"
Get-Cluster -Name $clusterName | Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
$esxNet = Get-VMHostNetwork -VMHost $_
$fqdn = "$($esxNet.HostName).$($esxNet.DomainName)"
$ip = (Get-VMHostNetworkAdapter -VMHost $esx -VMKernel | select -First 1).IP
$session = New-SSHSession -ComputerName $ip -Credential $cred –AcceptKey
$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub
Remove-SSHSession -SSHSession $session | Out-Null
$result.Output | Out-File -FilePath ".\report-$($fqdn).txt"
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It depends, not all HW vendors and not all models provide that info in a way that ESXi can pick it up.
There are several examples in this community:
Re: Looking for a PowerCLI script to get the ESXi hosts all the NIC driver and firmware version
Host Hardware info with HBA and nic driver information
and many more if you do a search.
Btw, you asked a similar question (How to get HP Blade server for Gen8, Gen9 & Gen10 firmware version & ILO firmware version fr... ) where you didn't bother to reply.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Sorry, i didn't reply your earlier email thread. Sorry about that. Earlier the requirement was a different i.e. firmware upgrade for all Host but recently we had an issue where VM's getting corrupted and VMware asked to upgrade HBA firmware for HP G10, hence want to pull the report for all the host having HP G10 Blade server.
However, link shared by you, I'll go through it and will get back.
thanks
vmk
LucD,
I tried executing the first script but it throws an error
Powercli Script to get FW and driver version details for both HBA and NICs
The line
should be
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you are after the HBA firmware on HP HW you might want to have a look at Re: PowerCLI Script to get ESXi Network/Storage Firmware and Driver Version
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried the script and below output is generated
Host column- i have excluded itin screenshot. 2 column is m issing here i.e. HBA-Module & HBA-version.
is it possible to get below information
Host Name | Type | ESXi Build | Cluster Name | FW System Rom | FW iLO5 | FW Power Management Controller | HBA Type | HBA driver ver. | HBA FW ver. |
Host1 | Gen 10 | 8294253 | Cluster1 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | 1.0.45.3 | 7.13.109.0 BC: 7.15.24 |
Host2 | Gen 10 | 8294253 | Cluster1 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | 1.0.45.3 | 7.13.109.0 BC: 7.15.24 |
Host3 | Gen 10 | 10390116 | Cluster3 | I41 08/08/2018 | 1.35 Aug 14 2018 | 1.04 | Emulex | 12.0.1115.0 | 12.0.1110.11 |
Host4 | Gen 10 | 10884925 | Cluster3 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | 1.0.63.0 | 7.13.109.0 BC: 7.15.24 |
Host5 | Gen 10 | 10884925 | Cluster4 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | Emulex | 12.0.1115.0 | 12.0.1110.11 |
Host6 | Gen 10 | 10884925 | Cluster1 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | 1.0.45.3 | 7.13.109.0 BC: 7.15.24 |
Host7 | Gen 10 | 10884925 | Cluster5 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | Emulex | unable to log in | |
Host8 | Gen 10 | 8294253 | Cluster6 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | no HBA values registered | |
Host9 | Gen 10 | 8294253 | Cluster1 | I41 10/02/2018 | 1.37 Oct 25 2018 | 1.04 | QLogic | 1.0.45.3 | 7.13.109.0 BC: 7.15.24 |
Host10 | Gen 10 | 10390116 | Cluster1 | I41 08/08/2018 | 1.35 Aug 14 2018 | 1.04 | Emulex | 12.0.1115.0 | 12.0.1110.11 |
The script filters on Emulex cards (the lpfc vib test).
Do you have those HBAs or did you leave that test out?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Above report, in earlier reply chain, I got it from a different team, but not sure how they were able to pull all this information. is it possible through script?
thanks
vmk
Which script are you referring to?
Do you have a link?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry, LucD, these output provided by vulnerability team and I don't the script.
It could be that they are using OneView.
See also Re: How to get HP Blade server for Gen8, Gen9 & Gen10 firmware version & ILO firmware versio...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok LucD,
I got the clue- Below CLI used on each ESXi host
/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a
performed a detailed dump
You can run this through a SSH connection.
When you have the Posh-SSH module you could do something like
$cmdSub = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a'
$cred = Get-Credential -Message "Credentials for ESXi node $($esxName)"
$esx = Get-VMHost -Name $esxName
$session = New-SSHSession -ComputerName $esx.Name -Credential $cred –AcceptKey
$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub
Remove-SSHSession -SSHSession $session | Out-Null
$result.Output
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
It works. Can we extract this into notepad or csv because of the output on the screen difficult to read or either need to scroll pagewise? I will prefer in csv or notepad atleast.
I guess since the output is large enough to capture and it will be better to redirect the output to notepad. Also, can we pull for all host in a cluster e.g. C:\temp\host.txt
thanks
vmk
Try like this.
It assumes that the credentials you give are valid for each ESXi node.
$cmdSub = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a'
$cred = Get-Credential -Message "Credentials for all ESXi node in cluster $($clusterName)"
Get-Cluster -Name $clusterName | Get-VMHost |
ForEach-Object -Process {
$session = New-SSHSession -ComputerName $_.Name -Credential $cred –AcceptKey
$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub
Remove-SSHSession -SSHSession $session | Out-Null
$result.Output | Out-File -FilePath .\report.txt -Append
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
It throws an error. Also, in an earlier script, I need to give FQDN for each host to generate the output.
Also, it's strange despite getting an error, i can see the output report.
LucD, in the report, I don't see the host name so how I'll correlate the output with the host name. It only shows WWPN.
You might not have the permission to connect via SSH to one or more of the ESXi nodes.
We can use the FQDN of the ESXi nodes.
If we store the results in separate file, we can place the ESXi name in the filename.
Try like this
$cmdSub = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -a'
$cred = Get-Credential -Message "Credentials for all ESXi node in cluster $($clusterName)"
Get-Cluster -Name $clusterName | Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
$esxNet = Get-VMHostNetwork -VMHost $_
$fqdn = "$($esxNet.HostName).$($esxNet.DomainName)"
$session = New-SSHSession -ComputerName $fqdn -Credential $cred –AcceptKey
$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub
Remove-SSHSession -SSHSession $session | Out-Null
$result.Output | Out-File -FilePath ".\report-$($fqdn).txt"
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Do you mean to say enable SSH and ESXi shell ? Also, to get output Hostname should be FQDN