Commandes FC & lun

De BlaxWiki
Révision datée du 25 septembre 2014 à 10:23 par Admin (discussion | contributions)
Aller à la navigationAller à la recherche


Pour d'autres infos sur le multipath et lun, voir cette page

Cette page résume les commandes utiles pour afficher des informations sur la carte fibre HBA du serveur, les luns du netapp, et les cartes fibres du netapp.

Informations générales & contexte

Nous sommes ici dans la configuration suivante :

 - 2 Serveurs (kvm3 & kvm4) avec chacun une carte fibre 2 ports HBA Emulex LPe12002-M8.
         - kvm3 : Port WWN 10:00:00:90:fa:55:07:62 & 10:00:00:90:fa:55:07:63
         - kvm4 : Port WWN 10:00:00:90:fa:55:07:f6 & 10:00:00:90:fa:55:07:f7 

 - 2 switch SAN : sw1 & sw2
 - 1 netapp avec 2 controleurs qui possèdent chacun 2 ports fibre 
         - ctrl 1 : Port WWN 50:0a:09:81:90:66:d5:01 & 50:0a:09:82:80:66:d5:01
         - crtl 2 : Port WWN 50:0a:09:81:80:66:d5:01 & 50:0a:09:82:90:66:d5:01 

 - 2 luns de créés sur le netapp : lun_kvm3_san & lun_kvm4_san

Zoning configuré sur les switchs SAN : 
 - sw1 : 
        - zone kvm3 : ctrl 1 50:0a:09:81:90:66:d5:01 + ctrl 2 50:0a:09:81:80:66:d5:01 + kvm3 10:00:00:90:fa:55:07:63
        - zone kvm4 : crtl 1 50:0a:09:81:90:66:d5:01 + ctrl 2 50:0a:09:81:80:66:d5:01 + kvm4 10:00:00:90:fa:55:07:f7 
 - sw2
        - zone kvm3 : ctrl 1 50:0a:09:82:80:66:d5:01 + ctrl 2 50:0a:09:82:90:66:d5:01 + kvm3 10:00:00:90:fa:55:07:62
        - zone kvm4 : ctrl 1 50:0a:09:82:80:66:d5:01 + ctrl 2 50:0a:09:82:90:66:d5:01 + kvm4 10:00:00:90:fa:55:07:f6
      
Connexions fibre :
 - kvm3 : fibre port 0 relié à sw2 port 6 & fibre port 1 relié à sw1 port 6
 - kvm4 : fibre port 0 relié à sw2 port 7 & fibre port 1 relié à sw1 port 7
 - netapp ctrl 1 : fibre 1a relié à sw1 & fiber 1b relié à sw2
 - netapp ctrl 2 : fibre 1a relié à sw1 & fiber 1b relié à sw2

Cela permet du HA, et le serveur va donc voir 4 chemin via son multipath :

# multipath -ll
VM (360a98000424a4138702443774f345363) dm-0 NETAPP,LUN
size=2.0T features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 7:0:1:1 sdc 8:32 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 7:0:0:1 sdb 8:16 active ready running
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 8:0:0:1 sdd 8:48 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 8:0:1:1 sde 8:64 active ready running

Systool

Cette commande permet d'avoir plein d'info system & hardware, nous allons utiliser juste la partie FIbre. Il faut installer le package sysfsutils.

  • systool -c fc_host -v

Donne plein des sur la carte fibre du serveur, principalement le port wwwn et node wwwn

