dropdown menu

Showing posts with label STORAGE. Show all posts
Showing posts with label STORAGE. Show all posts

iSCSI (NetApp)

iSCSI

iSCSI (Internet SCSI) provides access to storage devices by carrying SCSI commands over a TCP/IP network.  iSCSI was developed by IBM and Cisco in 1998 and submitted as a draft standard in March 2000.

NetApp is one of the leader company in storage hardware industry. In the early 1990s, NetApps's storage systems offered NFS and SMB protocols (based on TCP/IP) and in 2002 NetApp added Fibre  Channel (FC) and iSCSI protocols. iSCSI protocol is configured to use TCP port number 3260.

The iSCSI protocol allows clients (called initiators) to send SCSI commands to storage devices (targets) on remote servers. It competes with Fibre Channel, but unlike Fibre Channel which usually requires dedicated cabling, iSCSI can be run over long distances using existing network infrastructure.

Differences between iSCSI, NAS and SAN
NAS and iSCSI are both using TCP/IP (LAN), but the protocols are different. NAS is using NFS and CIFS/SMB, but iSCSI is using a variant of the SCSI protocol, so iSCSI has a close relationship with SAN. Actually, only the transmission medium is different, because for SAN, the SCSI protocol is packaged in Fibre Channel, for iSCSI it is packaged in TCP/IP. In both cases, blocks are transferred, iSCSI is therefore not file-based (like NAS), but a block-based transmission, (so we will see hdisk devices in AIX). (Many NAS systems can offer file-based services such as SMB/CIFS and NFS, but also can offer block-based iSCSI.)

--------------------------------------------

Initiator / Target / IQN

To transport SCSI commands over the IP network, an iSCSI driver must be installed, which creates the initiator (the iscsi0 device). In AIX 7.2TL3, MPIO (Multipathing) support for iSCSI software initiator is introduced.

iSCSI targets are devices that respond to iSCSI commands. An iSCSI device can be a storage device, or it can be an intermediate device such as a bridge between IP and Fibre Channel devices. 

iSCSI Initiator  <--client (LUNs are mapped here), connected to a storage device  (via Net. Switch), sends SCSI commands to SCSI target
iSCSI Target   <--server (storage system), responds to iSCSI commands and exports local volumes (LUNs) to the initiator node.

Each initiator and target has a unique iSCSI name: iSCSI qualified name (IQN). AnIQN represents a worldwide unique name for each initiator or target in the same way that worldwide node names (WWNNs) are used to identify devices in a Fibre Channel fabric. IQN has a reversed hostname format like: iqn.2018-06.com.ibm.stglabs.aus.p9fwc-iscsi2.hostid.2



Some notes:

Performance considerations:

VG Considerations:
Configure volume groups on iSCSI devices, to be in an inactive state after reboot and manually activate the iSCSI-backed volume groups.Volume groups are activated during a different boot phase than the iSCSI software driver,  for this reason, it is not possible to activate iSCSI volume groups during the boot process.


-----------------------------------------------

sanlun lun show                                short overview about the Netapp LUNs (sanlun command comes with Netapp Utility package)
sanlun lun show -v                             detailed overview about the Netapp LUNs
sanlun lun show -d hdisk81 -v                  detailed overview about 1 LUN
sanlun lun show -p                             shows multipathing info

lsmpio -l hdisk81                              shows path details (shows which path using which Controller IP)
lsmpio -ql hdisk81                             it is a very good command to check if LUN is really there or not !!!!!!!!!!!!
                                               (it does not use ODM, it makes a real IO operation to reach the LUN and get some details)   
lsmpio -Sl hdisk81                             shows statistics (Adapter/SCSI errors....)

lsattr -El iscsi0                              show settings of iscsi0
lsdev -p iscsi0                                show LUNs of iscsi0 

lsiscsi                                        show target ip, iqn, port
iscsi_st -f -i 10.10.128.15                    show target IQN info and tcp ports (IP is the target IP)

netstat -an | grep 3260                        shows which IP is used locally and to which IP it is connected remote (target)
tcpdump -i en1 host 10.10.128.15               check if iscsi packates appear in output (IP is the target IP)

on VIOS check paths for all LUNs which are used as vsscsi devices:
for i in `/usr/ios/cli/ioscli lsmap -all | grep hdisk | awk '{ print $3 }'`; do lsmpio -l $i; done    

lspath check of a LUN (use the whole "connection" column for the below command):
lspath -l hdisk81 -HF "name path_id parent connection path_status status"      

more info about the path:
lspath -AHE -l hdisk81 -p iscsi0 -w "iqn.1782-08.com.netapp:sn.e1787cbba71411eab2b6d939eb1588a7:vs.29,10.10.128.15,0xcbb,0x50000000000000"    

for enabling failed paths:
lspath | grep -v Ena | awk '{print "chpath -s enable -l " $2 " -p " $3 }'                   

-----------------------------------------------

iSCSI related filesets on AIX (with Netapp Storage):

# lslpp -l | grep -i iscsi
  NetApp.MPIO_Host_Utilities_Kit.iscsi             Kit iSCSI Disk ODM Stanzas
  devices.common.IBM.iscsi.rte  7.2.5.200  APPLIED    Common iSCSI Files
  devices.iscsi.disk.rte     7.2.5.0  APPLIED    iSCSI Disk Software
  devices.iscsi.tape.rte     7.2.0.0  COMMITTED  iSCSI Tape Software 
  devices.iscsi_sw.rte     7.2.5.200  APPLIED    iSCSI Software Device Driver
  devices.pci.14102203.diag  7.2.0.0  COMMITTED  IBM 1 Gigabit-TX iSCSI TOE
  devices.pci.14102203.rte   7.2.0.0  COMMITTED  IBM 1 Gigabit-TX iSCSI TOE
  devices.pci.1410cf02.diag  7.2.0.0  COMMITTED  1000 Base-SX PCI-X iSCSI TOE
  devices.pci.1410cf02.rte   7.2.0.0  COMMITTED  1000 Base-SX PCI-X iSCSI TOE
  devices.pci.1410d002.diag  7.2.4.0  COMMITTED  1000 Base-TX PCI-X iSCSI TOE
  devices.pci.1410d002.rte   7.2.0.0  COMMITTED  1000 Base-TX PCI-X iSCSI TOE
  devices.pci.1410e202.diag  7.2.0.0  COMMITTED  IBM 1 Gigabit-SX iSCSI TOE
  devices.pci.1410e202.rte   7.2.0.0  COMMITTED  IBM 1 Gigabit-SX iSCSI TOE
  devices.pci.77102e01.diag  7.2.0.0  COMMITTED  1000 Base-TX PCI-X iSCSI TOE
  devices.pci.77102e01.rte   7.2.0.0  COMMITTED  PCI-X 1000 Base-TX iSCSI TOE

-----------------------------------------------

iSCSI configuration
(there are 2 types of dicovery methods: file based or odm based. I used odm based below, for file based add the iscsi target info in ‘/etc/iscsi/targets’ file)

0. for MPIO (at least) 2 IPs should be configured in different subnets (these are our paths  and 2 additional IPs are needed from Storage Team at Storage side too)

1. check iscsi drivers and ping target (by default port 3260 is used,not blocked by firewall)
# lslpp -l | grep -i iscsi  ; ping <target> 

2. set iqn for iscsi0, lsattr -El iscsi0 will show this value (storage team can give the initiator details)
# chdev -l iscsi0 -a initiator_name=iqn.2018-06.com.ibm.my_host1:0ab116bb     

