Fibrechannel Analyse: Difference between revisions

From Lolly's Wiki
Jump to navigationJump to search
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
Line 9: Line 9:
===luxadm -e port===
===luxadm -e port===
Gibt die Hardwarepfade der vorhandened Fibrechannelports und deren Status aus:
Gibt die Hardwarepfade der vorhandened Fibrechannelports und deren Status aus:
<source lang=bash>
<syntaxhighlight lang=bash>
# luxadm -e port
# luxadm -e port
/devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl        CONNECTED
/devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl        CONNECTED
Line 20: Line 20:
  /devices/pci@79,0/pci10de,376@e/pci1077,143@0 und ...,1
  /devices/pci@79,0/pci10de,376@e/pci1077,143@0 und ...,1


<source lang=bash>
<syntaxhighlight lang=bash>
# prtdiag -v | head -1
# prtdiag -v | head -1
System Configuration: Sun Microsystems    Sun Fire X4440
System Configuration: Sun Microsystems    Sun Fire X4440
Line 41: Line 41:
===luxadm -e dump_map <HW_path>===
===luxadm -e dump_map <HW_path>===
Gibt die Tabelle der bekannten Geräte an einem Port aus
Gibt die Tabelle der bekannten Geräte an einem Port aus
<source lang=bash>
<syntaxhighlight lang=bash>
# luxadm -e dump_map /devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl
# luxadm -e dump_map /devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl
Pos  Port_ID Hard_Addr Port WWN        Node WWN        Type
Pos  Port_ID Hard_Addr Port WWN        Node WWN        Type
Line 82: Line 82:


===luxadm -e rdls <HW_path> ===
===luxadm -e rdls <HW_path> ===
<source lang=bash>
<syntaxhighlight lang=bash>
# luxadm -e port 2>/dev/null | awk '{print $1;}' | xargs -n 1 luxadm -e rdls 2>/dev/null
# luxadm -e port 2>/dev/null | awk '{print $1;}' | xargs -n 1 luxadm -e rdls 2>/dev/null


Line 104: Line 104:
===luxadm probe===
===luxadm probe===
Auflistung aller erkannten Fibrechanneldevices
Auflistung aller erkannten Fibrechanneldevices
<source lang=bash>
<syntaxhighlight lang=bash>
#> luxadm probe
#> luxadm probe


Line 114: Line 114:


===luxadm display <Diskpath|WWN>===
===luxadm display <Diskpath|WWN>===
<source lang=bash>
<syntaxhighlight lang=bash>
#>  luxadm display /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2
#>  luxadm display /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2
Line 175: Line 175:


Zuweisung Controller zum FC-Port über:
Zuweisung Controller zum FC-Port über:
<source lang=bash>
<syntaxhighlight lang=bash>
# ls -al /dev/cfg/c6
# ls -al /dev/cfg/c6
lrwxrwxrwx  1 root    root          60 Sep  3  2009 /dev/cfg/c6 -> ../../devices/pci@79,0/pci10de,376@e/pci1077,143@0/fp@0,0:fc
lrwxrwxrwx  1 root    root          60 Sep  3  2009 /dev/cfg/c6 -> ../../devices/pci@79,0/pci10de,376@e/pci1077,143@0/fp@0,0:fc
Line 187: Line 187:
===fcinfo hba-port===
===fcinfo hba-port===
Gibt ein paar Infos über Hersteller, Modell, Firmware, Port und Node WWN, Current Speed, ... aus
Gibt ein paar Infos über Hersteller, Modell, Firmware, Port und Node WWN, Current Speed, ... aus
<source lang=bash>
<syntaxhighlight lang=bash>
#> fcinfo hba-port
#> fcinfo hba-port
HBA Port WWN: 2100001b328a417f
HBA Port WWN: 2100001b328a417f
Line 247: Line 247:
</source>
</source>
===fcinfo remote-port --port <HBA Port WWN> --linkstat===
===fcinfo remote-port --port <HBA Port WWN> --linkstat===
<source lang=bash>
<syntaxhighlight lang=bash>
# fcinfo remote-port --port 2100001b32904445 --linkstat
# fcinfo remote-port --port 2100001b32904445 --linkstat
Remote Port WWN: 201600a0b86e103c
Remote Port WWN: 201600a0b86e103c
Line 339: Line 339:
</source>
</source>
===fcinfo remote-port --port <HBA Port WWN> --scsi-target===
===fcinfo remote-port --port <HBA Port WWN> --scsi-target===
<source lang=bash>
<syntaxhighlight lang=bash>
# fcinfo hba-port | grep HBA
# fcinfo hba-port | grep HBA
HBA Port WWN: 21000024ff3cf472
HBA Port WWN: 21000024ff3cf472
Line 366: Line 366:
</source>
</source>
===fcinfo lu -v <device>===
===fcinfo lu -v <device>===
<source lang=bash>
<syntaxhighlight lang=bash>
# fcinfo lu -v /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2
# fcinfo lu -v /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2
OS Device Name: /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2
OS Device Name: /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2
Line 393: Line 393:
==mpathadm==
==mpathadm==
===mpathadm list lu===
===mpathadm list lu===
<source lang=bash>
<syntaxhighlight lang=bash>
</source>
</source>
==cfgadm==
==cfgadm==
===cfgadm -al -o show_FCP_dev [<controller>]===
===cfgadm -al -o show_FCP_dev [<controller>]===
<source lang=bash>
<syntaxhighlight lang=bash>
# cfgadm -al -o show_FCP_dev  | grep unusable
# cfgadm -al -o show_FCP_dev  | grep unusable
c8::21000024ff2d49a2,0        disk        connected    configured  unusable
c8::21000024ff2d49a2,0        disk        connected    configured  unusable
Line 417: Line 417:


===cfgadm -c unconfigure -o unusable_SCSI_LUN <unusable device>===
===cfgadm -c unconfigure -o unusable_SCSI_LUN <unusable device>===
<source lang=bash>
<syntaxhighlight lang=bash>
# cfgadm -c unconfigure -o unusable_SCSI_LUN c8::21000024ff2d49a2
# cfgadm -c unconfigure -o unusable_SCSI_LUN c8::21000024ff2d49a2
</source>
</source>


Alle aufräumen:
Alle aufräumen:
<source lang=bash>
<syntaxhighlight lang=bash>
# cfgadm -alo show_SCSI_LUN | nawk '$NF=="unusable"{gsub(/,[0-9]+$/,"",$1);print $1}' | sort -u | xargs -n 1 cfgadm -c unconfigure -o unusable_SCSI_LUN
# cfgadm -alo show_SCSI_LUN | nawk '$NF=="unusable"{gsub(/,[0-9]+$/,"",$1);print $1}' | sort -u | xargs -n 1 cfgadm -c unconfigure -o unusable_SCSI_LUN
</source>
</source>
Line 428: Line 428:
===cfgadm -o force_update -c configure <controller>===
===cfgadm -o force_update -c configure <controller>===
Rescan LUNs. Be careful! Does a forcelip!
Rescan LUNs. Be careful! Does a forcelip!
<source lang=bash>
<syntaxhighlight lang=bash>
# cfgadm -o force_update -c configure c10
# cfgadm -o force_update -c configure c10
</source>
</source>
Line 434: Line 434:


