Is there an ESXcli command to get all of the WWNs on all the HBAs currently installed on an ESXi host and output it to the screen?
Thanks
Here you go,
~ # esxcli storage core adapter list | grep -i fc | awk '{print $4}'
fc.200018a99b4cXXXX:200118a99b4cXXXX
fc.200018a99b4cXXXX:200218a99b4cXXXX
Thanks and Regards,
Shrikant Gavahne
Please take a look at HOW TO: Find HBA WWN number on VMware vSphere ESX server to see whether this is what you are looking for.
André
esxcli storage core adapter list?
Here is a PowerShell alternative that you can use to collect this information remotely (for multiple hosts), without having to be logged onto the individual host;
## START
Clear-Host
Connect-VIServer -Server vcenter.mydomain.com
Write-host ""
$scope = Get-Datacenter 'MyDatacenter' | Get-VMHost * | Sort-Object Name # All hosts connected in vCenter
#$scope = Get-Cluster -Name 'MyCluster' | Get-VMHost * # All hosts in a specific cluster
foreach ($esx in $scope){
Write-Host "Host:", $esx -ForegroundColor Yellow
$hbas = Get-VMHostHba -VMHost $esx -Type FibreChannel
foreach ($hba in $hbas){
$wwpn = "{0:x}" -f $hba.PortWorldWideName
Write-Host `t $hba.Device, "|", $hba.Status, "|", $hba.model, "|", "WWPN:" $wwpn
}
}
Disconnect-VIServer -Server * -Force -Confirm:$false
## END
Cheers,
Jon
Hi TheVMinator,
You can run below commnad to check all the HBA's present in the ESXi.
~ # esxcli storage core adapter list
HBA Name Driver Link State UID Description
-------- ------------ ---------- ------------------------------------ -------------------------------------------------------------------------
vmhba0 ahci link-n/a sata.vmhba0 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba1 megaraid_sas link-n/a unknown.vmhba1 (0:3:0.0) LSI / Symbios Logic Dell PERC H710 Adapter
vmhba2 qla2xxx link-up fc.20000024ff4bXXXX:21000024ff4bXXXX (0:5:0.0) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba3 qla2xxx link-n/a fc.20000024ff4bXXXX:21000024ff4bXXXX (0:5:0.1) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba4 qla2xxx link-up fc.20000024ff4bXXXXX:21000024ff4bXXXX (0:67:0.0) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba5 qla2xxx link-n/a fc.20000024ff4bXXXX:21000024ff4bXXXX (0:67:0.1) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba32 ahci link-n/a sata.vmhba32 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba33 ahci link-n/a sata.vmhba33 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba34 ahci link-n/a sata.vmhba34 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba35 ahci link-n/a sata.vmhba35 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba36 ahci link-n/a sata.vmhba36 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
esxcfg-scsidevs -a
Here is sample output. Hilighted ones are FC HBA.
~ # esxcfg-scsidevs -a
vmhba0 ahci link-n/a sata.vmhba0 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba1 megaraid_sas link-n/a unknown.vmhba1 (0:3:0.0) LSI / Symbios Logic Dell PERC H710 Adapter
vmhba2 qla2xxx link-up fc.20000024ff4b8XXXX:21000024ffXXXXX (0:5:0.0) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba3 qla2xxx link-n/a fc.20000024ff4bXXXX:21000024ff4XXXXX (0:5:0.1) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba4 qla2xxx link-up fc.20000024ff4bXXXX:21000024ffXXXXXX (0:67:0.0) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba5 qla2xxx link-n/a fc.20000024ff4bXXXX:21000024ffXXXXXX (0:67:0.1) QLogic Corp ISP2532-based 8Gb Fibre Channel to PCI Express HBA
vmhba32 ahci link-n/a sata.vmhba32 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba33 ahci link-n/a sata.vmhba33 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba34 ahci link-n/a sata.vmhba34 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba35 ahci link-n/a sata.vmhba35 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
vmhba36 ahci link-n/a sata.vmhba36 (0:0:31.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
Thanks and Regards,
Shrikant Gavhane.
login o the ESX host and run this command to generate the list of Storage adapters.
esxcli storage core adapter list
Thanks all for the input. I'm wondering if there is a way that I can run a single command or set of commands in such a way as the ouput will be a neat presentation of only the WWNs without the preceding and trailing command output? Perhaps some linux magic to pipe to grep and select only the WWNs somehow?
Did you see the third sample in the link I posted. This shows a way to achieve what you are asking for.
André
Yes I looked at that - thanks. The problem is that these ESXi servers are being built and are not joined to vCenter Server yet. As a result, I can't run PowerCLI commands against them, and I'm limited to running commands in the ESXi shell - so I can't use that example.
Is there a way to do this with linux commands in the ESXi shell that lists all the WWNs on the ESXi host and only the WWNs so you can copy and paste them?
Here you go,
~ # esxcli storage core adapter list | grep -i fc | awk '{print $4}'
fc.200018a99b4cXXXX:200118a99b4cXXXX
fc.200018a99b4cXXXX:200218a99b4cXXXX
Thanks and Regards,
Shrikant Gavahne
OK works great thanks again