(pour récuperer et mettre dans le bon format le wwn : 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 ;

[root@kvm3.metier.csn.notaires.fr elxocmcore-rhel5-rhel6-10.0.803.20-1]# systool -c fc_host -v
Class = "fc_host"

  Class Device = "host7"
  Class Device path = "/sys/devices/pci0000:40/0000:40:02.0/0000:41:00.0/host7/fc_host/host7"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    dev_loss_tmo        = "60"
    fabric_name         = "0x10000027f83d7d98"
    issue_lip           = <store method only>
    max_npiv_vports     = "255"
    maxframe_size       = "2048 bytes"
    node_name           = "0x20000090fa550762"
    npiv_vports_inuse   = "0"
    port_id             = "0x150600"
    port_name           = "0x10000090fa550762"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
    supported_speeds    = "2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "Emulex LPe12002-M8 FV2.01A12 DV10.0.803.24"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

    Device = "host7"
    Device path = "/sys/devices/pci0000:40/0000:40:02.0/0000:41:00.0/host7"
      uevent              = "DEVTYPE=scsi_host"
  • systool -c fc_remote_ports

Cela donne des infos sur le netapp (ou autre NAS FC) branché sur la carte fibre de notre serveur. Si ca ne retourne rien, c est que le serveur ne voit pas le netapp. Sert ici principalement à déterminer le target WWN du netapp (il faut regarder les device en "roles=FCP Target")

Class = "fc_remote_ports"

 Class Device = "0-2"
  Class Device path = "/sys/devices/pci0000:40/0000:40:02.0/0000:41:00.0/host7/rport-7:0-2/fc_remote_ports/rport-7:0-2"
    dev_loss_tmo        = "30"
    fast_io_fail_tmo    = "off"
    maxframe_size       = "2048 bytes"
    node_name           = "0x500a09808066d501"
    port_id             = "0x150100"
    port_name           = "0x500a09829066d501"
    port_state          = "Online"
    roles               = "FCP Target"
    scsi_target_id      = "0"
    supported_classes   = "Class 3"
    uevent              =

  Class Device = "0-0"
  Class Device path = "/sys/devices/pci0000:40/0000:40:02.0/0000:41:00.0/host7/rport-7:0-0/fc_remote_ports/rport-7:0-0"
    dev_loss_tmo        = "60"
    fast_io_fail_tmo    = "off"
    maxframe_size       = "2048 bytes"
    node_name           = "0x10000027f83d7d98"
    port_id             = "0xfffffe"
    port_name           = "0x20070027f83d7d98"
    port_state          = "Online"
    roles               = "Fabric Port"
    scsi_target_id      = "-1"
    supported_classes   = "Class 2, Class 3"
    uevent              =

    Device = "rport-7:0-0"
    Device path = "/sys/devices/pci0000:40/0000:40:02.0/0000:41:00.0/host7/rport-7:0-0"
      uevent              =
......
.....

Hbacmd

Cette commande permet d'avoir des infos précises sur la carte fibre du serveur, mais aussi de voir ce qui est relié aux fibres du serveur. Ce logiciel est fourni avec les utilitaires de la carte fibre, il faut les télécharger sur le site du constructeur (pour les Emulex c'est elxocmcore-rhel5-rhel6-10.0.803.20-1)

  • hbacmd listhbas : Informations sur la carte hba du serveur
# hbacmd listhbas

Manageable HBA List

Port WWN       : 10:00:00:90:fa:55:07:62
Node WWN       : 20:00:00:90:fa:55:07:62
Fabric Name    : 10:00:00:27:f8:3d:7d:98
Flags          : 8000f100
Host Name      : kvm3.metier.csn.notaires.fr
Mfg            : Emulex Corporation
Serial No.     : BK40839376
Port Number    : 0
Mode           : Initiator
PCI Bus Number : 65
PCI Function   : 0
Port Type      : FC
Model          : LPe12002-M8

Port WWN       : 10:00:00:90:fa:55:07:63
Node WWN       : 20:00:00:90:fa:55:07:63
Fabric Name    : 10:00:00:27:f8:3d:65:f6
Flags          : 8000f100
Host Name      : kvm3.metier.csn.notaires.fr
Mfg            : Emulex Corporation
Serial No.     : BK40839376
Port Number    : 1
Mode           : Initiator
PCI Bus Number : 65
PCI Function   : 1
Port Type      : FC
Model          : LPe12002-M8
  • hbacmd HbaAttributes Port wwn : Informations plus précises sur la carte hba, mais nécessite le port wwn de la carte
# hbacmd HbaAttributes 10:00:00:90:fa:55:07:f6

HBA Attributes for 10:00:00:90:fa:55:07:f6

Host Name                     : kvm4.metier.csn.notaires.fr
Manufacturer                  : Emulex Corporation
Serial Number                 : BK40839221
Model                         : LPe12002-M8
Model Desc                    : Emulex LPe12002-M8 8Gb 2-port PCIe Fibre Channel Adapter
Node WWN                      : 20 00 00 90 fa 55 07 f6
Node Symname                  : Emulex LPe12002-M8 FV2.01A12 DV10.0.803.24
HW Version                    : 31004549
Opt ROM Version               : 6.03x1
FW Version                    : 2.01A12 (U3D2.01A12)
Vendor Spec ID                : 10DF
Number of Ports               : 1
Driver Name                   : lpfc
Device ID                     : F100
HBA Type                      : LPe12002-M8
Operational FW                : SLI-3 Overlay
SLI2 FW                       : 2.01a12
SLI3 FW                       : 2.01a12
IEEE Address                  : 00 90 fa 55 07 f6
Boot Code                     : Enabled
Boot Version                  : 6.03x1
Driver Version                : 10.0.803.24; HBAAPI(I) v2.3.b, 07-12-10
Kernel Version                : 1.12a0
Board Temperature             : Normal
Function Type                 : FC
Sub Device ID                 : F100
PCI Bus Number                : 65
PCI Func Number               : 0
Sub Vendor ID                 : 10DF
 hbacmd PortAttributes : Informations plus précises sur la carte hba, mais nécessite le port wwn de la carte