3. check discovery policy, I used odm (if needs to be changed: chdev -a disc_policy=odm -l iscsi0)
# lsattr -El iscsi0 | grep disc_policy                                        

4. mkiscsi commands will add iSCSI target data to ODM, for each path needs an mkiscsi command 
# mkiscsi -l iscsi0 -g static -t iqn.1986-03.com.ibm:2145.d59-v7k2.node1 -n 3260 -i 10.10.10.10
# mkiscsi -l iscsi0 -g static -t iqn.1986-03.com.ibm:2145.d59-v7k2.node2 -n 3260 -i 10.10.20.10
(the details should be given by storage team, -i iSCSI target IP -t iSCSI target name)

5. discover disks
cfgmgr -vl iscsi0  

-----------------------------------------------

Netapp recommendations for iSCSI LUNs




-----------------------------------------------

Reset interface:

If there are problems, resetting the interface used for iscsi may help:
ifconfig en0 down
rmdev -l en0
cfgmgr

For info:
Once we had many disk/io/path errors in errpt, which came hourly/daily and we checked with storage team and they did not find any erros, we did reset but it also did not help.
We asked Network team, and they saw CRC errors on Network switch port, and changing cable/SFP at their side helped.


-----------------------------------------------










Tape Devices

TAPE DEVICES:

IBM tape drives and libraries mainly use Atape (install fileset):

# lslpp -l | grep Atape
  Atape.driver              12.6.2.0  COMMITTED  IBM AIX Enhanced Tape and

After install and device configuration tape devices will look like this

# lsdev -Cc tape
rmt0            Available 04-01-02     IBM 3592 Tape Drive (FCP)
rmt1            Available 04-01-02     IBM 3592 Tape Drive (FCP)
rmt2            Available 02-01-02     IBM 3592 Tape Drive (FCP)
rmt3            Available 04-01-02     IBM 3592 Tape Drive (FCP)
smc0            Available 02-01-02     IBM 3584 Library Medium Changer (FCP)
smc1            Available 04-01-02     IBM 3584 Library Medium Changer (FCP)

rmt: tape device
smc: library medium changer

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

Special tape drive files

After tape device configuration, new device files will be created automatically under /dev:

# ls -l /dev/rmt0*
crw-rw-rwT    1 root     system       46,1664 Nov 04 19:42 /dev/rmt0
crw-rw-rwT    1 root     system       46,1665 Nov 04 19:42 /dev/rmt0.1
crw-rw-rwT    1 root     system       46,1673 Nov 04 19:42 /dev/rmt0.10
crw-rw-rwT    1 root     system       46,1668 Nov 04 19:42 /dev/rmt0.2
crw-rw-rwT    1 root     system       46,1672 Nov 04 19:42 /dev/rmt0.20
crw-rw-rwT    1 root     system       46,1669 Nov 04 19:42 /dev/rmt0.3
crw-rw-rwT    1 root     system       46,1664 Nov 04 19:42 /dev/rmt0.4
crw-rw-rwT    1 root     system       46,1680 Nov 04 19:42 /dev/rmt0.40
crw-rw-rwT    1 root     system       46,1681 Nov 04 19:42 /dev/rmt0.41
crw-rw-rwT    1 root     system       46,1665 Nov 04 19:42 /dev/rmt0.5
crw-rw-rwT    1 root     system       46,1668 Nov 04 19:42 /dev/rmt0.6
crw-rw-rwT    1 root     system       46,1688 Nov 04 19:42 /dev/rmt0.60
crw-rw-rwT    1 root     system       46,1669 Nov 04 19:42 /dev/rmt0.7
crw-rw-rwT    1 root     system       46,1696 Nov 04 19:42 /dev/rmt0.null
crw-rw-rwT    1 root     system       46,1666 Nov 04 19:42 /dev/rmt0.smc

These files wil be used for writing and reading on tapes. (These special files are /dev/rmt#, /dev/rmt#.1, /dev/rmt#.2, ... /dev/rmt#.7)
By selecting one of these special files, you decide how I/O on the tape drive will be performed: Density, Rewind-on-Close, Rewind-on-Open

Density: It has 2 values. Density #1 is the highest and #2 is the next highest possible density. (for read operation density is ignored)

Rewind–on–Close: If rewind–on–close is selected, the tape is positioned at the beginning of the tape when the file is closed.

Retension–on–Open: Retensioning means winding to the end of the tape and then rewinding to the beginning of the tape to reduce errors. If retension–on–open is selected, the tape is positioned at the beginning of the tape as part of the file open process.



Suppose you want to write three files in tape drive rmt2 with Density Setting #1. You want to write the 1st file to the beginning of the tape, the 2nd file after the 1st file, and the 3rd file after the 2nd file. The following list of special files, in the given order could be used:
1. /dev/rmt2.3
2. /dev/rmt2.1
3. /dev/rmt2 

These particular special files are chosen because:
1.  /dev/rmt2.3: this has Retension–on–Open, which ensures that the first file is at the beginning of the tape. Rewind–on–Close is not chosen because the next I/O operation is to begin where this file ends. (If we are sure the tape is already at the beginning, then using /dev/rmt2.1 would be faster since time for retensioning the tape is eliminated.)

2. /dev/rmt2.1: this has neither Retension–on–Open nor Rewind–on–Close. There is no reason to go to the beginning of the tape either when the file is opened or when it is closed.

3. /dev/rmt2: this is the final file. Retension–on–Open is not wanted since third file follows the second file. Rewind–on–Close is selected because there are no plans to do any more writing after the third file on the tape. The next use of the tape will begin at the beginning of the tape.

(Besides controlling tape operations by choosing a particular rmt special file, you can use the tctl command to control tape operations.)

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

Info about tape devices:

Serial number:

# lscfg -vpl rmt0
  rmt0             U78AA.001.WZSHX4S-P1-C3-T2-W500507630F734541-L0  IBM 3592 Tape Drive (FCP)

        Manufacturer................IBM
        Machine Type and Model......03592E07
        Serial Number...............0000078A2434
        Device Specific.(FW)........398B
        Loadable Microcode Level....A1700D78


WW name:

# lsattr -El rmt0 | grep World
node_name       0x500507630f334541 World Wide Node Name                                  False
ww_name         0x500507630f734541 World Wide Port Name                                  False

(on IBM site ww_name was collected, lsattr shows other attibutes like device type, compressed or not... )

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

tctl                gives subcommand to tape (move forward/backward)
tcopy               copies magnetic tapes

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

Finding parent FC device of a tape (or smc device):


1. lscfg -l rmt* (or lscfg -l smc*)                         <--check location of tape devices
  rmt0             U78AA.001.WZSHX4S-P1-C3-T2-W500507630F734541-L0  IBM 3592 Tape Drive (FCP)
  rmt1             U5877.001.T26V0AX-P1-C3-T2-W500507630FB34541-L0  IBM 3592 Tape Drive (FCP)

2. lscfg -l fcs*                                            <--check FC adapter location
  fcs2             U78AA.001.WZSHX4S-P1-C3-T1  8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
  fcs3             U78AA.001.WZSHX4S-P1-C3-T2  8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
  fcs0             U5877.001.T26V0AX-P1-C3-T1  8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
  fcs1             U5877.001.T26V0AX-P1-C3-T2  8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)

3. compare location codes
rmt0 --> fcs3
rmt1 --> fcs1

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

Upgrade Atape

(0. In TSM save current device config)
1.  rmdev -dl rmt#                                            <-- remove tape devices (lsdev -Cc tape)
2. installp -u Atape.driver                                   <--remove older Atape driver (IBM site says it is optional)
3. installp -acXd /tmp/Atape.12.10.1.0 all                    <--install and commit Atape driver
4. reboot recommended (or cfgmgr to reconfigure devices)


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

