1. 程式人生 > >怎樣查看unix和linux的HBA卡的WWN地址

怎樣查看unix和linux的HBA卡的WWN地址

unix linux hba

AIX:

1,獲得AIX主機連接的光纖設備:

root@test:/# lsdev -Cc adapter -S a |grep fcs
fcs0    Available 05-00 4Gb FC PCI Express Adapter (df1000fe)
fcs1    Available 05-01 4Gb FC PCI Express Adapter (df1000fe)
fcs2    Available 04-00 4Gb FC PCI Express Adapter (df1000fe)
fcs3    Available 04-01 4Gb FC PCI Express Adapter (df1000fe)

顯示光纖卡的數量

2,查看光纖卡的WWN號:

root@test:/# lscfg -vpl fcs0
  fcs0             U78AA.001.WZSGZ30-P1-C5-T1  4Gb FC PCI Express Adapter (df1000fe)

        Part Number.................10N7255
        Serial Number...............1A1490164A
        Manufacturer................001A
        EC Level....................D77040
        Customer Card ID Number.....5774
        FRU Number..................10N7255
        Device Specific.(ZM)........3
        Network Address.............10000000C9CC8A2E      #wwn地址
        ROS Level and ID............02E8277F
        Device Specific.(Z0)........2057706D
        Device Specific.(Z1)........00000000
        Device Specific.(Z2)........00000000
        Device Specific.(Z3)........03000909
        Device Specific.(Z4)........FFE01212
        Device Specific.(Z5)........02E8277F
        Device Specific.(Z6)........06E12715
        Device Specific.(Z7)........07E1277F
        Device Specific.(Z8)........20000000C9CC8A2E
        Device Specific.(Z9)........ZS2.71X15
        Device Specific.(ZA)........Z1F2.70A5 
        Device Specific.(ZB)........Z2F2.71X15
        Device Specific.(ZC)........00000000
        Hardware Location Code......U78AA.001.WZSGZ30-P1-C5-T1


  PLATFORM SPECIFIC

  Name:  fibre-channel
    Model:  LPe11002
    Node:  fibre-channel@0
    Device Type:  fcp
    Physical Location: U78AA.001.WZSGZ30-P1-C5-T1
root@test:/#

HP-Unix:
1,列出HP機上連接的光纖卡設備:

 # ioscan -fnC fc
Class     I H/W Path Driver S/W State   H/WType     Description
============
fc        0 0/3/1/0  fcd CLAIMED     INTERFACE    HP A6826-600012Gb Dual Port PCI/PCI-X Fibre Channel Adapter (FC Port 1)
                     /dev/fcd0
fc        1 0/3/1/1   fcdCLAIMED     INTERFACE    HP A6826-60001 2GbDual Port PCI/PCI-X Fibre Channel Adapter (FC Port 2)
                     /dev/fcd1


由此圖可以看到,/dev/fcd0和/dev/fcd1是兩個光纖卡
2, 查看光纖卡的WWN號

# fcmsutil /dev/fcd0

                          Vendor ID is = 0x001077
                          Device ID is = 0x002312
            PCISub-system Vendor ID is = 0x00103c
                  PCI Sub-system ID is = 0x0012ba
                              PCI Mode = PCI-X 133 MHz
                      ISP Code version = 3.3.18
                      ISP Chip version = 3
                              Topology = PTTOPT_FABRIC
                            Link Speed = 2Gb
                    Local N_Port_id is = 0xa10500
                 Previous N_Port_id is = None
            N_Port Node World Wide Name =0x50060b00001db241
            N_Port PortWorld Wide Name = 0x50060b00001db240
            Switch PortWorld Wide Name = 0x205e000dec0e2e00
            Switch NodeWorld Wide Name = 0x2001000dec0e2e01
                          Driver state = ONLINE
                      Hardware Path is = 0/3/1/0
                    Maximum Frame Size = 2048
         Driver-Firmware Dump Available= NO
         Driver-Firmware Dump Timestamp= N/A
                        Driver Version = @(#) libfcd.a HP Fibre Channel ISP 23xx & 24xx DriverB.11.23.04 /ux/core/isu/FCD/kern/src/common/wsio/fcd_init.c:Oct 18 2005,08:21:11

顯示了HBA卡的WWNN和WWPN號,另外還能看到該HBA卡連接的光纖交換機端口的WWN號

Solaris:
solaris上用luxadm命令來管理存儲設備以及光纖相關設備.
1, 查詢現有存儲設備和光纖設備,可以讀到包括磁盤設備的WWN號

    # luxadm probe


2, 查看HBA的prot,可以得到HBA卡的port值以及連接屬性:

    # luxadm -e port
        /devices/pci@0,0/pci1022,7450@2/pci1077,101@1/fp@0,0:devctl       NOT CONNECTED
       /devices/pci@0,0/pci1022,7450@2/pci1077,101@1,1/fp@0,0:devctl     CONNECTED

從中可以看到僅有一塊光纖卡連接到存儲設備


3, 選擇那個已經連接的HBA卡,查看其WWN號

格式: # luxadm -edump_map 設備port.其中port值可從步驟2得到.如下圖啊所示:

     # luxadm -e dump_map/devices/pci@0,0/pci1022,7450@2/pci1077,101@1/fp@0,0:devctl
       Pos Port_ID Hard_Addr Port WWN        Node WWN         Type
       0    0      0        210000e08b19827a 200000e08b19827a 0x1f(Unknown Type,Host Bus Adapter)

Redhat:
在Redhat中,設備管理的相關信息都保存在內核中,即/proc目錄.所以我們一般查詢CPU,內存,磁盤等信息,也是在該目錄下. 其中 HBA卡相關信息保存在/proc/scsi/qla2300/目錄下,不同設備對應不同的文件名,例如

    # grep scsi /proc/scsi/qla2300/1
    Number of reqs in pending_q= 0, retry_q= 0, done_q= 0,scsi_retry_q= 0
    scsi-qla0-adapter-node=200000e08b9cf661;
    scsi-qla0-adapter-port=210000e08b9cf661;


HBA卡裏面的Node WWN Port WWN

HBA,字面理解是主機總線適配卡,我覺得現在狹義的叫做 FC HBA,在的HBA也就是Fibre Channel HostBus Adapter,因為網卡是不是也可以叫做NETWORK HBA呢,在FC網絡中,主機(如服務器)需要和FC網絡、FC存儲設備(如SAN)連接時,需要使用一種接口卡,就如同連接以太網需要以太網卡一樣。這 種接口卡就叫做FC HBA,簡稱HBA

和以太網卡的MAC地址一樣,HBA上也有獨一無二的標識,這就是WWN(World Wide Name)。HBA上的WWN有兩種:

  • Node WWN(WWNN):每個HBA有其獨有的Node WWN

一般在solaris裏面用
#luxadm probe

得到的結果都是NODE WWN。根據有幾個NODE WWN,你就可以知道你有幾個FC HBA卡了。

  • Port WWN(WWPN):HBA卡上每個port有其獨一無二的Port WWN。

  • 由於通訊是通過port進行的,多數情況下需要使用WWPN而不是WWNN。

WWN的長度為8bytes,用16進制表示並用冒號分隔。例如:50:06:04:81:D6:F3:45:42



本文出自 “夜色” 博客,請務必保留此出處http://liuqun.blog.51cto.com/3544993/1981222

怎樣查看unix和linux的HBA卡的WWN地址