# hbacmd PortAttributes 10:00:00:90:fa:55:07:f7

Port Attributes for 10:00:00:90:fa:55:07:f7

Node WWN                  : 20 00 00 90 fa 55 07 f7
Port WWN                  : 10 00 00 90 fa 55 07 f7
Port Symname              : Emulex PPN-10:00:00:90:fa:55:07:f7
Port FCID                 : B0700
Port Type                 : Fabric
Port State                : Operational
Port Service Type         : 8
Port Supported FC4        : 00 00 01 00 00 00 00 01
                            00 00 00 00 00 00 00 00
                            00 00 00 00 00 00 00 00
                            00 00 00 00 00 00 00 00
Port Active FC4           : 00 00 01 00 00 00 00 01
                            00 00 00 00 00 00 00 00
                            00 00 00 00 00 00 00 00
                            00 00 00 00 00 00 00 00
Port Supported Speed      : 2 4 8 GBit/sec
Port Speed                : 8 GBit/sec
Max Frame Size            : 2048
OS Device Name            : /sys/class/scsi_host/host8
Num Discovered Ports      : 4
Fabric Name               : 10 00 00 27 f8 3d 65 f6
Function Type             : FC
  • hbacmd AllNodeInfo : Permet de récuperer les Port & node wwn de la targer (ici le netapp), nécessite le port wwn de la carte
# hbacmd AllNodeInfo 10:00:00:90:fa:55:07:63

Node Type      : READY
FCP ID         : B0100
SCSI Bus Number: 0
SCSI Target Num: 0
Node WWN       : 50:0A:09:80:80:66:D5:01
Port WWN       : 50:0A:09:81:90:66:D5:01
OS Device Name : /sys/class/scsi_host/host8/device/rport-8:0-2


Node Type      : READY
FCP ID         : B0000
SCSI Bus Number: 0
SCSI Target Num: 1
Node WWN       : 50:0A:09:80:80:66:D5:01
Port WWN       : 50:0A:09:81:80:66:D5:01
OS Device Name : /sys/class/scsi_host/host8/device/rport-8:0-3

Sanlun

Cette commande permet surtout d'avoir des infos sur les lun et le netapp. Il faut installer le rpm netapp_linux_host_utilities-6-2

# sanlun lun show
controller(7mode)/                                  device          host                  lun
vserver(Cmode)       lun-pathname                   filename        adapter    protocol   size    mode
------------------------------------------------------------------------------------------------------
ctrl1-san            /vol/vol_kvm4_san/lun_kvm4_san /dev/sdd        host8      FCP        2t      7
ctrl1-san            /vol/vol_kvm4_san/lun_kvm4_san /dev/sde        host8      FCP        2t      7
ctrl1-san            /vol/vol_kvm4_san/lun_kvm4_san /dev/sdb        host7      FCP        2t      7
ctrl1-san            /vol/vol_kvm4_san/lun_kvm4_san /dev/sdc        host7      FCP        2t      7
# sanlun lun show -p

                    ONTAP Path: ctrl1-san:/vol/vol_kvm4_san/lun_kvm4_san
                           LUN: 1
                      LUN Size: 2t
           Controller CF State: Cluster Enabled
            Controller Partner: ctrl2-san
                          Mode: 7
                   Host Device: VM(360a98000424a4138702443774f345361)
              Multipath Policy: round-robin 0
            Multipath Provider: Native
--------- ---------- ------- ------------ ----------------------------------------------
host      controller                      controller
path      path       /dev/   host         target
state     type       node    adapter      port
--------- ---------- ------- ------------ ----------------------------------------------
up        primary    sdc     host7        1b
up        secondary  sdb     host7        1b
up        primary    sde     host8        1a
up        secondary  sdd     host8        1a
#  sanlun fcp show adapter -v all
adapter name:      host7
WWPN:              10000090fa5507f6
WWNN:              20000090fa5507f6
driver name:       lpfc
model:             LPe12002-M8
model description: Emulex LPe12002-M8 8Gb 2-port PCIe Fibre Channel Adapter
serial number:     BK40839221
hardware version:  31004549
driver version:    10.0.803.24; HBAAPI(I) v2.3.b, 07-12-10
firmware version:  2.01A12 (U3D2.01A12)
Number of ports:   1
port type:         Fabric
port state:        Operational
supported speed:   2 GBit/sec, 4 GBit/sec, 8 GBit/sec
negotiated speed:  8 GBit/sec
OS device name:    /sys/class/scsi_host/host7