==prtconf -Da <device>==
==prtconf -Da <device>==
<source lang=bash>
<syntaxhighlight lang=bash>
# prtconf -Da /dev/cfg/c3  
# prtconf -Da /dev/cfg/c3  
i86pc (driver name: rootnex)
i86pc (driver name: rootnex)
Line 447: Line 447:


==LUN masking (access LUNs of a storage)==
==LUN masking (access LUNs of a storage)==
<source lang=bash>
<syntaxhighlight lang=bash>
Nov  6 13:44:59 server01        Corrupt label; wrong magic number
Nov  6 13:44:59 server01        Corrupt label; wrong magic number
Nov  6 13:44:59 server01 cmlb: WARNING: /pci@380/pci@1/pci@0/pci@5/SUNW,qlc@0/fp@0,0/ssd@w204300a096691217,7 (ssd7):
Nov  6 13:44:59 server01 cmlb: WARNING: /pci@380/pci@1/pci@0/pci@5/SUNW,qlc@0/fp@0,0/ssd@w204300a096691217,7 (ssd7):
Line 458: Line 458:
</source>
</source>


<source lang=bash>
<syntaxhighlight lang=bash>
# cat /etc/driver/drv/fp.conf
# cat /etc/driver/drv/fp.conf
mpxio-disable="no";
mpxio-disable="no";
Line 472: Line 472:
</source>
</source>


<source lang=bash>
<syntaxhighlight lang=bash>
# reboot -- -r
# reboot -- -r
...
...
Line 502: Line 502:
Ist unter Solaris in /opt/SUNWsefms/bin
Ist unter Solaris in /opt/SUNWsefms/bin
===lsscs list array===
===lsscs list array===
<source lang=bash>
<syntaxhighlight lang=bash>
</source>
</source>
===lsscs list array <array_name>===
===lsscs list array <array_name>===
<source lang=bash>
<syntaxhighlight lang=bash>
</source>
</source>
===lsscs list -a <array_name> fcport===
===lsscs list -a <array_name> fcport===
<source lang=bash>
<syntaxhighlight lang=bash>
</source>
</source>


Line 515: Line 515:
===switchshow===
===switchshow===


<source lang=bash>
<syntaxhighlight lang=bash>
san-sw_11:admin> switchshow
san-sw_11:admin> switchshow
switchName: san-sw_11
switchName: san-sw_11
Line 566: Line 566:


===fabricshow===
===fabricshow===
<source lang=bash>
<syntaxhighlight lang=bash>
san-sw_11:root> fabricshow
san-sw_11:root> fabricshow
Switch ID  Worldwide Name          Enet IP Addr    FC IP Addr      Name
Switch ID  Worldwide Name          Enet IP Addr    FC IP Addr      Name
Line 576: Line 576:
</source>
</source>
===islshow===
===islshow===
<source lang=bash>
<syntaxhighlight lang=bash>
rz1_fab2_11:admin> islshow  
rz1_fab2_11:admin> islshow  
   1:  1->  0 10:00:00:05:1e:0d:5e:96  12 bc1_sl4_fab2_12 sp:  4.000G bw:  4.000G  
   1:  1->  0 10:00:00:05:1e:0d:5e:96  12 bc1_sl4_fab2_12 sp:  4.000G bw:  4.000G  
Line 595: Line 595:
Show information about NPIV-ports.
Show information about NPIV-ports.


<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:admin> switchshow       
fcsw1:admin> switchshow       
...
...
Line 605: Line 605:
</source>
</source>
This is a NetApp 8080 with CDOT behind this port as you can see with <i>nodefind <address></i>
This is a NetApp 8080 with CDOT behind this port as you can see with <i>nodefind <address></i>
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:admin> nodefind 0f2200
fcsw1:admin> nodefind 0f2200
Local:
Local:
Line 625: Line 625:


Now look with <i>portloginshow <portnumber></i>:
Now look with <i>portloginshow <portnumber></i>:
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:admin> portloginshow 34     
fcsw1:admin> portloginshow 34     
Type  PID    World Wide Name        credit df_sz cos
Type  PID    World Wide Name        credit df_sz cos
Line 636: Line 636:


With this information you can find out more about the WWNs:
With this information you can find out more about the WWNs:
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:admin> nodefind 20:00:00:a0:98:5d:33:82
fcsw1:admin> nodefind 20:00:00:a0:98:5d:33:82
Local:
Local:
Line 659: Line 659:


And with the NodeName you can find all logical interfaces of this svm:
And with the NodeName you can find all logical interfaces of this svm:
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:admin> nodefind 20:04:00:a0:98:5d:33:82
fcsw1:admin> nodefind 20:04:00:a0:98:5d:33:82
Local:
Local:
Line 700: Line 700:
==Backup der Switchconfig per Script==
==Backup der Switchconfig per Script==
===Put the backup host ssh-pub-key on the switches===
===Put the backup host ssh-pub-key on the switches===
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:root> cat >/root/.ssh/authorized_keys <<EOF
fcsw1:root> cat >/root/.ssh/authorized_keys <<EOF
> ssh-dss AAAAB3NzaC1...
> ssh-dss AAAAB3NzaC1...
Line 710: Line 710:


===Generate ssh-key on the switches===
===Generate ssh-key on the switches===
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:root> ssh-keygen   
fcsw1:root> ssh-keygen   
Generating public/private rsa key pair.
Generating public/private rsa key pair.
Line 728: Line 728:
</source>
</source>
===Copy the key to your backup users ~/.ssh/authorized_keys on backup host===
===Copy the key to your backup users ~/.ssh/authorized_keys on backup host===
<source lang=bash>
<syntaxhighlight lang=bash>
fcsw1:root> cat /root/.ssh/id_rsa.pub
fcsw1:root> cat /root/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAA...
ssh-rsa AAAAB3NzaC1yc2EAAA...
Line 735: Line 735:
</source>
</source>
===Now the script on the backup host===
===Now the script on the backup host===
<source lang=bash>
<syntaxhighlight lang=bash>
# cat /opt/bin/backup_brocade_config  
# cat /opt/bin/backup_brocade_config  
#!/bin/bash
#!/bin/bash
Line 754: Line 754:


