获取ESXi的WWNN和WWPN
一、使用web查看
vSphere 6.5.0.23000 Flash web
- 选择主机 > 配置 > 存储适配器 > 选择vmhba* >下方属性界面中可以看到WWNN和WWPN
vSphere 6.7.0.45000 Html5 web
- 同样的 选择主机 > 配置 > 存储适配器 > 选择vmhba* >下方属性界面中可以看到WWNN和WWPN
二、使用RVTools查看
- 也可以使用RVTools的导出功能,将所有信息导出为EXCEL查看(方便复制)
三、使用PowerCli获取
PS C:\> Get-VMHostHBA -Type FibreChannel | Select VMHost,Cevice,@{N="WWNN";E={"{0:X}" -f $_.NoCeWorlCWiCeName }},@{N="WWPN";E={"{0:X}" -f $_.PortWorlCWiCeName}} | Format-Table -AutoSize
VMHost Device WWNN WWPN
------ ------ ---- ----
10.10.201.222 vmhba3 100043600C3CA6BC 210034800C3CA6BC
10.10.201.222 vmhba4 100043600C3CAA02 210034800C3CAA02
10.10.201.221 vmhba3 200000106B1AC8E2 100000106B1AC8E2
10.10.201.221 vmhba4 200000106B1AC8E3 100000106B1AC8E3
10.10.201.221 vmhba5 100043600C3CA6B6 210034800C3CA6B6
10.10.201.221 vmhba6 100043600C3CAA33 210034800C3CAA33
10.10.201.14 vmhba2 100043600C3CA6CC 210034800C3CA6CC
10.10.201.14 vmhba3 100043600C3CA6F4 210034800C3CA6F4
10.10.201.15 vmhba2 100043600C3CA771 210034800C3CA771
10.10.201.15 vmhba3 100043600C3CA7AC 210034800C3CA7AC
10.10.201.13 vmhba2 100043600C3CAAC5 210034800C3CAAC5
10.10.201.13 vmhba3 100043600C3CA7CC 210034800C3CA7CC
10.10.201.12 vmhba2 100043600C3CAA60 210034800C3CAA60
10.10.201.12 vmhba3 100043600C3CA730 210034800C3CA730
10.10.201.11 vmhba4 100043600C3CA776 210034800C3CA776
10.10.201.11 vmhba64 100043600C3CA7C2 210034800C3CA7C2
10.10.201.41 vmhba71 2000F4E6C466AE23 2001F4E6C466AE23
10.10.201.41 vmhba2 100043600C3CAA2C 210034800C3CAA2C
10.10.201.41 vmhba3 100043600C3CA767 210034800C3CA767
10.10.201.41 vmhba65 2000F4E6C4668471 2001F4E6C4668471
10.10.201.41 vmhba67 2000F4E6C4668473 2001F4E6C4668473
10.10.201.41 vmhba66 2000F4E6C466AE21 2001F4E6C466AE21
- 将输出保存为.csv
PS C:\> Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWNN";E={"{0:X}" -f $_.NodeWorldWideName }},@{N="WWPN";E={"{0:X}" -f $_.PortWorldWideName}} | Export-Csv HBA-details.csv
- 将输出保存为.csv (包含HBA卡状态online/offline)
PS C:\> Get-VMHostHBA -Type FibreChannel | Select VMHost,Device,@{N="WWNN";E={"{0:X}" -f $_.NodeWorldWideName }},@{N="WWPN";E={"{0:X}" -f $_.PortWorldWideName}},Status | Export-Csv HBA-details.csv
参考:
[1]vSphere手册 https://www.vmware.com/cn/support/support-resources/pubs/vsphere-esxi-vcenter-server-pubs.html
[2]RVTools https://www.robware.net/rvtools/
[3]PowerCli https://code.vmware.com/docs/1507/vmware-powercli
[4]http://theartofit.org/quickly-change-path-selection-policy-for-multiple-esxi-hosts-using-powercli/
[5]https://www.baylyparker.com/2017/06/powercli-finding-host-hba-wwn/
[6]https://www.vnugglets.com/2014/07/get-vmhost-fc-hba-wwn-info-most-quickly.html
[7]https://pingforinfo.com/powercli-one-liner-for-finding-hba-model-wwpn-and-driver-details/
[8]https://docs.microsoft.com/en-us/powershell/scripting/samples/using-format-commands-to-change-output-view?view=powershell-7.1