LUN mapping

Samuel Chevalley
10 juin 2016

Trouver le WWN des ports fibres sous Linux

Avec la commande « systool », on peut trouver les 2 WWN des 2 ports fibres :

[root@linux ~]# systool -c fc_host -v
Class = "fc_host"

 Class Device = "host2"
 Class Device path = "/sys/class/fc_host/host2"
 fabric_name = "0x1000000533aa7b76"
 issue_lip = <store method only>
 node_name = "0x5001438409ac4f81"
 port_id = "0x150b00"
 port_name = "0x5001438409ac4f80"
 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: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>

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

 Class Device = "host3"
 Class Device path = "/sys/class/fc_host/host3"
 fabric_name = "0x1000000533aac397"
 issue_lip = <store method only>
 node_name = "0x5001438809ac71b7"
 port_id = "0x160b00"
 port_name = "0x5001438809ac71b6"
 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: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>

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

 

Trouver le LUN ID sous Linux

Avec la commande « multipath », on peut trouver les LUN ID (ici 3) :

[root@linux ~]# multipath -l
mpath2 (362060e80104a0b90053048d15000001f) dm-7 HITACHI,DF600F
[size=50G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 2:0:0:2 sdc 8:32 [active][undef]
 \_ 3:0:0:2 sdf 8:80 [active][undef]
mpath1 (362060e80104a0b90053048d15000000d) dm-6 HITACHI,DF600F
[size=50G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 2:0:0:1 sdb 8:16 [active][undef]
 \_ 3:0:0:1 sde 8:64 [active][undef]
mpath0 (362060e80104a0b90053048d150000014) dm-5 HITACHI,DF600F
[size=400G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 2:0:0:0 sda 8:0 [active][undef]
 \_ 3:0:0:0 sdd 8:48 [active][undef]

On récupère les derniers chiffres en hexadécimale des WWN et on les converti en décimal :

  • 1f (héxa) = 31 (décimal)
  • 0d (héxa) = 13 (décimal)
  • 14 (héxa) = 20 (décimal)

Ce serveur est donc zoné sur 3 LUN dont les ID sont 31, 13 et 20.

Remarque : la procédure est identique pour déterminer les LUN zonées sur les ESX, il suffit de convertir les derniers chiffres des WWN des datastores.

 

Trouver le WWN des ports fibres sous Solaris

Avec la commande « luxadm », on peut trouver les 2 WWN des 2 ports fibres :

solaris{root}:/> luxadm -e port

Found path to 3 HBA ports

/devices/pci@8,600000/fibre-channel@1/fp@0,0:devctl CONNECTED
/devices/pci@8,600000/fibre-channel@2/fp@0,0:devctl CONNECTED
/devices/pci@9,600000/SUNW,qlc@2/fp@0,0:devctl CONNECTED

solaris{root}:/> luxadm -e dump_map /devices/pci@8,600000/fibre-channel@1/fp@0,0:devctl
Pos  Port_ID  Hard_Addr  Port WWN           Node WWN          Type
0    b1600    0          51160e80100d5b90   51160e80100d5b90  0x0 (Disk device) 
1    152500   0          210110e08b1ae504   201100e08b1ae504  0x1f (Unknown Type,Host Bus Adapter)

solaris{root}:/> luxadm -e dump_map /devices/pci@8,600000/fibre-channel@2/fp@0,0:devctl
Pos  Port_ID  Hard_Addr  Port WWN           Node WWN          Type
0    c1600    0          51160e80100d5b98   51160e80100d5b98  0x0 (Disk device)
1    162500   0          210110e08b1ad804   210110e08b1ad804  0x1f (Unknown Type,Host Bus Adapter)