FC ports that are not used and do not have a link should be deactivated, as these significantly extend the runtime of a series of commands and operations (e.g. LPM).
(Note: our LPAR tool is used in some examples, but the corresponding commands on the HMC or the virtual I / O server are always shown!)
Two 4-port FC adapters are in use on one of our virtual I / O servers (ms26-vio1):
$ lpar lsslot ms26-vio1
DRC_NAME DRC_INDEX IOPOOL DESCRIPTION
U78D3.001.XXXXXXX-P1-C49 21040015 none PCIe3 x8 SAS RAID Internal Adapter 6Gb
U78D3.001.XXXXXXX-P1-C7 2103001C none PCIe3 4-Port 16Gb FC Adapter
U78D3.001.XXXXXXX-P1-C2 21010021 none PCIe3 4-Port 16Gb FC Adapter
$
(HMC: lshwres -r io --rsubtype slot -m ms26 --filter lpar_names=ms26-vio1)
However, only 2 ports of the 8 ports are cabled:
$ vios lsnports ms26-vio1
NAME PHYSLOC FABRIC TPORTS APORTS SWWPNS AWWPNS
fcs0 U78D3.001.XXXXXXX-P1-C2-T1 1 64 64 3072 3072
fcs4 U78D3.001.XXXXXXX-P1-C7-T1 1 64 64 3072 3072
$
(VIOS: lsnports)
When working with the virtual I / O server, it is noticeable, that some of the commands have an unexpectedly long runtime and sometimes hang for a long time. Some example commands are given below, along with the measured runtime:
(0)padmin@ms26-vio1:/home/padmin> time netstat –cdlistats
…
Error opening device: /dev/fscsi1
errno: 00000045
Error opening device: /dev/fscsi2
errno: 00000045
Error opening device: /dev/fscsi3
errno: 00000045
Error opening device: /dev/fscsi5
errno: 00000045
Error opening device: /dev/fscsi6
errno: 00000045
Error opening device: /dev/fscsi7
errno: 00000045
real 1m13.56s
user 0m0.03s
sys 0m0.10s
(0)padmin@ms26-vio1:/home/padmin>
(0)padmin@ms26-vio1:/home/padmin> time lsnports
name physloc fabric tports aports swwpns awwpns
fcs0 U78D3.001.XXXXXXX-P1-C2-T1 1 64 64 3072 3072
fcs4 U78D3.001.XXXXXXX-P1-C7-T1 1 64 64 3072 3072
real 0m11.61s
user 0m0.01s
sys 0m0.00s
(0)padmin@ms26-vio1:/home/padmin>
(0)padmin@ms26-vio1:/home/padmin> time fcstat fcs1
Error opening device: /dev/fscsi1
errno: 00000045
real 0m11.31s
user 0m0.01s
sys 0m0.01s
(4)padmin@ms26-vio1:/home/padmin>
LPM operations also take significantly longer, since all FC ports are examined when searching for suitable FC ports for the necessary NPIV mappings. This can lead to delays in the range of minutes before the migration is finally started.
In order to avoid these unnecessarily long runtimes, FC ports that are not wired should not be activated. The fscsi device has the attribute autoconfig, with the possible values defined and available. By default, the value available is used, which means that the kernel configures and activates the device, even if it has no link, which leads to the waiting times shown above. If the autoconfig attribute is set to defined, the fscsi device is not activated, it then remains in the defined state.
The following example shows how to reconfigure the fscsi1 device:
$ vios chdev ms26-vio1 fscsi1 autoconfig=defined
$
(VIOS: chdev -dev fscsi1 -attr autoconfig=defined)
$
$ vios rmdev ms26-vio1 fscsi1
$
(VIOS: rmdev -dev fscsi1 –ucfg)
$
$ vios lsdev ms26-vio1 fscsi1
NAME STATUS PHYSLOC PARENT DESCRIPTION
fscsi1 Defined U78D3.001.XXXXXXX-P1-C2-T2 fcs1 FC SCSI I/O Controller Protocol Device
$
(VIOS: lsdev -dev fscsi1)
$
$ vios lsattr ms26-vio1 fscsi1
ATTRIBUTE VALUE DESCRIPTION USER_SETTABLE
attach none How this adapter is CONNECTED False
autoconfig defined Configuration State True
dyntrk yes Dynamic Tracking of FC Devices True+
fc_err_recov fast_fail FC Fabric Event Error RECOVERY Policy True+
scsi_id Adapter SCSI ID False
sw_fc_class 3 FC Class for Fabric True
$
(VIOS: lsdev -dev fscsi1 –attr)
$
With the autoconfig=defined attribute, the fscsi device remains defined even when the cfgmgr is run!
If one repeats the runtime measurement of the commands above, one can see that the runtime of the commands has already measurably improved:
(0)padmin@ms26-vio1:/home/padmin> time netstat –cdlistats
…
Error opening device: /dev/fscsi1
errno: 00000005
Error opening device: /dev/fscsi2
errno: 00000045
Error opening device: /dev/fscsi3
errno: 00000045
Error opening device: /dev/fscsi5
errno: 00000045
Error opening device: /dev/fscsi6
errno: 00000045
Error opening device: /dev/fscsi7
errno: 00000045
real 1m1.02s
user 0m0.04s
sys 0m0.10s
(0)padmin@ms26-vio1:/home/padmin>
(0)padmin@ms26-vio1:/home/padmin> time lsnports
name physloc fabric tports aports swwpns awwpns
fcs0 U78D3.001.XXXXXXX-P1-C2-T1 1 64 64 3072 3072
fcs4 U78D3.001.XXXXXXX-P1-C7-T1 1 64 64 3072 3072
real 0m9.70s
user 0m0.00s
sys 0m0.01s
(0)padmin@ms26-vio1:/home/padmin>
(0)padmin@ms26-vio1:/home/padmin> time fcstat fcs1
Error opening device: /dev/fscsi1
errno: 00000005
real 0m0.00s
user 0m0.02s
sys 0m0.00s
(4)padmin@ms26-vio1:/home/padmin>
The running time of the netstat command was shortened by 12 seconds, the lsnports command was about 2 seconds faster.
We now also set the autoconfig attribute to defined for all other unused FC ports:
$ for fscsi in fscsi2 fscsi3 fscsi5 fscsi6 fscsi7
> do
> vios chdev ms26-vio1 $fscsi autoconfig=defined
> vios rmdev ms26-vio1 $fscsi
> done
$
Now we repeat the runtime measurement of the commands again:
(0)padmin@ms26-vio1:/home/padmin> time netstat –cdlistats
…
Error opening device: /dev/fscsi1
errno: 00000005
Error opening device: /dev/fscsi2
errno: 00000005
Error opening device: /dev/fscsi3
errno: 00000005
Error opening device: /dev/fscsi5
errno: 00000005
Error opening device: /dev/fscsi6
errno: 00000005
Error opening device: /dev/fscsi7
errno: 00000005
real 0m0.81s
user 0m0.03s
sys 0m0.10s
(0)padmin@ms26-vio1:/home/padmin>
(0)padmin@ms26-vio1:/home/padmin> time lsnports
name physloc fabric tports aports swwpns awwpns
fcs0 U78D3.001.XXXXXXX-P1-C2-T1 1 64 64 3072 3072
fcs4 U78D3.001.XXXXXXX-P1-C7-T1 1 64 64 3072 3072
real 0m0.00s
user 0m0.01s
sys 0m0.01s
(0)padmin@ms26-vio1:/home/padmin> time fcstat fcs1
Error opening device: /dev/fscsi1
errno: 00000005
real 0m0.04s
user 0m0.00s
sys 0m0.00s
(4)padmin@ms26-vio1:/home/padmin>
The netstat command now takes less than 1 second, the lsnports command only 0.1 seconds.
It is therefore worthwhile to set the autoconfig attribute for unused FC ports to defined!