Как узнать wwn linux

Записки угрюмого поднимателя пингвинов.

Бывает трудно найти к какому SAN относится диск и как он подключен, если к серверу подключено более двух SAN одного типа. Получаем FC адрес на HBA.

# systool -c fc_host -v
Class = «fc_host»

Class Device = «host1»
Class Device path = «/sys/class/fc_host/host1»
fabric_name = «0x1000000533a43ae2»
issue_lip = <store method only>
node_name = «0x5001438016793705»
port_id = «0x800100»
port_name = «0x5001438016793704»
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 = «QMH2562 FW:v5.06.03 DVR:v8.03.07.15.05.09-k»
system_hostname = «»
tgtid_bind_type = «wwpn (World Wide Port Name)»
uevent = <store method only>

Device = «host1»
Device path = «/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1»
edc = <store method only>
fw_dump =
nvram = «ISP «
optrom_ctl = <store method only>
optrom =
reset = <store method only>
uevent = <store method only>
vpd = «-8»

Class Device = «host2»
Class Device path = «/sys/class/fc_host/host2»

# systool -c fc_transport -v

Class = «fc_transport»

Class Device = «0:0»
Class Device path = «/sys/class/fc_transport/target1:0:0»
node_name = «0x500000e0d4465600»
port_id = «0x431900»
port_name = «0x500000e0d4465680»
uevent = <store method only>

Device = «target1:0:0»
Device path = «/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-0/target1:0:0»
uevent = <store method only>

Class Device = «0:0»
Class Device path = «/sys/class/fc_transport/target2:0:0»
node_name = «0x500000e0d4465600»
port_id = «0x441900»
port_name = «0x500000e0d4465681»
uevent = <store method only>

Device = «target2:0:0»
Device path = «/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-0/target2:0:0»
uevent = <store method only>

Class Device = «0:10»
Class Device path = «/sys/class/fc_transport/target1:0:10»
node_name = «0x500110a0005ad776»
port_id = «0x433400»
port_name = «0x500110a0005ad777»
uevent = <store method only>

Device = «target1:0:10»
Device path = «/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.0/host1/rport-1:0-10/target1:0:10»
uevent = <store method only>

Class Device = «0:10»
Class Device path = «/sys/class/fc_transport/target2:0:10»
node_name = «0x500110a0005ad86f»
port_id = «0x3e4200»
port_name = «0x500110a0005ad870»
uevent = <store method only>

Device = «target2:0:10»
Device path = «/sys/devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-10/target2:0:10»
uevent = <store method only>

WWN(port_name) и WWNN(node_name) получены. Определяем соответствие между SCSI HBTL адресами и дисками. В RHEL/CentOS/Fedora нужен пакет sg3_utils.

# sg_map -x
Device /dev/nst18 is busy
/dev/sg0 1 0 0 0 0 /dev/sda
/dev/sg1 1 0 0 1 0 /dev/sdb
/dev/sg2 1 0 0 2 0 /dev/sdc
/dev/sg3 1 0 0 3 0 /dev/sdd
/dev/sg4 1 0 1 0 0 /dev/sde
/dev/sg5 1 0 1 1 0 /dev/sdf
/dev/sg6 1 0 1 2 0 /dev/sdg
/dev/sg7 1 0 1 3 0 /dev/sdh
/dev/sg8 1 0 2 0 8
/dev/sg9 1 0 3 0 1 /dev/nst0
/dev/sg10 1 0 4 0 1 /dev/nst1
/dev/sg11 1 0 5 0 1 /dev/nst2
/dev/sg12 1 0 6 0 1 /dev/nst3
/dev/sg13 1 0 7 0 1 /dev/nst4
/dev/sg14 1 0 8 0 1 /dev/nst5
/dev/sg15 1 0 9 0 1 /dev/nst6
/dev/sg16 1 0 10 0 1 /dev/nst7
/dev/sg17 1 0 11 0 1 /dev/nst8
/dev/sg18 1 0 12 0 1 /dev/nst9
/dev/sg19 1 0 13 0 1 /dev/nst10
/dev/sg20 1 0 14 0 1 /dev/nst11
/dev/sg21 2 0 0 0 0 /dev/sdi
/dev/sg22 2 0 0 1 0 /dev/sdj
/dev/sg23 2 0 0 2 0 /dev/sdk
/dev/sg24 2 0 0 3 0 /dev/sdl
/dev/sg25 2 0 1 0 0 /dev/sdm
/dev/sg26 2 0 1 1 0 /dev/sdn
/dev/sg27 2 0 1 2 0 /dev/sdo

Читайте также:  Install powershell to linux

Источник

Вики IT-KB

Как идентифицировать контроллеры FC HBA в CentOS Linux

Для того, чтобы получить информацию о том, какие Fibre Channel контроллеры установлены сервере с ОС CentOS, существует целый ряд способов.

Способ №1. Утилита lspci