As tapes are used by TSM instance owner, rw permissions needed for all:

$ ls -l /dev/rmt*
crw-rw-rwT    1 root     system       46,1664 Nov 04 19:42 /dev/rmt0
crw-rw-rwT    1 root     system       46,1665 Nov 04 19:42 /dev/rmt0.1
crw-rw-rwT    1 root     system       46,1673 Nov 04 19:42 /dev/rmt0.10
crw-rw-rwT    1 root     system       46,1668 Nov 04 19:42 /dev/rmt0.2
crw-rw-rwT    1 root     system       46,1672 Nov 04 19:42 /dev/rmt0.20

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




STORAGE - SDDPCM

SDDPCM:

SDDPCM is a loadable path control module designed to support the multipath configuration environment in the IBM TotalStorage Enterprise Storage Server, the IBM System Storage SAN Volume Controller, and the IBM TotalStorage DS family.

When the supported devices are configured as MPIO-capable devices, SDDPCM is loaded and becomes part of the AIX MPIO FCP (Fibre Channel Protocol) device driver. The AIX MPIO device driver with the SDDPCM module enhances the data availability and I/O load balancing.

You cannot install SDD and SDDPCM together on a server. When supported storage devices are configured as non-MPIO capable devices (that is, multiple logical device instances are created for a physical LUN), you should install SDD to get multipath support. Where only one logical device instance is created for a physical LUN you must install SDDPCM.

SDDPCM server daemon:
SDDPCM has a server daemon running in the background: lssrc/stopsrc/startsrc -s pcmsrv
psmsrv provides path-recovery function for SDDPCM devices

these module added to the kernel: sddpcmke, sdduserke


pcmpath
pcmpath query adapter            shows adapter configuration
pcmpath query version            shows the version of the sddpcm
pcmpath query device             shows the sddpcm devices (pcmpath query device 44 <--shows only this device)
pcmpath query essmap             good overview

pcmpath set device algorithm     dynamically change the path selection algorithm
pcmpath set device hc_mode       dynamically chane the path health check mode
pcmpath set device hc_interval   dynamically change the path healthcheck time interval

pcmpath set device M  path N online/offline dynamically enable (online) or disable (offline) a path
pcmpath set adapter N online/offline dynamically enable (online) or disable (offline) an adapter
                                 (SDDPCM resereves the last path of a device, it will fail if the device is using the last path)

pcmquerypr                        reads and clear persisten reserve and registration keys
pcmquerypr -vh /dev/hdisk30       to query and display the persistent reservation (-V verbose mode, more details)
pcmquerypr -rh /dev/hdisk30       release the persistent reservation if the device is reserved by the current host
pcmquerypr -ch /dev/hdisk30       remove the persistent reservation and clear all reservation key registration
pcmquerypr -ph /dev/hdisk30       remove the persistent reservation if the device is reserved by the other host

pcmgenprkey                       set or clear the PR_key_value ODM attribute for all SDDPCM MPIO devices

pcmpath query device | egrep "^DEV|^SERIAL" | paste - - | awk '{print $5 "\t" $12}' | sort -k1.6n  list hdisks + serial numb. (hdisk order)
------------------------------------

Change adapter settings (reconfigure paths):

1. If possible put the required adapter offline with the subsystem driver (pcmpath,dlnkmgr):
   (this will put into Disabled state)
    -pcmpath set adapter 3 offline
    -dlnkmgr offline -hba 08.07

2. Put all the Disabled path to Defined:
    -for i in `lspath | grep Dis | grep fscsiX| awk '{print$2}'`; do rmpath -l $i -p fscsiX; done

3. If there are other paths still in Enabled or Failed state put them into Defined:
    -rmpath -l hdisk9 -p fscsi1

4. Remove all devices from ODM from the mentioned adapter:
    -rmdev -Rl fcs2
    -lsdev -p fscsi2    <--should not show the disks

5. Change the adapter settings
    -chdev -l fscsi1 -a dyntrk=yes -a fc_err_recov=fast_fail
    -chdev -l fcs1 -a init_link=pt2pt

6. Config:
    -cfgmgr

STORAGE - HP EVA

HP EVA STORAGE SYSTEM: (Enterprise Virtual Array)

Device driver:
devices.chrp.IBM.HPS.rte                   - IBM eServer pSeries High Performance Switch (HPS) Runtime
devices.chrp.IBM.HPS.hpsfu                 - IBM pSeries HPS Functional Utility
devices.fcp.disk.HP.hsv.mpio.rte           - ODM definitions for HP Enterprise Virtual Array disk devices

Some commands are under: /opt/hphsv/bin/

# lshsv     -> list
# rmhsv     -> remove a device
# lshba     -> HBA details
# lbhsv     -> load balance
# hsvpaths  -> list paths of hdisk


-------------------------------


SSA:

these are usually pdisks:
pdisk is a phisycal SSA disk, one or many pdisk may reprsent a hdisk on te system, according to the RAID used

ssaxlate -l hdisk2    shows which pdisk is represented by hdisk2
ssaxlate -l pdisk0    shows which hdisk is pdisk0

smitty ssaraid      

diag -> task selection -> ssa service aids -> link verification    (it is checking the ssa adapter)
diag -> advanced diagnostics routines -> system verification ...

STORAGE - BASICS

Basics - Settings

lsdev -Cc disk             shows what kind of disks we have: SCSI, SSA, ESS, HITACHI, Virtual disks                   

hdisk0  Available 40-60-00-4,0 16 Bit LVD SCSI Disk Drive                  <-SCSI
hdisk2  Available 30-68-L      SSA Logical Disk Drive                      <-SSA
hdisk0  Available 01-08-00      SAS Disk Drive                             <-SAS

hdisk9  Available 2D-08-01     IBM FC 2105                                 <-ESS
vpath0  Available              Data Path Optimizer Pseudo Device Driver    <-ESS

hdisk2  Available 1n-08-02     Hitachi Disk Array (Fibre)                  <-HITACHI
dlmfdrv0 Available             HDLM Driver                                 <-HITACHI

hdisk6  Available 03-00-01      EMC CLARiiON FCP RAID 1/0 Disk             <-EMC

hdisk2  Available 07-08-02     HP HSV210 Enterprise Virtual Array          <-HP EVA

hdisk0  Available           Virtual SCSI Disk Drive                        <-VIRTUAL DISK




bootinfo -s    hdisk5        shows the size of the disk
lscfg -vl hdisk0             displays configuration, diagnostic, and vital product data
lsattr -El hdisk6            shows attributes of hdisk6. If MPIO disk you can change these values with:

mkdev -c disk -t 1200mb -s scsi -p scsi0 -w 6,0 -d creates a dummy hdisk (if it is needed to correct the sequence numbers)
mkdev -l hdiskX -p dummy -c disk -t hdisk -w 0000  the same as above (for me gave error, but created it)