==Script zum parsen einer configupload-Datei==
==Script zum parsen einer configupload-Datei==
<source lang=awk>
<syntaxhighlight lang=awk>
#!/usr/bin/gawk -f
#!/usr/bin/gawk -f
BEGIN{
BEGIN{
Line 846: Line 846:
=Kommandos: NetApp=
=Kommandos: NetApp=
==fcp topology show : Wo hängt mein Frontend-SAN?==
==fcp topology show : Wo hängt mein Frontend-SAN?==
<source lang=bash>
<syntaxhighlight lang=bash>
fas01> fcp topology show
fas01> fcp topology show
Switches connected on adapter 0d:
Switches connected on adapter 0d:
Line 880: Line 880:


==fcp config <port> : Welche WWN habe ich?==
==fcp config <port> : Welche WWN habe ich?==
<source lang=bash>
<syntaxhighlight lang=bash>
fas01> fcp config 1a     
fas01> fcp config 1a     
1a:  ONLINE <ADAPTER UP>  PTP  Fabric   
1a:  ONLINE <ADAPTER UP>  PTP  Fabric   
Line 890: Line 890:


==fcp wwpn-alias (set|show) : Aliasnamen für mehr Klarheit beim Debugging==
==fcp wwpn-alias (set|show) : Aliasnamen für mehr Klarheit beim Debugging==
<source lang=bash>
<syntaxhighlight lang=bash>
fas01> fcp wwpn-alias set sun07_Slot2_Port0  21000024ff363a5a
fas01> fcp wwpn-alias set sun07_Slot2_Port0  21000024ff363a5a
fas01> fcp wwpn-alias show                                       
fas01> fcp wwpn-alias show                                       
Line 902: Line 902:
Wenn man wissen möchte, welche NetApp LUNs zu einem ZPool gehören, geht das folgender Maßen:
Wenn man wissen möchte, welche NetApp LUNs zu einem ZPool gehören, geht das folgender Maßen:


<source lang=bash>
<syntaxhighlight lang=bash>
# zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'
# zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'
</source>
</source>
Beispiel:
Beispiel:
<source lang=bash>
<syntaxhighlight lang=bash>
# zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'
# zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'
   Pool: testpool
   Pool: testpool
Line 923: Line 923:
==Alle WWNs in einem File finden==
==Alle WWNs in einem File finden==
Gibt nur die WWNs aus, auch mehrere, wenn mehrere in einer Zeile sind.
Gibt nur die WWNs aus, auch mehrere, wenn mehrere in einer Zeile sind.
<source lang=awk>
<syntaxhighlight lang=awk>
gawk '{line=$0;while(match(line,/[0-9a-f]{2}(:[0-9a-f]{2}){7}/,wwn)){line=substr(line,wwn[0,"start"]+wwn[0,"length"]); print wwn[0];}}' <file>
gawk '{line=$0;while(match(line,/[0-9a-f]{2}(:[0-9a-f]{2}){7}/,wwn)){line=substr(line,wwn[0,"start"]+wwn[0,"length"]); print wwn[0];}}' <file>
</source>
</source>


==Some adittions to NetApps sanlun lun show on Solaris==
==Some adittions to NetApps sanlun lun show on Solaris==
<source lang=awk>
<syntaxhighlight lang=awk>
# /opt/NTAP/SANToolkit/bin/sanlun lun show | gawk '
# /opt/NTAP/SANToolkit/bin/sanlun lun show | gawk '
$3 ~ /\/dev\// {
$3 ~ /\/dev\// {

Revision as of 15:22, 25 November 2021

Fibrechannel Analyse

Kommandos : Solaris

luxadm

luxadm -e port

Gibt die Hardwarepfade der vorhandened Fibrechannelports und deren Status aus: <syntaxhighlight lang=bash>

  1. luxadm -e port

/devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl CONNECTED /devices/pci@79,0/pci10de,378@b/pci1077,143@0,1/fp@0,0:devctl NOT CONNECTED /devices/pci@79,0/pci10de,376@e/pci1077,143@0/fp@0,0:devctl CONNECTED /devices/pci@79,0/pci10de,376@e/pci1077,143@0,1/fp@0,0:devctl NOT CONNECTED </source>

2 Dualport Karten:
/devices/pci@79,0/pci10de,378@b/pci1077,143@0 und ...,1
/devices/pci@79,0/pci10de,376@e/pci1077,143@0 und ...,1

<syntaxhighlight lang=bash>

  1. prtdiag -v | head -1

System Configuration: Sun Microsystems Sun Fire X4440 </source>

Aus der Seite Sun x86 Platforms: Matrix of Recognized Device Paths (Doc ID 1277396.1) (Oracle Support Login benötigt):

Sun Fire x4440 (Tucana)
PCI:
PCIe SLOT0         /pci@0,0/pci10de,375@f/pci1000,3150@0 // with PCI Express 8-Port SAS/SATA HBA
PCIe SLOT0         /pci@0,0/pci10de,375@f/               // without PCI Express 8-Port SAS/SATA HBA
PCIe SLOT1         /pci@0,0/pci10de,376@e/
PCIe SLOT2         /pci@7c,0/pci10de,377@f/
PCIe SLOT3         /pci@0,0/pci10de,377@a/
PCIe SLOT4         /pci@7c,0/pci10de,376@e/
PCIe SLOT5         /pci@7c,0/pci10de,378@b/
(7c can be renamed something else depending on BIOS/OS version)

Also stecken unsere Karten in Slot 4 und 5.

luxadm -e dump_map <HW_path>

Gibt die Tabelle der bekannten Geräte an einem Port aus <syntaxhighlight lang=bash>

  1. luxadm -e dump_map /devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl

Pos Port_ID Hard_Addr Port WWN Node WWN Type 0 30200 0 202600a0b86e10e4 200600a0b86e10e4 0x0 (Disk device) 1 30600 0 202700a0b86e10e4 200600a0b86e10e4 0x0 (Disk device) 2 10100 0 203400a0b85bb030 200400a0b85bb030 0x0 (Disk device) 3 10500 0 203500a0b85bb030 200400a0b85bb030 0x0 (Disk device) 4 10200 0 202600a0b86e103c 200600a0b86e103c 0x0 (Disk device) 5 11400 0 202700a0b86e103c 200600a0b86e103c 0x0 (Disk device) 6 30100 0 203200a0b85aeb2d 200200a0b85aeb2d 0x0 (Disk device) 7 30500 0 203300a0b85aeb2d 200200a0b85aeb2d 0x0 (Disk device) 8 10800 0 2100001b32902d45 2000001b32902d45 0x1f (Unknown Type,Host Bus Adapter) </source> Erklärung der interessanten Spalten:

  • Port_ID <Switch_ID><Switchport><??>
Es sind also offensichtlich 2 Switches in der Fabric an Port /devices/pci@79,0/pci10de,378@b/pci1077,143@0/fp@0,0:devctl
und zwar mit der ID 1 und mit der ID 3.
Switch ID 1
 Port 1 und  5 : Node WWN 200400a0b85bb030
 Port 2 und 14 : Node WWN 200600a0b86e103c
 Port 8        : Node WWN 2000001b32902d45 (Wir selbst)
Switch ID 3
 Port 1 und  5 : Node WWN 200200a0b85aeb2d
 Port 2 und  6 : Node WWN 200600a0b86e10e4 

Wir hängen also mit 2 Storages auf dem Switch mit der ID 1 und haben eine Verbindung zu einem Switch mit der ID 3 an dem 2 weitere Storages hängen.
  
  • Node WWN
Wir sehen hier 4 Disk Devices mit jeweils 2 Einträgen (Gleiche Node WWN)
  • Port WWN
Dies ist die Port WWN der an den Switch angeschlossenen Geräte (unter 8 finden wir uns selbst).
Pro Storage sehen wir hier 2 Port WWNs, also 2 Pfade über unseren einen Hostport.

Daher nachher 4 Pfade (2 Pro Hostport) beim #mpathadm list lu.

  • Type
Disk Device: Storage
Host Bus Adapter: FC-Karte

luxadm -e rdls <HW_path>

<syntaxhighlight lang=bash>

  1. luxadm -e port 2>/dev/null | awk '{print $1;}' | xargs -n 1 luxadm -e rdls 2>/dev/null

Link Error Status information for loop:/devices/pci@0,0/pci8086,340e@7/pci111d,806e@0/pci111d,806e@2/pci1077,143@0/fp@0,0:devctl al_pa lnk fail sync loss signal loss sequence err invalid word CRC 30200 2 1 0 0 0 0 30600 2 1 0 0 0 0 10200 1 1 0 0 0 0 11400 2 1 0 0 0 0 10b00 0 0 0 0 0 0 NOTE: These LESB counts are not cleared by a reset, only power cycles. These counts must be compared to previously read counts.

Link Error Status information for loop:/devices/pci@0,0/pci8086,340e@7/pci111d,806e@0/pci111d,806e@2/pci1077,143@0,1/fp@0,0:devctl al_pa lnk fail sync loss signal loss sequence err invalid word CRC 0 0 0 0 0 0 0 NOTE: These LESB counts are not cleared by a reset, only power cycles. These counts must be compared to previously read counts. </source>

luxadm probe

Auflistung aller erkannten Fibrechanneldevices <syntaxhighlight lang=bash>

  1. > luxadm probe

Found Fibre Channel device(s):

 Node WWN:200600a0b86e10e4  Device Type:Disk device
   Logical Path:/dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2

... </source>

luxadm display <Diskpath|WWN>

<syntaxhighlight lang=bash>

  1. > luxadm display /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2

DEVICE PROPERTIES for disk: /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2

 Vendor:               SUN
 Product ID:           STK6580_6780
 Revision:             0784
 Serial Num:           SP01068442
 Unformatted capacity: 204800.000 MBytes
 Write Cache:          Enabled
 Read Cache:           Enabled
   Minimum prefetch:   0x300
   Maximum prefetch:   0x0
 Device Type:          Disk device
 Path(s):
 /dev/rdsk/c8t600A0B80006E10E40000DC1C52E8B751d0s2
 /devices/scsi_vhci/disk@g600a0b80006e10e40000dc1c52e8b751:c,raw
  Controller           /dev/cfg/c4
   Device Address              202600a0b86e10e4,5
   Host controller port WWN    2100001b328a417f
   Class                       primary
   State                       ONLINE
  Controller           /dev/cfg/c4
   Device Address              202700a0b86e10e4,5
   Host controller port WWN    2100001b328a417f
   Class                       secondary
   State                       STANDBY
  Controller           /dev/cfg/c6
   Device Address              201600a0b86e10e4,5
   Host controller port WWN    2100001b32904445
   Class                       primary
   State                       ONLINE
  Controller           /dev/cfg/c6
   Device Address              201700a0b86e10e4,5
   Host controller port WWN    2100001b32904445
   Class                       secondary
   State                       STANDBY

</source>

  • Vendor: SUN
Hersteller
  • Product ID: STK6580_6780
Also ein StorageTek 6580/6780
  • Revision: 0784
Grobe Firmwarepeilung (Firmware Version: 07.84.47.10)

Siehe hier #lsscs list array <array_name>

  • Serial Num: SP01068442
Praktisch, wenn man mit NetApps arbeitet, um die LUNs zuzuordnen.
  • Unformatted capacity: 204800.000 MBytes
Immer gut zu wissen
  • Write Cache: Enabled
Die Batterie im Storage sollte also OK sein ;-)
  • Path(s):
Rawdevicepath
Hardwaredevicepath
Jetzt folgen immer pro Pfad zu diesem Device ein Block aus
 Controller      (siehe unten)
 Device Address  <Port WWN vom Device>,<LUN ID>
 Class           <primary|secondary> (siehe unten)
 State           <Online|Standby|Oflline>

Zuweisung Controller zum FC-Port über: <syntaxhighlight lang=bash>

  1. ls -al /dev/cfg/c6

lrwxrwxrwx 1 root root 60 Sep 3 2009 /dev/cfg/c6 -> ../../devices/pci@79,0/pci10de,376@e/pci1077,143@0/fp@0,0:fc </source> Man sieht den Hardwarepfad von #luxadm -e port

Class:

Via ALUA (Asymmetric Logical Unit Access) teilt das Device dem Host mit, über welche Pfade der Host primär auf die LUN zugreifen soll.

fcinfo

fcinfo hba-port

Gibt ein paar Infos über Hersteller, Modell, Firmware, Port und Node WWN, Current Speed, ... aus <syntaxhighlight lang=bash>

  1. > fcinfo hba-port

HBA Port WWN: 2100001b328a417f

       OS Device Name: /dev/cfg/c4
       Manufacturer: QLogic Corp.
       Model: 375-3356-02
       Firmware Version: 05.06.00
       FCode/BIOS Version:  BIOS: 2.02; fcode: 2.01; EFI: 2.00;
       Serial Number: 0402R00-0918701860
       Driver Name: qlc
       Driver Version: 20110825-3.06
       Type: N-port
       State: online
       Supported Speeds: 1Gb 2Gb 4Gb
       Current Speed: 4Gb
       Node WWN: 2000001b328a417f

HBA Port WWN: 2101001b32aa417f

       OS Device Name: /dev/cfg/c5
       Manufacturer: QLogic Corp.
       Model: 375-3356-02
       Firmware Version: 05.06.00
       FCode/BIOS Version:  BIOS: 2.02; fcode: 2.01; EFI: 2.00;
       Serial Number: 0402R00-0918701860
       Driver Name: qlc
       Driver Version: 20110825-3.06
       Type: unknown
       State: offline
       Supported Speeds: 1Gb 2Gb 4Gb
       Current Speed: not established
       Node WWN: 2001001b32aa417f

HBA Port WWN: 2100001b32904445

       OS Device Name: /dev/cfg/c6
       Manufacturer: QLogic Corp.
       Model: 375-3356-02
       Firmware Version: 05.06.00
       FCode/BIOS Version:  BIOS: 2.02; fcode: 2.01; EFI: 2.00;
       Serial Number: 0402R00-0918701887
       Driver Name: qlc
       Driver Version: 20110825-3.06
       Type: N-port
       State: online
       Supported Speeds: 1Gb 2Gb 4Gb
       Current Speed: 4Gb
       Node WWN: 2000001b32904445

HBA Port WWN: 2101001b32b04445

       OS Device Name: /dev/cfg/c7
       Manufacturer: QLogic Corp.
       Model: 375-3356-02
       Firmware Version: 05.06.00
       FCode/BIOS Version:  BIOS: 2.02; fcode: 2.01; EFI: 2.00;
       Serial Number: 0402R00-0918701887
       Driver Name: qlc
       Driver Version: 20110825-3.06
       Type: unknown
       State: offline
       Supported Speeds: 1Gb 2Gb 4Gb
       Current Speed: not established
       Node WWN: 2001001b32b04445

</source>

fcinfo remote-port --port <HBA Port WWN> --linkstat

<syntaxhighlight lang=bash>

  1. fcinfo remote-port --port 2100001b32904445 --linkstat

Remote Port WWN: 201600a0b86e103c

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200600a0b86e103c
       Link Error Statistics:
               Link Failure Count: 3
               Loss of Sync Count: 3
               Loss of Signal Count: 2
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 201700a0b86e103c

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200600a0b86e103c
       Link Error Statistics:
               Link Failure Count: 4
               Loss of Sync Count: 261
               Loss of Signal Count: 4
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 202200a0b85aeb2d

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200200a0b85aeb2d
       Link Error Statistics:
               Link Failure Count: 2
               Loss of Sync Count: 1
               Loss of Signal Count: 2
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 202300a0b85aeb2d

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200200a0b85aeb2d
       Link Error Statistics:
               Link Failure Count: 2
               Loss of Sync Count: 1
               Loss of Signal Count: 2
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 201600a0b86e10e4

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200600a0b86e10e4
       Link Error Statistics:
               Link Failure Count: 3
               Loss of Sync Count: 1
               Loss of Signal Count: 0
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 201700a0b86e10e4

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200600a0b86e10e4
       Link Error Statistics:
               Link Failure Count: 3
               Loss of Sync Count: 1
               Loss of Signal Count: 0
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 202400a0b85bb030

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200400a0b85bb030
       Link Error Statistics:
               Link Failure Count: 2
               Loss of Sync Count: 1
               Loss of Signal Count: 2
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

Remote Port WWN: 202500a0b85bb030

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 200400a0b85bb030
       Link Error Statistics:
               Link Failure Count: 2
               Loss of Sync Count: 1
               Loss of Signal Count: 3
               Primitive Seq Protocol Error Count: 0
               Invalid Tx Word Count: 0
               Invalid CRC Count: 0

</source>

fcinfo remote-port --port <HBA Port WWN> --scsi-target

<syntaxhighlight lang=bash>

  1. fcinfo hba-port | grep HBA

HBA Port WWN: 21000024ff3cf472 HBA Port WWN: 21000024ff3cf473 HBA Port WWN: 21000024ff3cf454 HBA Port WWN: 21000024ff3cf455

  1. fcinfo remote-port --port 21000024ff3cf472 --scsi-target

Remote Port WWN: 20110002ac0059ce

       Active FC4 Types: SCSI
       SCSI Target: yes
       Node WWN: 2ff70002ac0059ce
       LUN: 0
         Vendor: 3PARdata
         Product: VV              
         OS Device Name: /dev/rdsk/c6t60002AC00000000000000002000059CEd0s2
       LUN: 1
         Vendor: 3PARdata
         Product: VV              
         OS Device Name: /dev/rdsk/c6t60002AC00000000000000003000059CEd0s2
       LUN: 2
         Vendor: 3PARdata
         Product: VV              
         OS Device Name: /dev/rdsk/c6t60002AC00000000000000004000059CEd0s2

... </source>

fcinfo lu -v <device>

<syntaxhighlight lang=bash>

  1. fcinfo lu -v /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2

OS Device Name: /dev/rdsk/c0t60030D90D9DD1A059655804D4A5EAD2Ed0s2

       HBA Port WWN: 2100000e1ed89451
       Controller: /dev/cfg/c4
               Remote Port WWN: 2100f4e9d4564d21
                       LUN: 11
                       State: active/optimized
               Remote Port WWN: 2100f4e9d4564c97
                       LUN: 11
                       State: active/non-optimized
       HBA Port WWN: 2100000e1ed89450
       Controller: /dev/cfg/c3
               Remote Port WWN: 2100f4e9d4564d44
                       LUN: 11
                       State: active/optimized
               Remote Port WWN: 2100f4e9d4564c1c
                       LUN: 11
                       State: active/non-optimized
       Vendor: DataCore
       Product: Virtual Disk    
       Device Type: Disk Device
       Unformatted capacity: 204800.000 MBytes

</source>

mpathadm

mpathadm list lu

<syntaxhighlight lang=bash> </source>

cfgadm

cfgadm -al -o show_FCP_dev [<controller>]

<syntaxhighlight lang=bash>

  1. cfgadm -al -o show_FCP_dev | grep unusable

c8::21000024ff2d49a2,0 disk connected configured unusable c8::21000024ff2d49a2,1 disk connected configured unusable c8::21000024ff2d49a2,2 disk connected configured unusable c8::21000024ff2d49a2,3 disk connected configured unusable c8::21000024ff2d49a2,4 disk connected configured unusable c8::21000024ff2d49a2,5 disk connected configured unusable c8::21000024ff2d49a2,6 disk connected configured unusable c8::21000024ff2d49a2,7 disk connected configured unusable c8::21000024ff2d49a2,8 disk connected configured unusable c8::21000024ff2d49a2,9 disk connected configured unusable c8::21000024ff2d49a2,10 disk connected configured unusable c9::203400a0b839c421,31 disk connected configured unusable c9::203400a0b84913d2,31 disk connected configured unusable c9::203500a0b839c421,31 disk connected configured unusable c9::203500a0b84913d2,31 disk connected configured unusable </source>

cfgadm -c unconfigure -o unusable_SCSI_LUN <unusable device>

<syntaxhighlight lang=bash>

  1. cfgadm -c unconfigure -o unusable_SCSI_LUN c8::21000024ff2d49a2

</source>

Alle aufräumen: <syntaxhighlight lang=bash>

  1. cfgadm -alo show_SCSI_LUN | nawk '$NF=="unusable"{gsub(/,[0-9]+$/,"",$1);print $1}' | sort -u | xargs -n 1 cfgadm -c unconfigure -o unusable_SCSI_LUN

</source>

cfgadm -o force_update -c configure <controller>

Rescan LUNs. Be careful! Does a forcelip! <syntaxhighlight lang=bash>

  1. cfgadm -o force_update -c configure c10

</source>


prtconf -Da <device>

<syntaxhighlight lang=bash>

  1. prtconf -Da /dev/cfg/c3

i86pc (driver name: rootnex)

   pci, instance #0 (driver name: npe)
       pci8086,3410, instance #5 (driver name: pcieb)
           pci111d,806e, instance #12 (driver name: pcieb)
               pci111d,806e, instance #13 (driver name: pcieb)
                   pci1077,170, instance #0 (driver name: qlc)  <---
                       fp, instance #0 (driver name: fp)

</source>


LUN masking (access LUNs of a storage)

<syntaxhighlight lang=bash> Nov 6 13:44:59 server01 Corrupt label; wrong magic number Nov 6 13:44:59 server01 cmlb: WARNING: /pci@380/pci@1/pci@0/pci@5/SUNW,qlc@0/fp@0,0/ssd@w204300a096691217,7 (ssd7): Nov 6 13:44:59 server01 Corrupt label; wrong magic number Nov 6 13:44:59 server01 cmlb: WARNING: /pci@380/pci@1/pci@0/pci@5/SUNW,qlc@0/fp@0,0/ssd@w204300a096691217,7 (ssd7): Nov 6 13:44:59 server01 Corrupt label; wrong magic number Nov 6 13:44:59 server01 cmlb: WARNING: /pci@300/pci@1/pci@0/pci@4/SUNW,qlc@0/fp@0,0/ssd@w203300a096691217,7 (ssd2): Nov 6 13:44:59 server01 Corrupt label; wrong magic number ... </source>

<syntaxhighlight lang=bash>

  1. cat /etc/driver/drv/fp.conf

mpxio-disable="no"; pwwn-lun-blacklist= "203200a096691265,7", "203300a096691265,7", "204200a096691265,7", "204300a096691265,7", "203200a096691217,7", "203300a096691217,7", "204200a096691217,7", "204300a096691217,7"; </source>

<syntaxhighlight lang=bash>

  1. reboot -- -r

... Boot device: /pci@300/pci@1/pci@0/pci@2/scsi@0/disk@p0 File and args: -r SunOS Release 5.11 Version 11.3 64-bit Copyright (c) 1983, 2015, Oracle and/or its affiliates. All rights reserved. /pseudo/fcp@0 (fcp0):

       LUN 7 of port 203300a096691217 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 203200a096691217 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 203300a096691265 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 203200a096691265 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 204300a096691217 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 204200a096691217 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 204300a096691265 is masked due to black listing.

/pseudo/fcp@0 (fcp0):

       LUN 7 of port 204200a096691265 is masked due to black listing.

Configuring devices.

</source>

Kommandos : Common Array Manager

lsscs

Ist unter Solaris in /opt/SUNWsefms/bin

lsscs list array

<syntaxhighlight lang=bash> </source>

lsscs list array <array_name>

<syntaxhighlight lang=bash> </source>

lsscs list -a <array_name> fcport

<syntaxhighlight lang=bash> </source>

Kommandos : Brocade

Switch-Kommandos

switchshow

<syntaxhighlight lang=bash> san-sw_11:admin> switchshow switchName: san-sw_11 switchType: 71.2 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:00:05:33:df:43:5a zoning: ON (Fabric1) switchBeacon: OFF

Index Port Address Media Speed State Proto

==================================
  0   0   010000   id     N8   No_Light    FC  
  1   1   010100   id     N8   Online      FC  E-Port  10:00:00:05:33:df:bd:b9 "san-sw_21" (downstream)
  2   2   010200   id     N8   Online      FC  F-Port  21:00:00:24:ff:05:74:e4 
  3   3   010300   id     N8   Online      FC  F-Port  50:0a:09:81:8d:32:5d:c4 
  4   4   010400   id     N8   No_Light    FC  
  5   5   010500   id     N8   Online      FC  E-Port  10:00:00:05:33:df:bd:b9 "san-sw_21" 
  6   6   010600   id     N4   Online      FC  F-Port  20:06:00:a0:b8:32:38:17 
  7   7   010700   id     N4   Online      FC  F-Port  20:07:00:a0:b8:32:38:17 
  8   8   010800   id     N4   Online      FC  F-Port  21:00:00:1b:32:91:4c:ed 
  9   9   010900   id     N4   Online      FC  F-Port  21:00:00:1b:32:98:05:1a 
 10  10   010a00   id     N8   Online      FC  F-Port  21:00:00:24:ff:4a:d3:bc 
 11  11   010b00   id     N8   No_Light    FC  
 12  12   010c00   id     N8   No_Light    FC  
 13  13   010d00   id     N8   No_Light    FC  
 14  14   010e00   id     N8   No_Light    FC  
 15  15   010f00   id     N8   No_Light    FC  
 16  16   011000   --     N8   No_Module   FC  (No POD License) Disabled
 17  17   011100   --     N8   No_Module   FC  (No POD License) Disabled
 18  18   011200   --     N8   No_Module   FC  (No POD License) Disabled
 19  19   011300   --     N8   No_Module   FC  (No POD License) Disabled
 20  20   011400   --     N8   No_Module   FC  (No POD License) Disabled
 21  21   011500   --     N8   No_Module   FC  (No POD License) Disabled
 22  22   011600   --     N8   No_Module   FC  (No POD License) Disabled
 23  23   011700   --     N8   No_Module   FC  (No POD License) Disabled

</source> Was sagt uns das?

  1. Dies ist der "Principal" (alle andere sind "Subordinate") der Fabric "Fabric1" (switchRole:, zoning:)
  2. Der Switch ist gezoned (zoning:)
  3. SwitchID ist "fffc01"
  4. Es ist ein 24-Port Switch
  5. Es gibt einen doppelten ISL (InterSwitchLink) zu einem anderen Switch E-Port (san-sw_21)
  6. 6 Ports sind mit SFPs bestückt, aber nicht belegt (0,4,11-15)
  7. 8 Ports haben keine Lizenz und auch kein SFP (No_Module)
  8. 9 Ports sind belegt

fabricshow

<syntaxhighlight lang=bash> san-sw_11:root> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name


 1: fffc01 10:00:00:05:33:df:43:5a 192.168.1.117 0.0.0.0          >"san-sw_11"
 2: fffc02 10:00:00:05:33:df:bd:b9 192.168.1.119 0.0.0.0           "san-sw_21"

The Fabric has 2 switches </source>

islshow

<syntaxhighlight lang=bash> rz1_fab2_11:admin> islshow

 1:  1->  0 10:00:00:05:1e:0d:5e:96  12 bc1_sl4_fab2_12 sp:  4.000G bw:  4.000G 
 2:  2->  0 10:00:00:05:1e:0d:e2:53  13 bc2_sl4_fab2_13 sp:  4.000G bw:  4.000G 
 3:  3->  0 10:00:00:05:1e:b3:71:bf  14 bc3_sl4_fab2_14 sp:  4.000G bw:  4.000G 
 4:  5-> 17 10:00:00:05:1e:0d:5e:96  12 bc1_sl4_fab2_12 sp:  4.000G bw:  4.000G 
 5:  6-> 17 10:00:00:05:1e:0d:e2:53  13 bc2_sl4_fab2_13 sp:  4.000G bw:  4.000G 
 6:  7-> 17 10:00:00:05:1e:b3:71:bf  14 bc3_sl4_fab2_14 sp:  4.000G bw:  4.000G 
 7: 10->  8 10:00:50:eb:1a:45:71:96  15 rz-6510-fab2-15 sp:  4.000G bw:  4.000G 
 8: 18->  0 10:00:50:eb:1a:45:71:96  15 rz-6510-fab2-15 sp:  4.000G bw:  4.000G 

</source>

Port-Kommandos

porterrshow

portstatsshow

portstatsclear

portloginshow

Show information about NPIV-ports.

<syntaxhighlight lang=bash> fcsw1:admin> switchshow ... Index Port Address Media Speed State Proto

======================================

...

 34  34   0f2200   id    N16	   Online      FC  F-Port  1 N Port + 1 NPIV public 

... </source> This is a NetApp 8080 with CDOT behind this port as you can see with nodefind <address> <syntaxhighlight lang=bash> fcsw1:admin> nodefind 0f2200 Local:

Type Pid    COS     PortName                NodeName                 SCR
N    0f2200;      3;50:0a:09:82:80:d1:21:ee;50:0a:09:80:80:d1:21:ee; 0x00000000
   PortSymb: [45] "NetApp FC Target Adapter (8324) cdot1-01:0g"
   NodeSymb: [38] "NetApp FAS8080 (cdot1-01/cdot1-02)"
   Fabric Port Name: 20:22:50:eb:1a:42:f8:45 
   Permanent Port Name: 50:0a:09:82:80:d1:21:ee
   Device type: Physical Unknown(initiator/target)
   Port Index: 34
   Share Area: No
   Device Shared in Other AD: No
   Redirect: No 
   Partial: No
   LSAN: No
   Aliases:

</source>

Now look with portloginshow <portnumber>: <syntaxhighlight lang=bash> fcsw1:admin> portloginshow 34 Type PID World Wide Name credit df_sz cos

=========================================
 fd  0f2201 20:00:00:a0:98:5d:33:82     6  2048   8  scr=0x3
 fe  0f2200 50:0a:09:82:80:d1:21:ee     6  2048   8  scr=0x0
 ff  0f2201  20:00:00:a0:98:5d:33:82     0     0   8  d_id=FFFFFC  
 ff  0f2200  50:0a:09:82:80:d1:21:ee     0     0   8  d_id=FFFFFC  

</source>

With this information you can find out more about the WWNs: <syntaxhighlight lang=bash> fcsw1:admin> nodefind 20:00:00:a0:98:5d:33:82 Local:

Type Pid    COS     PortName                NodeName                 SCR
N    0f2201;      3;20:00:00:a0:98:5d:33:82;20:04:00:a0:98:5d:33:82; 0x00000003
   FC4s: FCP 
   PortSymb: [58] "NetApp FC Target Port (8324) cdot1fc:cdot1-01_fc_lif_1"
   NodeSymb: [24] "NetApp Vserver cdot1fc"
   Fabric Port Name: 20:22:50:eb:1a:42:f8:45 
   Permanent Port Name: 50:0a:09:82:80:d1:21:ee
   Device type: NPIV Target
   Port Index: 34
   Share Area: No
   Device Shared in Other AD: No
   Redirect: No 
   Partial: No
   LSAN: No
   Aliases: cdot1fc_01_lif1

</source>

Even the VServer (NodeSymb)!

And with the NodeName you can find all logical interfaces of this svm: <syntaxhighlight lang=bash> fcsw1:admin> nodefind 20:04:00:a0:98:5d:33:82 Local:

Type Pid    COS     PortName                NodeName                 SCR
N    0f2201;      3;20:00:00:a0:98:5d:33:82;20:04:00:a0:98:5d:33:82; 0x00000003
   FC4s: FCP 
   PortSymb: [58] "NetApp FC Target Port (8324) cdot1fc:cdot1-01_fc_lif_1"
   NodeSymb: [24] "NetApp Vserver cdot1fc"
   Fabric Port Name: 20:22:50:eb:1a:42:f8:45 
   Permanent Port Name: 50:0a:09:82:80:d1:21:ee
   Device type: NPIV Target
   Port Index: 34
   Share Area: No
   Device Shared in Other AD: No
   Redirect: No 
   Partial: No
   LSAN: No
   Aliases: cdot1fc_01_lif1
N    0f2301;      3;20:02:00:a0:98:5d:33:82;20:04:00:a0:98:5d:33:82; 0x00000003
   FC4s: FCP 
   PortSymb: [58] "NetApp FC Target Port (8324) cdot1fc:cdot1-02_fc_lif_1"
   NodeSymb: [24] "NetApp Vserver cdot1fc"
   Fabric Port Name: 20:23:50:eb:1a:42:f8:45 
   Permanent Port Name: 50:0a:09:82:80:61:21:e8
   Device type: NPIV Target
   Port Index: 35
   Share Area: No
   Device Shared in Other AD: No
   Redirect: No 
   Partial: No
   LSAN: No
   Aliases: cdot1fc_02_lif1

</source>

Zone-Kommandos

zoneshow

alicreate

alishow

Backup der Switchconfig per Script

Put the backup host ssh-pub-key on the switches

<syntaxhighlight lang=bash> fcsw1:root> cat >/root/.ssh/authorized_keys <<EOF > ssh-dss AAAAB3NzaC1... ... ... lF8qsgtTD8cc= root@host > EOF </source>

Generate ssh-key on the switches

<syntaxhighlight lang=bash> fcsw1:root> ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 2a:23:33:...:69:bc:25:a5:f9 root@fcsw1 The key's randomart image is: +--[ RSA 2048]----+ | | | ... | | | +-----------------+ </source>

Copy the key to your backup users ~/.ssh/authorized_keys on backup host

<syntaxhighlight lang=bash> fcsw1:root> cat /root/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAA... ... KHnw1T1NaQ== root@fcsw1 </source>

Now the script on the backup host

<syntaxhighlight lang=bash>

  1. cat /opt/bin/backup_brocade_config
  2. !/bin/bash

SWITCHES=" 172.30.40.50 172.30.40.51 " LOCALUSER="backupuser" BACKUPDIR="brocade_backup" BACKUPHOST="172.30.40.10"

DATE="$(date '+%Y%m%d-%H%M%S')" for switch in ${SWITCHES} ; do

 printf "Backing up ${switch} to ~${LOCALUSER}/${BACKUPDIR}/${switch}_config_${date}.txt... "
 ssh root@${switch} /fabos/link_sbin/configupload -all -p scp ${BACKUPHOST},${LOCALUSER},${BACKUPDIR}/${switch}_config_${DATE}.txt

done </source>

Script zum parsen einer configupload-Datei

<syntaxhighlight lang=awk>

  1. !/usr/bin/gawk -f

BEGIN{

 vendor["001438"]="Hewlett-Packard";
 vendor["00a098"]="NetApp";
 vendor["0024ff"]="Qlogic";
 vendor["001b32"]="Qlogic";
 vendor["0000c9"]="Emulex";
 vendor["00e002"]="CROSSROADS SYSTEMS, INC.";
 

} /\[Zoning\]/,/^$/ {

 if(/^cfg./){
   split($0,cfgparts,":");
   gsub(/^cfg./,"",cfgparts[1]);
   cfg[cfgparts[1]]=cfgparts[2];
 }
 else if(/^zone./) {
   zonename=$0;
   gsub(/:.*$/,"",zonename);
   gsub(/^zone./,"",zonename);
   zonemembers=$0;
   gsub(/^[^:]*:/,"",zonemembers);
   zone[zonename]=zonemembers;
 }
 else if(/^alias./) {
   aliasname=$0;
   gsub(/:.*$/,"",aliasname);
   gsub(/^alias./,"",aliasname);
   aliasmembers=$0;
   gsub(/^[^:]*:/,"",aliasmembers);
   alias[aliasname]=aliasmembers;
   if(length(aliasname)>longestalias){
     longestalias=length(aliasname);
   }
 }
 else if(/^enable:/) {
   cfgenabled=$0;
   gsub(/^enable:/,"",cfgenabled);
 }

} END {

 print "Config:",cfgenabled;
 split(cfg[cfgenabled],active_zones,";");
 for(active_zone in active_zones) {
   split(zone[active_zones[active_zone]],zone_members,";");
   asort(zone_members);
   print "Zone",active_zones[active_zone],"(",length(zone_members),"Members ):";
   for(zone_member in zone_members){
     member=zone_members[zone_member];
     if(alias[member]!=""){

member=alias[member];

     }
     WWN=member;
     gsub(/:/,"",WWN);
     if(WWN ~ /^5/){start=2;}else{start=5;}
     vendor_id=substr(WWN,start,6);
     printf "  Member: %s\t",member;
     if(alias[zone_members[zone_member]]!=""){
       format=sprintf("%%s%%%ds\t",longestalias-length(zone_members[zone_member]));
       printf format,zone_members[zone_member]," ";
     }
     printf "%s\n",vendor[vendor_id];
   }
 }
 printf "\n\n\nCreate config:\n-------------------------------------------------\n";
 printf "cfgdelete  \"%s\"\n",cfgenabled;
 for(active_zone in active_zones) {
   split(zone[active_zones[active_zone]],zone_members,";");
   asort(zone_members);
   for(zone_member in zone_members){
     member=zone_members[zone_member];
     if(alias[member]!=""){
       printf "alicreate  \"%s\",\"%s\"\n",member,alias[member];

alias[member]="";

     }
   }
   printf "zonecreate \"%s\",\"%s\"\n",active_zones[active_zone],zone[active_zones[active_zone]];
   if(!secondelement){
     secondelement=1;
     printf "cfgcreate";
   } else {
     printf "cfgadd   ";
   }
   printf "  \"%s\",\"%s\"\n",cfgenabled,active_zones[active_zone];
 }
 printf "cfgsave\ncfgenable  \"%s\"\n",cfgenabled;

} </source>

Kommandos: NetApp

fcp topology show : Wo hängt mein Frontend-SAN?

<syntaxhighlight lang=bash> fas01> fcp topology show Switches connected on adapter 0d: None connected.

Switches connected on adapter 0c: None connected.

Switches connected on adapter 1a:

  Switch Name: fcsw01
Switch Vendor: Brocade Communications, Inc.

Switch Release: v6.4.2a

Switch Domain: 1
   Switch WWN: 10:00:00:05:33:c6:1e:6c
   Port Count: 24

Switches connected on adapter 1b:

  Switch Name: fcsw02
Switch Vendor: Brocade Communications, Inc.

Switch Release: v6.4.2a

Switch Domain: 1
   Switch WWN: 10:00:00:05:33:c7:5e:d2
   Port Count: 24

Switches connected on adapter 1c: None connected.

Switches connected on adapter 1d: None connected. </source>

fcp config <port> : Welche WWN habe ich?

<syntaxhighlight lang=bash> fas01> fcp config 1a 1a: ONLINE <ADAPTER UP> PTP Fabric

       host address 010600
       portname 50:0a:09:83:90:00:29:24  nodename 50:0a:09:80:80:00:29:24
       mediatype auto speed auto

</source> Kleines Schmankerl ist noch die "host address", die uns zeigt, daß wir auf Switch-ID 01 Port 06 hängen.

fcp wwpn-alias (set|show) : Aliasnamen für mehr Klarheit beim Debugging

<syntaxhighlight lang=bash> fas01> fcp wwpn-alias set sun07_Slot2_Port0 21000024ff363a5a fas01> fcp wwpn-alias show WWPN Alias


-----

21:00:00:24:ff:36:3a:5a sun07_Slot2_Port0 </source>

sanlun lun show -d <dev> (mit Solaris und ZPool)

Wenn man wissen möchte, welche NetApp LUNs zu einem ZPool gehören, geht das folgender Maßen:

<syntaxhighlight lang=bash>

  1. zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'

</source> Beispiel: <syntaxhighlight lang=bash>

  1. zpool status | nawk '/c[0-9]t/{dev=$1;gsub(/s[0-9]+$/,"",$1);command="/opt/NTAP/SANToolkit/bin/sanlun lun show -d /dev/rdsk/"$1"s2";command | getline; command | getline; print dev,$1$2;next;}{print;}'
 Pool: testpool
Status: ONLINE
scan: resilvered 11,0G in 0h1m with 0 errors on Thu Oct  2 09:41:39 2014

config:

       NAME                                         STATE     READ WRITE CKSUM
       testpool                                     ONLINE       0     0     0
         mirror-0                                   ONLINE       0     0     0

c5t60A98000433544625634696B76705370d0s0 fas01:/vol/testlun/LUN0 c5t60A980003830304F392446473844375Ad0 fas02:/vol/testlun/LUN0 </source>

Sonstiges

Alle WWNs in einem File finden

Gibt nur die WWNs aus, auch mehrere, wenn mehrere in einer Zeile sind. <syntaxhighlight lang=awk> gawk '{line=$0;while(match(line,/[0-9a-f]{2}(:[0-9a-f]{2}){7}/,wwn)){line=substr(line,wwn[0,"start"]+wwn[0,"length"]); print wwn[0];}}' <file> </source>

Some adittions to NetApps sanlun lun show on Solaris

<syntaxhighlight lang=awk>

  1. /opt/NTAP/SANToolkit/bin/sanlun lun show | gawk '

$3 ~ /\/dev\// {

 sanlun=$0;
 cmd="luxadm display "$3;
 while( cmd|getline line ){
   count=split(line,word);
   if(line ~ /DEVICE PROPERTIES for disk:/){
     disk=word[count];
     ctrl="";
     dev_addr="";
     svm_ports="";
     delete ports;
     delete pri;
     delete sec;
     delete paths;
     delete online;
     continue;
   }
   if(line ~ /Controller/){
     ctrl=word[count];
     continue;
   }
   if(line ~ /Device Address/){
     dev_addr=word[count];
     gsub(/,.*$/,"",dev_addr);
     ports[dev_addr]=1;
     pair=ctrl"_"dev_addr;
     continue;
   }
   if(line ~ /Class/){
     class[pair]=word[count];
     if(word[count]=="primary"){
       pri[disk]++;
     } else {
       sec[disk]++;
     }
     continue;
   }
   if(line ~ /State/){
     state[pair]=word[count];
     paths[disk]++;
     if(word[count]=="ONLINE"){
       online[disk]++;
     }
   }
   if(line ~ /^$/ && ctrl!=""){
     for(port in ports){
       if(svm_ports==""){
         sep="";
       } else {
         sep=",";
       }
       svm_ports=svm_ports sep port;
     }
     printf "%s      %2d/%2d         %2d/%2d        %s\n",sanlun,online[disk],paths[disk],pri[disk],sec[disk], svm_ports;
   }
 }
 close(cmd);
 next;

} /^vserver/{

 line=sprintf("%s  Online/Total Primary/Secondary Device Addresses\n", $0);
 printf line;
 gsub(/./,"-",line);
 print line;
 next;

} /^[-]+$/{next;} {print;} ' </source>