# lspci -nn | grep -i hba 0b:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA [1077:2432] (rev 03) 0b:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA [1077:2432] (rev 03)

Способ №2. Информация в /sys/class/fc_host/

# ls -l /sys/class/fc_host lrwxrwxrwx. 1 root root 0 May 30 16:13 host2 -> ../../devices/pci0000:00/. /fc_host/host2 lrwxrwxrwx. 1 root root 0 May 30 16:13 host3 -> ../../devices/pci0000:00/. /fc_host/host3

Например, чтобы получить состояние (online/offline) каждого порта:

# more /sys/class/fc_host/host?/port_state . /sys/class/fc_host/host2/port_state . Online . /sys/class/fc_host/host3/port_state . Online

Другой пример. Получим информацию об идентификаторах WWN портов:

tag># more /sys/class/fc_host/host?/port_name . /sys/class/fc_host/host2/port_name . 0x500148800400c204 . /sys/class/fc_host/host3/port_name . 0x500148800400c206

Способ №3. Утилита systool

Утилита systool входит в пакет sysfsutils. Чтобы его установить на CentOS, выполните:

Пример подробного вывода информации по конкретному FC порту:

# systool -c fc_host -v Class = "fc_host" Class Device = "host2" Class Device path = "/sys/devices/pci0000:00/. /host2/fc_host/host2" dev_loss_tmo = "16" fabric_name = "0x100000051e04e030" issue_lip = max_npiv_vports = "127" node_name = "0x500148800400c205" npiv_vports_inuse = "0" port_id = "0xc91800" port_name = "0x500148800400c204" 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 = "HPAE312A FW:v7.03.00 DVR:v8.07.00.29.07.0-k1" system_hostname = "" tgtid_bind_type = "wwpn (World Wide Port Name)" uevent = vport_create = vport_delete = Device = "host2" Device path = "/sys/devices/pci0000:00/. /0000:0b:00.0/host2" fw_dump = nvram = "ISP " optrom_ctl = optrom = reset = sfp = "" uevent = "DEVTYPE=scsi_host" vpd = "▒+" .

Дополнительные источники информации

Автор первичной редакции:
Алексей Максимов
Время публикации: 01.06.2016 15:04

Источник

How to find HBA details and WWN in Solaris and Linux

How to find HBA Details & WWN in Solaris & RHEL

There may be situation you need to get WWN number from Solaris or RHEL Servers. It may be because you may have request to extend file system running on veritas or under LVM and you need to place request for storage team to provide storage as per your requirement.This tutorial is about how to find hba details and wwn in solaris and linux.

Читайте также:  Централизованное резервное копирование linux

Solution

1. Finding Details about HBA

First of all you just need to verify if server already have storage card installed on it. Considering the facts here that storage card is already installed on it.But in any case you can validate that storage card is already installed on it. Mostly used cards are either from Emulex or qlc .These cards are named as HBA [Host Bus Adaptors].

For Solaris

You can use prtdiag or luxadm to get details about installed HBA.