root@aix31:/ # lsattr -El hdisk6
PCM             PCM/friend/sddpcm                PCM                                     True
PR_key_value    none                             Reserve Key                             True    <-PR_key value
algorithm       load_balance                     Algorithm                               True    <-path selection algorithm (round robin...)
clr_q           no                               Device CLEARS its Queue on error        True
dist_err_pcnt   0                                Distributed Error Percentage            True
dist_tw_width   50                               Distributed Error Sample Time           True
hcheck_interval 60                               Health Check Interval                   True    <-how often the paths should be health-checked
hcheck_mode     nonactive                        Health Check Mode                       True    <-health check
location                                         Location Label                          True
lun_id          0x5105000000000000               Logical Unit Number ID                  False
lun_reset_spt   yes                              Support SCSI LUN reset                  True
max_transfer    0x40000                          Maximum TRANSFER Size                   True
node_name       0x5005076300c0a1df               FC Node Name                            False
pvid            005dd06a948b72f50000000000000000 Physical volume identifier              False
q_err           yes                              Use QERR bit                            True
q_type          simple                           Queuing TYPE                            True
qfull_dly       20                               delay in seconds for SCSI TASK SET FULL True
queue_depth     20                               Queue DEPTH                             True
reserve_policy  no_reserve                       Reserve Policy                          True    <-reserve policy (PR_reserved...)
rw_timeout      60                               READ/WRITE time out value               True
scbsy_dly       20                               delay in seconds for SCSI BUSY          True
scsi_id         0xc0b00                          SCSI ID                                 False
start_timeout   180                              START unit time out value               True
unique_id       1D081052567107210580003IBMfcp    Device Unique Identification            False
ww_name         0x5005076300cca1df               FC World Wide Name                      False

algorithm:
pcmpath set device algorithm or chdev -l hdiskX -a algorithm=round_robin

reserve_policy:
chdev -l hdiskX -a reserve_policy=no_reserve
no_reserve: Input/Output can be sent from all the pahts of the MPIO device. This is the default for SDDPCM
        For HDLM: Ignores a reservation and does not reserve a LUN (for VIO and RAC this is needed)

exclusive host access: only 1 path can be selected with fail_over. When the active path fails, thealternative path is selected
        PR_exclusive: a uniques PR_key is set for this host. Other hosts with different PR_key cannot access.
        I/O is routed to all path of the MPIO device, because all paths are registered with the same PR_key.
        In a non-concurrent HACMP environment this should be selected.

PR_shared:
A PR_key is registered, but it can be accessed by other hosts.
        In a concurrent HACMP environment this should be used.
        (chdev -l hdiskX -a PR_key_value=0x1234 -a reserve_policy=PR_shared)

The default attribute of reserve_policy of the hdlm driver is PR_exclusive. This is set automatically during cfgmgr to the ODM. Because of the virtualisation requirements, we have to change it to “no_reserve”. So the chdev command sets a SCSI reservation(PR_exclusive) to change the attribute. All LPARs, which are writing exact at this moment to this disk will receive not-recoverable errors (The virtualisation disk outage from 22.10.2009).


hcheck_mode:
pcmpath set device hc_mode or chdev -l hdiskX -a hc_mode=failed
enabled: health checking paths that are opened
failed: health checking path that are in failed state
nonactive: this is the default, will check paths that have non active I/O (this includes paths that are opened or in failed state)

hcheck_interval:
pcmpath set device hc_interval or chdev -l hdiskX -a hc_interval=0
0: health check function is disabled
60: it is the default (max: 3600)

This is the SDDPCM internal health check, but SDDPCM server daemon does healthchecking as well. The SDDPCM server daemon only health check FAILED paths. It does not implement healthcheck on opened or idle paths as the SDDPCM internal healthcheck does.

queue_depth:
it is the number I/O requests each device can handle concurrently
In case of a Hitachi disk (HDLM), recommendation is to set this value greater than or equal to the number of the paths.


RAID LEVELS:


RAID 0+1 
    Fault tolerance with fast write performance
RAID 0        Fast writes
RAID 5        Fault tolerance

STORAGE - SAN

SAN (Storage Area Network)

When storage is not attached directly to a server (it is located remotely), the data can be accessed in 2 forms.
1. File access: All technologies that allow access to files over a network can be considered as NAS (Network Attached Storage). Filesystems are defined on external devices (on a NAS server) and these are shared using protocols like NFS (on Unix) or CIFS (on Windows).

2. Block access: It uses SCSI, and disk space is represented as a LUN. Several technologies are using this methond:
-SAN (Storage Area Network): The SCSI protocol is transferred by Fibre Channel.
-iSCSI (Internet SCSI): The SCSI protocol is transferrer over the TCP/IP network.
-FCoE (FC over Ethernet): SCSI is transmitted by FC, which are encapsulated in Ethernet frames. (Ethernet is lower layer than TCP/IP)
-FCIP (Fibre Channel over IP): The SCSI protocol is transmitted in Fibre Channel frames over a TCP/IP network.

------------------------------------------

SAN

SAN is a network of storage devices and switches, which are connected to the servers. Each server can access the storage as if it were directly attached to that server. When a server wants to access a storage device on the SAN, it sends out a request, which consists of SCSI commands encapsulated into FC packets. This request is accepted by the HBA and is converted from binary form to optical form according to the rules of FC protocol.  The HBA transmits the request to the SAN. Depending on the cabling, one of the SAN switches receives this request and sends it to the storage processor, which sends it to the storage device.

SAN components at Server:
HBA: It is located in the server, and it performs digital‐to‐optical signal conversion. Each server connects to the SAN through its HBAs.
HBA driver: It is running on the servers, so the operating system can communicate with the HBA.

SAN components at Storage:
Storage Processor (SP): Storage arrays include SPs. SPs communicate with the disk array and provide the RAID/LUN functionality.
(A storage controller (also known as "storage processor" or "array controller") is a device that controls storage arrays, e.g. IBM SVC.)
Disk array: A group of multiple disk devices, using RAID technology (RAID levels). Data is stored on disk arrays or on tape devices
LUN (Logical Unit): It is a single unit of storage, and it looks like from server side as a usual disk .

SAN components at Fabric:
Fabric is the hardware (switches, cables, routers) that connects servers to storage devices. SAN is usually divided into more fabrics (like Fabric A and Fabric B) to provide redundancy in case of component failures. SAN fabric consists of:
SAN Switch: connects servers to storage arrays, it makes path redundancy possible in the event of a path failure
Router: Servers can access SCSI disk or tape devices in the SAN through the data routers in the fabric layer. (It is a bridge device.)
Cables:  SAN cables are usually fiber optic cables that are used to connect all of the fabric components.
Communications Protocol: Fabric components communicate using the FC protocol.


------------------------------------------

Port:

A port is any entity that actively communicates over the network, like a storage port, an HBA port, or a switch port.

N_port is a port on the node (server or storage), also known as Node port.
F_port is a port on the switch that connects to a node (connects to an N_port), also known as Fabric port.
E_port is the connection between two switches, also known as an Expansion port.
EX_port is the connection between a router and a switch. (At switch side it is an E_port, but at router side it is an EX_port.)



FC topologies for connecting ports:
-Point-to-Point (FC-P2P): Two devices are connected directly to each other.
-Arbitrated loop (FC-AL): All devices are in a loop or ring, similar to token ring network. (A port failure causes a break in the ring.)
-Switched fabric (FC-SW): All devices are connected to switches.(Failure of a port does not affect other ports.)

------------------------------------------

WWN (World Wide Name) and WWPN  (World Wide Port Name)

Each device in the SAN is identified by a unique world wide name (WWN). Each N_Port has its own WWN (called the WWPN). WWPN is a unique identifier for a port on the HBA. The command lscfg (or fcstat) can show the WWPN of the HBA:

Checking WWPN:
# lscfg -vpl fcs* | grep Net
        Network Address.............100000109B21ABEC
        Network Address.............100000109B21ABED

A WWPN identifies the port of the adapter. In a dual port HBA, there will be 2 WWPNs (one for each port) and there will be one WWN for the card itself. (In below example the "1" is simply changed for "2")

