close

在 SAN network的環境裡 , 常常需要透過 san zone 的方式來規劃分配儲存資源 .

這時候就需要知道你的主機 HBA card 的WWN address , 來設定你的 fiber channel switch . 那麼究竟要如何查詢  WWN address 呢.? 

有下列幾種方式 :


方法1: /sys/class/scsi_host/host{n}/device/fc_host:host{n}/port_name File

在Redhat 5 以上 ( 包含 OEL and CentOS) ,   /sys/class/scsi_host/host{n}/device/fc_host:host{n}/port_name 這個檔案裡就包含了 HBA WWN 資訊 .

 n可能代表  0, 1, or 2 是你的系統而定 .

例如 :

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)

$ cat /sys/class/scsi_host/host1/device/fc_host:host1/port_name
0x2100001c111111c1

方法2: /proc/scsi/{adapter-type}/{n} File

在 Redhat 4 (含)以下 (包括 OEL and CentOS), 在 /proc/scsi/{adapter-type}/{n} file 這個檔案裡就包含了 HBA WWN 資訊 .

其中 {adapter-type} 如果是可能是QLogic HBA卡就表示為  qlaxxxx  , 如果是Emulex
的 HBA 卡 就填入 lpfc .
同樣的 n 可能代表  0, 1, or 2 是你的系統而定 .

以 qlogic 2300 HBA卡 ,在 RedHat 3裡為例 :

$ cat /etc/redhat-release
Enterprise Linux Enterprise Linux AS release 3 (Update 9)

$ cat /proc/scsi/qla2300/1
QLogic PCI to Fibre Channel Host Adapter for QLA2460:
Firmware version: 4.00.23, Driver version 7.07.05
Entry address = f888d060

Request Queue = 0x37280000, Response Queue = 0x37270000
Request Queue count= 512, Response Queue count= 512
Total number of active commands = 2
Total number of interrupts = -1635473967
Total number of active IP commands = 0
Total number of IOCBs (used/max) = (0/0)
Total number of queued commands = 2
Device queue depth = 0x20
Number of free request entries = 454
Number of mailbox timeouts = 0
Number of ISP aborts = 0
Number of loop resyncs = 0
Number of retries for empty slots = 0
Number of reqs in pending_q= 0, retry_q= 0, done_q= 0, scsi_retry_q= 0
Host adapter:loop state= , flags= 0x70013
Dpc flags = 0x0
MBX flags = 0x0
SRB Free Count = 4094
Link down Timeout = 045
Port down retry = 045
Login retry count = 045
Commands retried with dropped frame(s) = 0
Configured data rate: 4 Gb/sec

SCSI Device Information:
scsi-qla0-adapter-node=2000002c222c2cc2;
scsi-qla0-adapter-port=2100002c222c2cc2;
scsi-qla0-target-0=5006016022c22c2c;
scsi-qla0-target-1=5006016822c22c2c;

SCSI LUN Information:
(Id:Lun) * - indicates lun is not registered with the OS.
( 0: 0): Total reqs -877237672, Pending reqs 0, flags 0x0, 0:0:81,
( 0: 1): Total reqs 1074740881, Pending reqs 2, flags 0x0, 0:0:81,
( 0: 2): Total reqs 439861869, Pending reqs 0, flags 0x0, 0:0:81,
( 0: 3): Total reqs 417766757, Pending reqs 0, flags 0x0, 0:0:81,
( 1: 0): Total reqs 1174574, Pending reqs 0, flags 0x0, 0:0:82,
( 1: 1): Total reqs 1906876572, Pending reqs 0, flags 0x0, 0:0:82,
( 1: 2): Total reqs 1175529, Pending reqs 0, flags 0x0, 0:0:82,
( 1: 3): Total reqs 1173331, Pending reqs 0, flags 0x0, 0:0:82,

 

arrow
arrow
    全站熱搜

    puffer 發表在 痞客邦 留言(0) 人氣()