Gestion des cartes FC sous Linux

mardi 26 mars 2013
par  Jerome ROBERT
popularité : 20%

Mémo du SAN sous Linux

 

Il faut avoir le binaire : /usr/bin/systool

 

Vérification de la présence du package :

# rpm -qf /usr/bin/systool
sysfsutils-2.1.0-1.el5
 

# sinon :

yum install sysfsutils

 

Pour connaître les ports reconnu sur le serveur Linux :

 

# systool -c fc_host
Class = "fc_host"

  Class Device = "host3"
    Device = "host3"

  Class Device = "host4"
    Device = "host4"

Avoir les informations sur le WWN des ports :

# systool -c fc_host -v
Class = "fc_host"

  Class Device = "host3"
  Class Device path = "/sys/class/fc_host/host3"
    fabric_name         = "0x10000005332a930e"
    issue_lip           = <store method only>
    node_name           = "0x5001438018752f4d"
    port_id             = "0x023500"
    port_name           = "0x5001438018752f4c"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "HPAK344A FW:v5.06.03 DVR:v8.03.07.09.05.08-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host3"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:11:00.0/host3"
      edc                 = <store method only>
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "&"


  Class Device = "host4"
  Class Device path = "/sys/class/fc_host/host4"
    fabric_name         = "0x100000053327f75e"
    issue_lip           = <store method only>
    node_name           = "0x5001438018752ef9"
    port_id             = "0x013500"
    port_name           = "0x5001438018752ef8"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "HPAK344A FW:v5.06.03 DVR:v8.03.07.09.05.08-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              = <store method only>

    Device = "host4"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host4"
      edc                 = <store method only>
      fw_dump             =
      nvram               = "ISP "
      optrom_ctl          = <store method only>
      optrom              =
      reset               = <store method only>
      sfp                 = ""
      uevent              = <store method only>
      vpd                 = "&"


# cat /sys/class/fc_host/host?/port_name
0x5001438018752f4c
0x5001438018752ef8


# systool -c fc_transport -v
Class = "fc_transport"

  Class Device = "0:0"
  Class Device path = "/sys/class/fc_transport/target3:0:0"
    node_name           = "0x500a0980895b5628"
    port_id             = "0x023f00"
    port_name           = "0x500a0985995b5628"
    uevent              = <store method only>

    Device = "target3:0:0"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:11:00.0/host3/rport-3:0-0/target3:0:0"
      uevent              = <store method only>


  Class Device = "0:0"
  Class Device path = "/sys/class/fc_transport/target4:0:0"
    node_name           = "0x500a0980895b5628"
    port_id             = "0x013700"
    port_name           = "0x500a0984995b5628"
    uevent              = <store method only>

    Device = "target4:0:0"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host4/rport-4:0-0/target4:0:0"
      uevent              = <store method only>


  Class Device = "0:1"
  Class Device path = "/sys/class/fc_transport/target3:0:1"
    node_name           = "0x500a0980895b5628"
    port_id             = "0x023700"
    port_name           = "0x500a0985895b5628"
    uevent              = <store method only>

    Device = "target3:0:1"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:11:00.0/host3/rport-3:0-1/target3:0:1"
      uevent              = <store method only>


  Class Device = "0:1"
  Class Device path = "/sys/class/fc_transport/target4:0:1"
    node_name           = "0x500a0980895b5628"
    port_id             = "0x013f00"
    port_name           = "0x500a0984895b5628"
    uevent              = <store method only>

    Device = "target4:0:1"
    Device path = "/sys/devices/pci0000:00/0000:00:07.0/0000:0e:00.0/host4/rport-4:0-1/target4:0:1"
      uevent              = <store method only>



Pour faire simple:

# systool -av -c fc_host |grep -i port_name
    port_name           = "0x5001438018752f4c"
    port_name           = "0x5001438018752ef8"


# systool -av -c fc_host |grep -i port_name|awk '{print $NF}'|awk -Fx '{print $2}'|sed 's/\///g'|while read a; do echo $a|sed 's/../&:/g'| sed 's/:\"//';done;
50:01:43:80:18:75:2f:4c
50:01:43:80:18:75:2e:f8





Connaitre les cartes FC du serveur :

 

# lspci | grep -i fibre
0e:00.0 Fibre Channel : QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
11:00.0 Fibre Channel : QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
 

 

# dmesg |grep QLogic
QLogic Fibre Channel HBA Driver
 QLogic Fibre Channel HBA Driver: 8.03.07.09.05.08-k
  QLogic HPAK344A - HP 8Gb Single Channel PCI-e 2.0 FC HBA
 QLogic Fibre Channel HBA Driver: 8.03.07.09.05.08-k
  QLogic HPAK344A - HP 8Gb Single Channel PCI-e 2.0 FC HBA
QLogic 1/10 GbE Converged/Intelligent Ethernet Driver v5.0.24

 

 

 

 

 


Statistiques

Dernière mise à jour

mercredi 4 octobre 2023

Publication

273 Articles
Aucun album photo
Aucune brève
6 Sites Web
2 Auteurs

Visites

86 aujourd’hui
133 hier
827471 depuis le début
2 visiteurs actuellement connectés