# fcstat fcs0
FIBRE CHANNEL STATISTICS REPORT: fcs0
Device Type: 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
...
World Wide Node Name: 0x20000000C9A8C4A6
World Wide Port Name: 0x10000000C9A8C4A6

WWPNs are similar to MAC addresses in Ethernet network, and these are assigned by the manufatcturer, and these are guaranteed to be globally unique.

------------------------------------------

FC_ID (Port ID or port address)

WWPNs are only used in SAN until these are discoverd by the switches. There is a second type of address used in Fibre Channel which is a dynamically assigned address. It is called the Fibre Channel ID (FC_ID). FC_ID is assigned by the switch when the device logs into the fabric, and FC_ID is mapped to the WWPN. During data transfer in the SAN this FC_ID is used to address the correct device. You can think of WWN's as MAC addresses and FC_ID as the layer3 IP addresses. This port ID is valid only while the device is logged on.

# fcstat fcs0
FIBRE CHANNEL STATISTICS REPORT: fcs0
...
Port FC ID: 0x212500


or # lsattr -El fscsi0
scsi_id      0x212500

21: Domain ID (switch id)
25: port id

------------------------------------------

Zoning

Zoning provides access control in the SAN. It defines which HBAs can connect to which SPs. When in a SAN switch zoning is configured, the devices outside a zone are not visible to the devices inside the zone. In addition, SAN traffic within each zone is isolated from the other zones. It is similar to VLANs in Ethernet networks. (You can have multiple ports to the same SP in different zones to reduce the number of presented paths. )

------------------------------------------

LUN Mapping and Masking

Mapping means making devices visible on a storage port. For example, if the LUN address is defined on the director as F0 in hex (240 decimal), the host will discover the device as LUN 240. Masking means not allowing all attached (= zoned) hosts to see everything on that storage port. Only the masked wwns can see the LUNs. (like a firewall on a network)

As an example, first we can map 10 logical devices to the storage port,then we perform masking so that host1 can see 3 of the logical devices, and host2 can see another 7 of the logical devices.

With this configuration multiple access paths can be created to a given LUN. Below example shows 4 paths to hdisk0, 2 paths per HBA. This means that a single port on the server side communicates with 2 ports on the storage side.

# lspath | grep hdisk0
Enabled hdisk0 fscsi0
Enabled hdisk0 fscsi0
Enabled hdisk0 fscsi1
Enabled hdisk0 fscsi1

------------------------------------------


STORAGE - SDD

SDD (subsystem device driver):    
It designed to support the multipath configuration in the ESS.
The software used to balance ESS I/O traffic across all adapters. It provides multiple access to data from the host.
when using sdd cfgmgr is run 3 times (cfgmgr -l fcs0, cfgmgr -l fcs1, cfgmgr (the third one builds the vpaths))   

3 policies exist for load balancing:
    -default: selecting the path with the least number of current I/O operations
    -round robin: choosing the path, that was not used for the last operation (alternating if 2 pathes exist)
    -failover: all I/O sent ove the most preferred path, until a failure is detected.

SDDSRV:
SDD has a server daemon running in the background: lssrc/stopsrc/startsrc -s sddsrv   
If sddsrv is stopped, the feature that automatically recovers failed paths disabled.

vpath:
A logical disk defined in ESS and recognized by AIX. AIX uses vpath instead of hdisk as a unit of physical storage.
       
    root@aix40: /dev # lsattr -El vpath0
    active_hdisk  hdisk20/00527461/fscsi1          Active hdisk                 False
    active_hdisk  hdisk4/00527461/fscsi0           Active hdisk                 False
    policy        df                               Scheduling Policy            True    <-path selection policy
    pvid          0056db9a77baebb90000000000000000 Physical volume identifier   False
    qdepth_enable yes                              Queue Depth Control          True
    serial_number 00527461                         LUN serial number            False
    unique_id     1D080052746107210580003IBMfcp    Device Unique Identification False
   
    policy:
    fo: failover only - all I/O operations sent to the same paths until the path fails
    lb: load balancing - the path is chosen by the number of I/O operations currently in process
    lbs: load balancing sequential - same as before with optimization for sequential I/O
    rr: round ropbin - path is chosen at random from the not used paths
    rrs: round robin sequential - same as before with optimization for sequential I/O
    df: default - the default policy is load balancing

    datapath set device N policy        change the SDD path selection policy dynamically

DPO (Data Path Optimizer):
it is a pseudo device (lsdev | grep dpo), which is the pseudo parent of the vpaths

    root@aix40: / # lsattr -El dpo
    SDD_maxlun      1200 Maximum LUNS allowed for SDD                  False
    persistent_resv yes  Subsystem Supports Persistent Reserve Command False

--------------------------------

software requirements for SDD:
-host attachment for SDD (ibm2105.rte, devices.fcp.disk.ibm.rte) - this is the ODM extension
The host attachments for SDD add 2105 (ESS)/2145 (SVC)/1750 (DS6000)/2107 (DS8000) device information to allow AIX to properly configure 2105/2145/1750/2107 hdisks.
The 2105/2145/1750/2107 device information allows AIX to:
        - Identify the hdisk(s) as a 2105/2145/1750/2107 hdisk.
        - Set default hdisk attributes such as queue_depth and timeout values.
        - Indicate to the configure method to configure 2105/2145/1750/2107 hdisk as non-MPIO-capable devices
   
    ibm2105.rte: for 2105 devices
    devices.fcp.disk.ibm.rte: for DS8000, DS6000 and SAN Volume Controller)

-devices.sdd.53.rte - this is the driver (sdd)
    it provides the multipath configuration environment support


--------------------------------

addpaths                  dynamically adds more paths to SDD vpath devices (before addpaths, run cfgmgr)
                          (running cfgmgr alone does not add new paths to SDD vpath devices)
cfgdpo                    configures dpo
cfgvpath                  configures vpaths
cfallvpath                configures dpo+vpaths
dpovgfix <vgname>         fixes a vg that has mixed vpath and hdisk physical volumes       
extenfvg4vp               this can be used insteadof extendvg (it will move pvid from hdisk to vpath)

datapath query version    shows sdd version
datapath query essmap     shows vpaths and their hdisks in a list
datapath query portmap    shows vpaths and ports
---------------------------------------
datapath query adapter    information about the adapters
    State:
        -Normal           adapter is in use.
        -Degraded         one or more paths are not functioning.
        -Failed           the adapter is no longer being used by SDD.

datapath query device     information about the devices 8datapath query device 0)
    State:
        -Open             path is in use
        -Close            path is not being used
        -Failed           due to errors path has been removed from service
        -Close_Failed     path was detected to be broken and failed to open when the device was opened
        -Invalid          path is failed to open, but the MPIO device is opened
---------------------------------------
datapath remove device X path Y   removes path# Y from device# X (datapath query device, will show X and Y)
datapath set device N policy      change the SDD path selection policy dynamically
datapath set adapter 1 offline

lsvpcfg                           list vpaths and their hdisks
lsvp -a                           displays vpath, vg, disk informations

lquerypr                          reads and releases the persistent reservation key
lquerypr -h/dev/vpath30           queries the persistent resrevation on the device (0:if it is reserved by current host, 1: if another host)
lquerypr -vh/dev/vpath30          query and display the persistent reservation on a device
lquerypr -rh/dev/vpath30          release the persisten reservation if the device is reserved by the current host
                                  (0: if the command succeeds or not reserved, 2: if the command fails)
lquerypr -ch/dev/vpath30          reset any persistent reserve and clear all reservation key registrations
lquerypr -ph/dev/vpath30          remove the persisten reservation if the device is reserved by another host
---------------------------------------