1. # luxadm -e port 
CONNECTED/devices/[email protected],0/[email protected],600000/SUNW,[email protected]/[email protected],0:devctl
CONNECTED/devices/[email protected],0/[email protected],600000/SUNW,[email protected],1/[email protected],0:devctl
CONNECTED/devices/[email protected],0/[email protected],600000/SUNW,[email protected]/[email protected],0:devctl
CONNECTED/devices/[email protected],0/[email protected],600000/SUNW,[email protected],1/[email protected],0:devctl
2. # prtdiag –v 
Below is truncated output ,you need to focus on IO Card configurations .
========================= IO Cards ========================= Bus Max IO Port Bus Freq Bus Dev,Brd Type ID Side Slot MHz Freq Func State
Name Model---- ---- ---- ---- ---- ---- ---- ---- ----- -------------------------------- ----------------------I/O PCI 8 B 4 33 33 1,0 ok pci-pci1011,26.5/SUNW,qlc (scsi-+ PCI-BRIDGEI/O PCI 8 B 4 33 33 4,0 ok SUNW,qlc-pci1077,2200.1077.4083.+ device on pci-bridgeI/O PCI 8 A 1 66 66 1,0
ok SUNW,emlxs-pci10df,fc00/fp (fp) LP10000DC-SI/O PCI 8 A 1 66 66 1,1 ok SUNW,emlxs-pci10df,fc00/fp (fp) LP10000DC-S
For Linux 
lspci or dmesg cab be used to get details about installed HBA.
1. # lspci |egrep “Emulex|qlc”
2. # dmesg |egrep “Emulex|qlc”

2. Finding WWN for Solaris/RHEL

For Solaris
1. fcinfo internal solaris command can help to get WWN.
[[email protected]]# fcinfo hba-port
HBA Port WWN: 10000000c9c1852a
OS Device Name: /dev/cfg/c2
Manufacturer: Emulex
Model: LPe12000-S
Firmware Version: 2.01a10 (U3D2.01A10)
FCode/BIOS Version: Boot:5.03a0 Fcode:3.01a1
Serial Number: 4925383+144400D4F3
Driver Name: emlxs
Driver Version: 3.0.05.0 (2015.09.16.13.00)
Type: N-port
State: online
Supported Speeds: 2Gb 4Gb 8Gb
Current Speed: 8Gb
Node WWN: 20000000c9c1852a
HBA Port WWN: 10000000c9c17ea6
OS Device Name: /dev/cfg/c3
Manufacturer: Emulex
Model: LPe12000-S
Firmware Version: 2.01a10 (U3D2.01A10)
FCode/BIOS Version: Boot:5.03a0 Fcode:3.01a1
Serial Number: 4925383+144400D4F5
Driver Name: emlxs
Driver Version: 3.0.05.0 (2015.09.16.13.00)
Type: N-port
State: online
Supported Speeds: 2Gb 4Gb 8Gb
Current Speed: 8Gb
Node WWN: 20000000c9c17ea6
[[email protected]]#
[[email protected]]# prtconf -vp |grep -i WWN
port_wwn: 10000000.c9c1852a
node_wwn: 20000000.c9c1852a
port_wwn: 10000000.c9c17ea6
node_wwn: 20000000.c9c17ea6

3. luxadm is useful in getting WWN on Solaris Servers.

[[email protected]]# luxadm -e port
/devices/pci@8000/[email protected]/[email protected]/[email protected]/SUNW,[email protected]/[email protected],0:devctl CONNECTED
/devices/pci@8100/[email protected]/[email protected]/[email protected]/SUNW,[email protected]/[email protected],0:devctl CONNECTED
[[email protected]]# luxadm -e dump_map /devices/[email protected]/[email protected]/[email protected]/[email protected]/SUNW,[email protected]/[email protected],0:devctl
Pos Port_ID Hard_Addr Port WWN Node WWN Type
0 155200 0 50060e8007dd6c68 50060e8007dd6c68 0x0 (Disk device)
1 151700 0 10000000c9c1852a 20000000c9c1852a 0x1f (Unknown Type,Host Bus Adapter)
4. syminq is handy to get WWN if your system have SYMCLI installed.
# syminq hba

For RHEL

1. hbacmd command can be used to get WWN. It will work if hbanyware package is installed on server.

[[email protected]]# /usr/sbin/hbanyware/hbacmd listHBAs
Manageable HBA List
Port WWN : 10:00:00:00:c9:b0:55:2e
Node WWN : 20:00:00:00:c9:b0:55:2e
Fabric Name: 10:00:50:eb:1a:5f:c7:0c
Flags : 8000fe00
Host Name : server
Mfg : Emulex Corporation
Serial No. : BT01474056
Port Number: n/a
Mode : Initiator
Port WWN : 10:00:00:00:c9:b0:51:32
Node WWN : 20:00:00:00:c9:b0:51:32
Fabric Name: 10:00:50:eb:1a:5f:bd:0c
Flags : 8000fe00
Host Name : server
Mfg : Emulex Corporation
Serial No. : BT01472998
Port Number: n/a
Mode : Initiator
[[email protected]]#

2. port_name file can be used to get WWN from most of the RHEL servers.

[[email protected]]# cat /sys/class/fc_host/host*/port_name

0x10000000c9b0552e

0x10000000c9b05132

3. syminq can be used for RHEL as well as Solaris in getting WWN in case if SYMCLI installed .Mostly worked with EMC storage environment where SYMCLI is installed with PowerPath.

[[email protected]]# syminq hba
Host Name : server
HBA Type : FibreChannel
HBA Name : Emulex-LPe11000-E-2
Vendor : Emulex Corporation
Model : LPe11000-E
Serial Number : BT01473025
Firmware Version : 2.72A2 (Z3D2.72A2), sli-3
Driver Version : 8.2.0.63.3p; HBAAPI(I) v2.1.g, 12-07-07

Node WWN : 20000000c9b0513a
Number of Ports : 1
Port WWN : 10000000c9b0513a
Port name : /sys/class/scsi_host/host3
Port type : NPort
Port FCID : 2764032
Port speed : 4gbit
Supported speed : 4gbit
Port state : Online
Supported COS : 00000008
Supported FC4 types : 0000010000000001000000000000000000000000000000000000000000000000
Active FC4 types : 0000010000000001000000000000000000000000000000000000000000000000
Max frame size : 2048

I hope this will be helpful to find HBA details and WWN on Solaris and RHEL if Emulex or QLC HBA is used. It will be effective in most of the cases but not all. We will be really glad to know if it is found useful to you and request you to share with your team and friends which might help them as well if sounds OK.

Читайте также:  Linux iscsi multipath настройка

Источник

Оцените статью
Adblock
detector