广东十一选五开奖 > 计算机网络 > Redhat Server查看HBA和WWN的方法

原标题:Redhat Server查看HBA和WWN的方法

浏览次数:184 时间:2019-11-07

图片 1

看wwpn:

    Device = "host14"
    Device path = "/sys/devices/pci0000:80/0000:80:0b.0/0000:81:00.0/host14"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "?0"

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/roles

还有一个借助systool能看到你的hba卡和哪些设备连接(或者说能看到哪些存储)。

30

在RedHat下查看wwn是件麻烦事,有的人说用vendor自带的工具查,有的说可以看/proc/scsi/下的某个目录文件,偏偏我遇到的,这些都看不见,虽然使用的是QLogic,但是系统没安装,未经许可也不方便随便安装这些软件,只能另想办法。

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

  Class Device = "host14"
  Class Device path = "/sys/class/fc_host/host14"
    fabric_name         = "0xxxxxxxxxxx"
    issue_lip           = <store method only>
    node_name           = "0xxxxxxxxxxx"
    port_id             = "0x331400"
    port_name           = "0xxxxxxxxxxx"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "4 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
    symbolic_name       = "QLE2460 FW:v4.04.09 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

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

[ tmp]# systool -c fc_host -v
Class = "fc_host"

 

[tmp]# systool -c fc_remote_ports -v|more
Class = "fc_remote_ports"

[root@localhost qla2xxx]# cat 21:00:00:0e:1e:c2:3e:a0/tpgt_1/enable

  Class Device = "0-0"
  Class Device path = "/sys/class/fc_remote_ports/rport-13:0-0"
    dev_loss_tmo        = "60"
    fast_io_fail_tmo    = "off"
    node_name           = "0xxxxxxxxxxxx"
    port_id             = "0x330400"
    port_name           = "0xxxxxxxxxxx"
    port_state          = "Online"
    roles               = "FCP Initiator"
    scsi_target_id      = "-1"
    supported_classes   = "Class 3"
    uevent              = <store method only>
....

看发起端的IO超时设置:

查了很多资料,终于知道有个命令systool可以实现

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

可以看出os把两个hba识别为host13和host14(嗯~~风格和solaris很不一样)。一般情况下,一个卡
的node_name和port_name 就是指该HBA卡的wwn,他们的值是一样的。速度啊什么的该列的参数都给你列出来了。

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

  Class Device = "host13"
  Class Device path = "/sys/class/fc_host/host13"
    fabric_name         = "0xxxxxxxxxxxxx"
    issue_lip           = <store method only>
    node_name           = "0xxxxxxxxxxx"
    port_id             = "0x331400"
    port_name           = "0xxxxxxxxxxx"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "4 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit"
    symbolic_name       = "QLE2460 FW:v4.04.09 DVR:v8.03.01.04.05.05-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/fast_io_fail_tmo

    Device = "host13"
    Device path = "/sys/devices/pci0000:00/0000:00:0a.0/0000:02:00.0/host13"
      ct                  =
      els                 =
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "?0"

 

更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10

2. 解决target端默认不是target 模式的问题

 

实战Fibre Channel之六: 发起端和目的端常用命令

2. 看对端机器FC相关设置

1. 看target 相关设置

[root@localhost qla2xxx]# cat 21:00:00:0e:1e:c2:3e:a0/

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/port_id

A. FC 发起端

        echo "Trigger $i to discovery target"

  1. rescan devices after FC fail-over:

0x21000024ff684921

off

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

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/dev_loss_tmo

[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

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/scsi_target_id

 

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

 

[root@localhost scsi_host]# lsscsi -si

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

fabric_statistics/ tpgt_1/

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

1. 看主机FC HBA wwpn:

[root@localhost qla2xxx]# cat 21:00:00:0e:1e:c2:3e:a0/tpgt_1/

看24位的port ID:

1

do

 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"

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

基于qlogic HBA 卡,CentOS中当期默认按照initiator模式加载驱动。但在存储服务器端,它必须每次都以target模式加载。 为此需要做下面的修改:

 

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

FCP Initiator

 

done

[root@localhost qla2xxx]# pwd

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

edit : /etc/grub2.cfg

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

[root@localhost qla2xxx]# cat 21:00:00:0e:1e:c2:3e:a0/fabric_statistics/

然后运行grub2-mkconfig,最后重启机器后默认就按照target模式加载qla2xxx驱动。

 

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

B. FC Target端

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

-1

Fibre Channel作为一种专用、高速网络,和iSCSI相比,提供了更高的数据传输带宽、速度和可靠性。熟练掌握一些常用Fibre channel的一些命令,可以方便我们进行原型验证、调试和开发。下面总结了笔者常用到的一些命令,就当抛砖迎玉吧。

[root@localhost var]# cd /sys/class/scsi_host/

[root@localhost rport-12:0-0]# cat /sys/class/fc_remote_ports/rport-12:0-0/port_name

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

        echo "Extend time out for $i"

/sys/kernel/config/target/qla2xxx

do

[root@localhost scsi_host]# for i in `ls `; do echo "- - -" > $i/scan ; done

4.  如何发起枚举FC target上的盘

在initiator 上运行下面的命令:

 

done

0x0000e8

本文由广东十一选五开奖发布于计算机网络,转载请注明出处:Redhat Server查看HBA和WWN的方法

关键词:

上一篇:没有了

下一篇:没有了