Removing SDD (after install a new one):
-umount fs on ESS
-varyoffvg
(if HACMP and RG is online on other host: vp2hd <vgname>) <--it converts vpaths to hdisks)
-rmdev -dl dpo -R                                         <--removes all the SDD vpath devices
-stopsrc -s sddsrv                                        <--stops SDD server
-if needed: rmdev -dl hdiskX                              <--removes hdisks
(lsdev -C -t 2105* -F name | xargs -n1 rmdev -dl)

-smitty remove -- devices.sdd.52.rte
-smitty install -- devices.sdd.53.rte (/mnt/Storage-Treiber/ESS/SDD-1.7)
-cfgmgr
---------------------------------------

Removing SDD Host Attachment:
-lsdev -C -t 2105* -F name | xargs -n1 rmdev -dl          <--removes hdisk devices
-smitty remove -- ibm2105.rte (devices.fcp.disk.ibm)
---------------------------------------

Change adapter settings (Un/re-configure paths):

-datapath set adapter 1 offline
-datapath remove adapter 1
-rmdev -Rl fcs0
(if needed: for i in `lsdev -Cc disk | grep -i defined | awk '{ print $1 }'`; do rmdev -Rdl $i; done)
-chdev -l fscsi0 -a dyntrk=yes -a fc_err_recov=fast_fail
-chdev -l fcs0 -a init_link=pt2pt
-cfgmgr; addpaths
---------------------------------------

Reconfigure vpaths:
-datapath remove device 2 path 0
-datapath remove device 1 path 0
-datapath remove device 0 path 0
-cfgmgr; addpaths
-rmdev -Rdl vpath0
-cfgmgr;addpaths
---------------------------------------

Can't give pvid for a vpath:
root@aix40: / # chdev -l vpath6 -a pv=yes
Method error (/usr/lib/methods/chgvpath):
        0514-047 Cannot access a device.

in errpt:DEVICE LOCKED BY ANOTHER USER
        RELEASE DEVICE PERSISTENT RESERVATION



# lquerypr -Vh /dev/vpath6          <--it will show the host key
# lquerypr -Vph /dev/vpath6         <--it will clear the reservation lock
# lquerypr -Vh /dev/vpath6          <--checking again will show it is OK now

STORAGE - MPIO

MPIO (Multipath I/O):


Multipathing

A path describes a route from the HBA port in the host (through the switches in the fabric) into a storage port on the storage array. When more than one HBA ports are cabled, a host can access a LUN through more than one path, which is called multipathing. If any of the components along the path fails, the server selects another path. The process of detecting a failed path and switching to another path is called path failover. 

In general 4 or 8 paths per disk is recommended, (or up to 16 paths for rare situations.) Extra, unnecessary redundancy could have some negative effect (each paths takes extra memory, error recovery could take longer)

Patch Control Module (PCM): It is responsible for controlling multiple paths. Each storage device requires a PCM. PCM is a storage vendor supplied code that handles path management.  It can be a separate (3rd party) software (driver) or AIX has a native PCM package, which comes with the base operating system, which is sometimes called AIXPCM, MPIOPCM or just MPIO.

--------------------------------------------------------

AIX multipathing and MPIO history

At the end of the 90s and early 2000 SAN and FC technology got more popular and storage vendors (EMC, Hitachi, IBM...) came up with their own multipathing solutions. IBM developed SDD. With SDD each path was called hdisk and on top of these a "super device" (vpath) has been created to do path management. It was capable of path failover and load balancing, but with the increased number of hdisks and vpath devices the maintenance was a bit complex. Around 2002 AIX 5.2 has introduced a new feature called MPIO. Without installing any 3rd party or vendor filestes and without creating extra hdisks devices, the new AIX MPIO feature was capable of discovering multiple paths. It recognized that these paths belonged to the same LUN (hdisk), so only one hdisk device was created. It made administration easier, but it was lacking some capabilites, for example load-balancing. To solve this problem IBM created the SDDPCM package (for IBM storage), which was based on MPIO and it was capable for load-balancing. SDDPCM was very popular, but during the years the default AIX MPIO was also getting better and better, until it reached all the capabilities of SDDPCM, so IBM decided to withdraw SDDPCM from the market in 2020.



Before AIX 5.2 to use multipathing, storage vendor codes were needed, for example IBM provided the SDD package. Since AIX 5.2, a default AIX installation is capable for path management and this feature is called MPIO (MPIO is an acronym for Multipath I/O, which is a mutlipathing solution.) MPIO allows a disk to have multiple paths, but it has only 1 entry per hdisk in the ODM. With MPIO design, the path management is off-loaded from the disk driver to an AIX kernel extension called: PCMKE (Path Control Module Kernel Extension). The reason to have a separate PCMKE is to make it easier for disk vendors, such as EMC, Hitachi or IBM, to adopt the AIX MPIO solution. Additionally 4 new AIX commands have been added to AIX 5.2 to manage the device paths: mkpath, rmpath, lspath, chpath.  In AIX 7.1 TL3 a new command: lsmpio, has been introduced. This command is similar to lspath, but displays additional information about the MPIO storage devices.

UDID (Unique device identifier)
Every MPIO-capable device must provide a unique identifier that allows the device to be distinguished from any other device in the system. It is called UDID . When the cfgmgr command runs, it requests the UDID for the device and it is compared with the UDIDs stored in ODM to determine if a newly discovered device needs to be defined or the device already exists and only a new path needs to be defined.

--------------------------------------------------------

ODM Update

The AIX MPIO infrastructure allows IBM or third-party storage vendors to supply ODM definitions, which are often referred to as a host attachment kit. A host attachment fileset from the disk vendor is needed to update the ODM to support a specific storage, then AIX can recognize and appropriately configure the disk. Without this, disks are configured using generic ODM definitions. Based on the host attachment filesets disks will be configured as MPIO or non-MPIO devices.

For example if we have a 3rd party storage (like Hitachi or EMC), and we don't install any additional packages, then probably AIX will detect disks as "Other FC SCSI Disk Drive". A device will be discovered as an "MPIO other FC device" only if the device has been certified with one of the AIX default PCMs and no vendor-provided ODM definitions have been installed.  Certification does not guarantee that all device capabilities can be used. (Usually only fail_over is possible but no round_robin or load_balancing.) After the ODM is updated, and the host attachment contained MPIO definitions, the device will be discovered as an MPIO device (for example EMC storage could look like "EMC MPIO FC disks") and one of the AIX PCMs can do the path management. If host attachment contained non-MPIO definitions, then disks will be recognized as non-MPIO (like "EMC CLARiiON FCP RAID 1/0 Disk") and the vendor supplied driver needs to be installed for path management. After the ODM update, the newly discoverd disks will have vendor configured default values (like queue_depth, reserve_policy etc.)

--------------------------------------------------------

MPIO disk settings
https://developer.ibm.com/articles/au-aix-mpio/

# lsattr -El hdisk15
PCM             PCM/friend/fcpother         Path Control Module              False
PR_key_value    none                        Persistant Reserve Key Value     True+
algorithm       round_robin                 Algorithm                        True+
clr_q           no                          Device CLEARS its Queue on error True
dist_err_pcnt   0                           Distributed Error Percentage     True
dist_tw_width   50                          Distributed Error Sample Time    True
hcheck_cmd      inquiry                     Health Check Command             True+
hcheck_interval 60                          Health Check Interval            True+
hcheck_mode     nonactive                   Health Check Mode                True+
...
...
timeout_policy  retry_path                  Timeout Policy                   True+
unique_id       2611200173800005102BE072810XIV03IBMfcp Unique device identifier  False
ww_name         0x500173800051019           FC World Wide Name               False

