1. 程式人生 > >實戰Fibre Channel之六: 發起端和目的端常用命令

實戰Fibre Channel之六: 發起端和目的端常用命令

fibre channel hba qla2xxx

實戰Fibre Channel之六: 發起端和目的端常用命令

Fibre Channel作為一種專用高速網絡iSCSI相比提供了更高的數據傳輸帶寬速度和可靠性熟練掌握一些常用Fibre channel的一些命令可以方便我們進行原型驗證調試和開發下面總結了筆者常用到的一些命令就當拋磚迎玉吧

A. FC 發起端

1. 看主機FC HBA wwpn:

cat /sys/class/fc_host/host*/port_name | sed -e s/0x// -e ‘s/../&:/g‘ -e s/:$//

2. 看對端機器FC相關設置

wwpn:

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/port_name

0x21000024ff684921

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/scsi_target_id

-1

看角色

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/roles

FCP Initiator

24位的port ID:

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/port_id

0x0000e8

看發起端的

IO超時設置

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/dev_loss_tmo

30

[[email protected] rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12\:0-0/fast_io_fail_tmo

off

3. rescan devices after FC fail-over:

[[email protected] var]# cd /sys/class/scsi_host/

[[email protected] scsi_host]# for i in `ls `; do echo "- - -" > $i/scan ; done

[[email protected] scsi_host]# lsscsi -si

[0:0:0:10] disk Leadstor swtich_vol 1.0 /dev/sdc 360014055e652dee8e232d50cbd3665c2 1.07GB

[0:0:0:20] disk Leadstor fc_failover 1.0 /dev/sdd 36001405d3b6e11ace2a8f7f6b00ba7cc 2.19TB

[1:0:0:0] disk ATA SanDisk SD7SB6S1 X355 /dev/sda SanDisk_SD7SB6S128G1001_162609801097 128GB

[2:0:0:0] disk ATA ST2000DM001-1ER1 CC62 /dev/sdb - 2.00TB

[7:0:0:3] disk Leadstor fc_vol 1.0 /dev/sde 36001405c410df1475de9e08ab3f8b9ef 1.07GB

[7:0:0:4] disk Leadstor fc_all_vol 1.0 /dev/sdf 36001405f4807a693420c2c7b98ad996b 1.07GB

[7:0:0:15] disk Leadstor fc_0801vol2 1.0 /dev/sdg 3600140546e63e0728bb357aad6a3d91a 2.14GB

[7:0:0:20] disk Leadstor fc_failover 1.0 /dev/sdh 36001405d3b6e11ace2a8f7f6b00ba7cc 2.19TB

4. 如何發起枚舉FC target上的盤

initiator 上運行下面的命令

## step 1: extend the time-out setting for initiator

for i in `ls /sys/class/fc_host`

do

echo "Extend time out for $i"

echo 90 > /sys/class/fc_host/$i/dev_loss_tmo

done

## step 2: Trigger to discorvery and login to target

for i in `ls /sys/class/fc_host`

do

echo "Trigger $i to discovery target"

echo 1 > /sys/class/fc_host/$i/issue_lip

done

B. FC Target

1. target 相關設置

[[email protected] qla2xxx]# pwd

/sys/kernel/config/target/qla2xxx

[[email protected] qla2xxx]# cat 21\:00\:00\:0e\:1e\:c2\:3e\:a0/

fabric_statistics/ tpgt_1/

[[email protected] qla2xxx]# cat 21\:00\:00\:0e\:1e\:c2\:3e\:a0/fabric_statistics/

cat: 21:00:00:0e:1e:c2:3e:a0/fabric_statistics/: Is a directory

[[email protected] qla2xxx]# cat 21\:00\:00\:0e\:1e\:c2\:3e\:a0/tpgt_1/

acls/ attrib/ auth/ enable lun/ np/ param/

[[email protected] qla2xxx]# cat 21\:00\:00\:0e\:1e\:c2\:3e\:a0/tpgt_1/enable

1

2. 解決target端默認不是target 模式的問題

基於qlogic HBA ,CentOS中當期默認按照initiator模式加載驅動但在存儲服務器端它必須每次都以target模式加載為此需要做下面的修改

edit : /etc/grub2.cfg

linux16 /vmlinuz-3.10.0-229.el7.x86_64+ root=/dev/mapper/centos-root ro rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet LANG=en_US.UTF-8 systemd.debug qla2xxx.qlini_mode="disabled"

然後運行grub2-mkconfig,最後重啟機器後默認就按照target模式加載qla2xxx驅動


本文出自 “存儲之廚” 博客,轉載請與作者聯系!

實戰Fibre Channel之六: 發起端和目的端常用命令