--------------------

algorithm: (determines how I/O should be distributed across the paths)
- fail_over: I/O is distributed to one path at a time, if it fails next enabled path is selected, depending on path priority.
           VSCSI disks use fail_over, if SCSI-2 reserves is used (reserve_policy=single_path) fail_over is the only possible algorithm.
           By default,  priority is set to 1 (highest priority) and it can range from 1 to 255 (which is the lowest priority).
           set priority: # chpath -l hdisk1 -a priority=255 -p fscsi0 -w 20080022a10bb2d5,1000000000000
           check priority # lspath -l hdisk1 -a priority -F value -p fscsi0 -w 20080022a10bb2d5,1000000000000
   
- round_robin: I/O is distributed to all enabled paths. Paths with same prio. has equal I/O, otherwise higher prio. path utilized more
           To achieve optimal performance during failure, make sure the ordered path list alternate paths between separate fabrics.

- shortest_queue: Similar to round_robin, but when load increases it favors path with fewest I/O  and path priority is ignored.
           If one path is slow (congestion in the SAN), other less-congested paths are used for more I/O

If using SCSI-2 reserves or vSCSI disks, then fail_over must be used. For other situations, shortest_queue (if available) or round_robin enable maximum use of the SAN resources.

--------------------

hcheck_cmd: (the command that will be sent to the disk for healthcheck)
- test_unit_rdy: Test Unit Ready (TUR) command, this is the default setting
- inquiry: In clustered environments with this can have greater control of SCSI reserve and release

In general the default setting should be used, but if there are reservation locks on the disks, use the inquiry option. If test unit ready is used and the backing device is reserved, then test unit ready fails and log an error on the client.

--------------------

hcheck_mode: (determines which paths will be tested by the health checker. Disabled or Missing paths are never checked
(Disabled paths must be recovered manually with chpath, Missing paths with cfgmgr first. If disk is not open (VG is varied off), nohealth checking is done.)

- nonactive: paths with no active I/O are checked (or paths in failed state).
(At round_robin and shortest_queue all paths are busy, so only failed paths are checked. If disk is idle then any paths can be checked (without a pending I/O.))

- enabled: The PCM checks all enabled paths, even paths that have other active I/O

- failed:  PCM checks paths that are marked as failed.

The default value is nonactive, and most of the cases this should not be changed.

--------------------

hcheck_interval:  (interval, in seconds, at which MPIO checks path availability).

- hcheck_interval=0:  disables health check mechanism, any failed paths need to be recovered manually

- hcheck_interval=(small value): the health check commands use the disk’s queue_depth and they receive a higher priority than normal I/O, so a small health check interval can quickly use up a lot of bandwidth on the SAN if there are a large number of disks.

If a device has only one non-failed path and an error is detected on that last path, AIX will send a health check command on all failed paths before retrying the I/O. If there are good paths to use, AIX will discover it and uses it before failing user I/O, regardless of the health check interval setting.

So, for most cases, the default value is appropriate and the general rule for hcheck_interval is, that it should be greater than or equal to rw_timeout. It is much more likely to be a good idea to increase the health check interval than to decrease it. Better performance is achieved when hcheck_interval is slightly greater than the rw_timeout value on the disks.

https://support.purestorage.com/Solutions/IBM/AIX/AIX_Recommended_Settings
PureStorage ODM definition sets hcheck_interval setting to 10 as opposed to IBM recommendation of 30. hcheck_interval setting is set to lower value than the rw_timeout as we are not checking active paths and a lower hcheck_interval will not have any SAN performance impact.

--------------------

timeout_policy: (when an I/O operation fails to complete within the rw_timeout value, what action PCM should take)

- retry_path: command is retried on the same path. This is likely to lead to delays in the I/O recovery.
        (Only after several failures will AIX fail the path and try the I/O on an another path.)

- fail_path:  AIX will fail the path after a single command timeout. Failing the path forces the I/O to be retried on a different path.
         With this setting recovery can be quicker and also the detection of a situation where all paths have failed is also quicker.
         A path that is failed due to timeout policy can later be recovered automatically by the AIX health check commands.

- disable_path: path will be disabled after a single command timeout. Disabled path can be recovered only manually (chpath)

The recommended setting is fail_path.

--------------------------------------------------------

Active/Passive paths

A Storage Processor or Storage Controller manages or controls the disk array at storage side. Many storage arrays have two or more controllers (Storage Processors) and connecting HBA ports to each controllers protects against controller failures. A device that has multiple controllers can designate one controller as the active or preferred controller. For such a device, the PCM uses just the paths to the active or preferred controller as long as there is at least one such path that is enabled and not failed.

Disk arrays can be:
- active/active: it allows access to the LUNs simultaneously through all the storage processors. All the paths are active at all times.
- active/passive: one SP is actively servicing a given LUN. The other SP acts as backup for the LUN (and may be actively serving other LUN I/O).

--------------------------------------------------------

manage_disk_drivers

manage_disk_drivers lists storage models and their drivers. These drivers can be AIX MPIO (like AIX_AAPCM or AIX_APPCM) and non MPIO drivers, when a third-party mulitpath driver is installed. In this case the AIX MPIO feature can be disabled by selecting the AIX_non_MPIO option. (AAPCM means Active/Active and APPCM means Active/Passive)

# manage_disk_drivers -l
Device              Present Driver        Driver Options   
2810XIV             AIX_AAPCM             AIX_AAPCM,AIX_non_MPIO
DS4100              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS4200              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS4300              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS4500              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS4700              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS4800              AIX_APPCM             AIX_APPCM,AIX_fcparray
DS3950              AIX_APPCM             AIX_APPCM
DS5020              AIX_APPCM             AIX_APPCM
DCS3700             AIX_APPCM             AIX_APPCM
DS5100/DS5300       AIX_APPCM             AIX_APPCM
DS3500              AIX_APPCM             AIX_APPCM
XIVCTRL             MPIO_XIVCTRL          MPIO_XIVCTRL,nonMPIO_XIVCTRL
2107DS8K            NO_OVERRIDE           NO_OVERRIDE,AIX_AAPCM,AIX_non_MPIO
IBMFlash            NO_OVERRIDE           NO_OVERRIDE,AIX_AAPCM,AIX_non_MPIO
IBMSVC              NO_OVERRIDE           NO_OVERRIDE,AIX_AAPCM,AIX_non_MPIO


NO_OVERRIDE:
The "NO_OVERRIDE" option (as a Present Driver) indicates that the configuration is not overridden by using "manage_disk_drivers -d (device) -o...". If SDDPCM is installed it will substitue AIX MPIO driver for SVC, DS8k (that is why it is not listed by manage_disk_drivers), and by default SDDPCM takes precedence. In this case NO_OVERRIDE would mean SDDPCM will be used (we did not override it by a manual change). If SDDPCM is not installed, then the AIX default PCM is used.

# manage_disk_drivers -d IBMSVC -o AIX_AAPCM     <---use the AIX default PCM even if SDDPCM is installed
# manage_disk_drivers -l                         <--after reboot, AIX PCM is in control (not SDDPCM, which can be uninstalled now)
Device              Present Driver        Driver Options
IBMSVC              AIX_AAPCM             NO_OVERRIDE,AIX_AAPCM,AIX_non_MPIO

Changing the driver will reset disk attributes (queue_depth, algorithm, reserve_policy..) to the new default values of the new driver.

--------------------------------------------------------

lsmpio

The command lsmpio was introduced in AIX 7.1 TL3, and it displays information about the MPIO storage devices (those devices which are controlled by PCM). It is similar to lspath, but with much more details.

# lsmpio -l hdisk1234
name   path_id status  path_status     parent connection
===============================================================================
hdisk1234  0   Enabled Opt,Sel,Deg,Rsv fscsi0 500a098186a7d4ca,0008000000000000
hdisk1234  1   Enabled Non             fscsi0 500a098196a7d4ca,0008000000000000
hdisk1234  2   Enabled Opt,Sel         fscsi1 500a098186a7d4ca,0008000000000000
hdisk1234  3   Enabled Non             fscsi1 500a098196a7d4ca,0008000000000000


status: (same as with lspath)
enabled:   path is configured and operational. It will be considered when paths are selected for IO.
disabled:  path has been manually disabled and won't be considered when paths are selected for IO. (set back to enabled with 'chpath')
failed:    path is unusable due to IO failures. It won't be selected for IO. (after problem is fixed, remove path and rediscover it)
defined:   path is not configured and used for io operation (rmpath -l will explicitly turn path off)
missing:   path was not detected after reboot, but it was there earlier in the system (these can be recovered with 'cfgmgr')
detected:  path was detected during boot, but it was not configured (this status should never appear, only during boot)

It is best to manually disable paths before storage maintenance (rmpath). AIX MPIO stops using any disabled or Defined paths, so no error detection or recovery will be done. This ensures that the AIX host does not go into extended error recovery during a scheduled maintenance. After the maintenance is complete, the paths can be re-enabled with cfgmgr. (When disabling multiple paths for multiple LUNs, rmpath is simpler than chpath, as it does not have to be run on a per-disk basis.)

path_status: (more detailed path status)
Opt - optimized path: preferred path, which is attached to a preferred controller. PCM selects preferred paths whenever possible.
Non - non-optimized path: this path is not considered as preferred path. PCM avoids this path, unless all preferred paths fail.
Act - active path: (on a device that has active and passive controllers) the PCM selects active paths for I/O operations.
Pas - passive path: (on a device that has active and passive controllers) the PCM avoids the selection of passive paths.
Sel - selected path: this path is selected for I/O operations when lsmpio command was issued.
Rsv - reservation conflict: could be that multiple hosts accessing the same disk
Fai - failure: path experienced a failure. (If status is Enabled and Fai: MPIO leaves one path in Enabled state, even when all paths have errors.)
Deg - degraded: there were errors, which causing to temporarily avoid to use this path. (Additional errors can cause path to fail)
Clo - closed: if all paths are closed, the device is closed.  If some paths are closed, then those had errors and MPIO tries to periodically recover those.

--------------------------------------------------------

smitty mpio
genkex | grep pcm                    show loaded pcm (like /usr/lib/drivers/sddpcmke)

lspath                                lists paths (lspath -l hdisk46)
lspath -l hdisk0 -HF "name path_id parent connection path_status status"    more detailed info about a device (like lsdev for devices)
lspath -AHE -l hdisk0 -p vscsi0 -w "810000000000"    display attrib. for given path and connection (-w) (-A is like lsattr for devices)
                                      (if only 1 path exist to parent device connection can be omitted: lspath -AHE -l hdisk0 -p vscsi0)
lspath -l hdisk1 -a priority -F value -p fscsi0 -w 20080022a10bb2d5,1000000000000  check priority

chpath                                changing path state (enabbled, disabled)
chpath -s enabled -l hdisk -p vscsi0  it will set the path to enabled status
chpath -l hdisk1 -a priority=255 -p fscsi0 -w 20080022a10bb2d5,1000000000000     change priority

rmpath -l hdiskX -p vscsi0 -w 870000000000   put path in defined state  (-w can be omitted if only 1 path exist to parent device)
rmpath -dl hdiskX -p fcsiY           dynamically remove all paths under a parent adapter from a supported storage MPIO device
                                     (-d: deletes, without it puts it to define state)
                                     (The last path cannot be removed, the command will fail if you try to remove the last path)

mkpath ...                            makes a path into Available state

lsmpio                                lists addtional info about paths (which path is selected)
lsmpio -o                             shows up-to-date path state (if failed path is OK now, will change to enable, same as chpath)
lsmpio -q                             shows disks with its size
lsmpio -ql hdiskX                     shows disk serial number (LUN ID)
lsmpio -Sl hdisk0 | grep Path         shows path statistics (which path was used mostly in the past)
lsmpio -ar                            list parent adapter and remote port information (-a: adapter (local), -r: remote port)
lsmpio -are                           list error statistics for local and remote (-e: error)
lsmpio -z                             reset statistics

While checking errors in lsmpio -are:
If 1 HBA shows error on all remote storage ports (but other HBA has no errors), then it is a problem with the adapter, cable or switch.
If 2 HBAs show errors on 1 particular storage port, then the error is at the storage port side (or the cable or the switch port.)
If 2 HBAs show erros on the same number of storage ports, then most likely switch has errors (probably at the ISL (inter switch link) between switches)

--------------------------------------------------

Failed path handling:
(there were Hitachi disks in Offline (E) state, but they were not unconfigured earlier)
    -lspath | grep -v Enab
    -rmpath -p fscsiX -d
    -cfgmgr -l fcsX
    -lspath | grep -v Enab
    -dlnkmgr view -lu -item

--------------------------------------------------

Change adapter setting online:

rmpath -d -p vscsi0                             <--removes all paths from adapt. (rmpath -dl hdisk0 -p vscsi0, it removes only specified path)
rmdev -l vscsi0                                 <--puts adapter into defined state
chdev -l vscsi0 -a vscsi_err_recov=fast_fail    <--change adapter setting (if -P is used it will be activated after reboot)
cfgmgr -l vscsi0                                <--configure back adapter

--------------------------------------------------------

SDDPCM migration to AIX PCM
https://www.ibm.com/support/pages/migrate-aixpcm-using-managediskdrivers-command>

Below steps should be done during downtime when no application is using the disks.
If the disks are shared among multiple nodes in a cluster or VIOS configuration, the reservation policy must be checked and changed before the disk is opened. If this is not changed, other nodes in the cluster or VIOS configuration will lose access to the shared disks until the reservation policy is changed.

lsattr -El hdiskX                               <--check current disk attributes (save output) (lsmpio should not work at this point)
manage_disk_drivers -l                          <--list disk drivers
manage_disk_drivers -d IBMSVC -o AIX_AAPCM      <--switching disk driver to MPIO (manage_disk_drivers -l will show new value)
shutdown -Fr                                    <--reboot
lsattr -El hdiskX                               <--check new value (lsmpio should work now)
chdev -P -l hdisk0 -a queue_depth=X -a reserve_policy=no_reserve  <--set back needed values for disks
chdef -a reserve_policy=no_reserve -c disk -s fcp -t mpioosdisk   <--set predefined values in ODM (or chdef -a reserve_policy=no_reserve -c disk -s fcp -t aixmpiods8k)
shutdown -Fr                                    <--reboot
installp -u devices.fcp.disk.ibm.mpio.rte devices.sddpcm.72.rte  <--remove host attachment and sddpcm filesets (if sddpcm is removed both should be removed!!)
shutdown -Fr                                    <--reboot

Check again current and ODM settings to be sure SDDPCM removal did not overwrite something, because removing SDDPCM will set the queue to the default value of 20
If needed to roll back to SDDPCM: # manage_disk_drivers -d IBMSVC -o NO_OVERRIDE