Which VIOS serves my
Virtual FC adapters?
Chris Gibson October 2021
Starting with AIX 7.2 TL5 SP3 (and VIOS 3.1.3.00), AIX/Power system administrators can use an alternative to kdb for viewing VIOS "identifying info" from client AIX LPAR’s. i.e.
#
cat /proc/sys/adapter/fc/fcs0/hostinfo
fcs0
VFC
client adapter name :
fcs0
Host
partition name (VIOS) : vio1
VFC
host adapter name :
vfchost0
VFC
host adapter location code :
U9009.22A.7871D00-V3-C7
FC
adapter name on VIOS :
fcs2
FC
adapter location code on VIOS : U78D3.001.WZS0AL9-P1-C8-T1
This will make tracking LPAR/VIOS changes during large migrations (for example, from P9 to P10 with LPM) a lot easier (and more reliable than kdb). It's a great addition.
This new feature is mentioned under the "VIOS Enhancements" section of the "PowerVM features in the new Power10 Servers" blog post from Pete Heyrman (from the IBM Power Hypervisor development team).
Under the /proc/sys/adapter/fc directory you'll find some new procfs entries for each virtual fibre channel (fcsX) adapter.
root@cgaix # oslevel -s
7200-05-03-2136
root@cgaix # cd /proc/sys/adapter/fc
root@cgaix /proc/sys/adapter/fc # ls -ltr
total
0
dr-xr-xr-x 7 root
system 0 Oct 04 16:13
fscsi3
dr-xr-xr-x 7 root
system 0 Oct 04 16:13
fscsi2
dr-xr-xr-x 7 root
system 0 Oct 04 16:13
fscsi1
dr-xr-xr-x 7 root
system 0 Oct 04 16:13
fscsi0
dr-xr-xr-x 3
root system 0 Oct 04 16:13 fcs3
dr-xr-xr-x 3 root
system 0 Oct 04 16:13
fcs2
dr-xr-xr-x 3 root
system 0 Oct 04 16:13
fcs1
dr-xr-xr-x 3 root
system 0 Oct 04 16:13
fcs0
In each of the fcsX directories you'll find a new entry named hostinfo.
root@cgaix /proc/sys/adapter/fc # cd fcs0
root@cgaix /proc/sys/adapter/fc/fcs0 # ls -ltr
total
0
prw-r--r-- 1 root
system 0 Oct 04 16:16 hostinfo
You can "cat" this file to determine which VIOS is serving your virtual fibre channel adapter.
root@cgaix /proc/sys/adapter/fc/fcs0 # cat hostinfo
VFC
client adapter name :
fcs0
Host
partition name (VIOS) : vio2
VFC
host adapter name : vfchost2
VFC
host adapter location code :
U9009.22A.7891CA0-V3-C16
FC
adapter name on VIOS :
fcs1
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C8-T1
You can "cat" each fcsX/hostinfo entry to capture all of the VIOS/vFC adapter info for your LPAR. You may wish to create a little shell script that can display this information, for each entry, quickly. For example:
root@cgaix /usr/local/bin # cat lsviofcs
myfcslist=`cd /proc/sys/adapter/fc ; ls -d fcs*`
for
i in $myfcslist
do
echo
$i
cat
/proc/sys/adapter/fc/$i/hostinfo
echo
done
root@cgaix / # lsviofcs
fcs0
VFC
client adapter name :
fcs0
Host
partition name (VIOS) : vio2
VFC
host adapter name : vfchost2
VFC
host adapter location code :
U9009.22A.7891CA0-V3-C16
FC
adapter name on VIOS :
fcs1
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C8-T1
fcs1
VFC
client adapter name : fcs1
Host
partition name (VIOS) : vio2
VFC
host adapter name :
vfchost3
VFC
host adapter location code :
U9009.22A.7891CA0-V3-C17
FC
adapter name on VIOS :
fcs2
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C8-T2
fcs2
VFC
client adapter name :
fcs2
Host
partition name (VIOS) : vio1
VFC
host adapter name :
vfchost2
VFC
host adapter location code : U9009.22A.7891CA0-V2-C18
FC
adapter name on VIOS :
fcs3
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C2-T1
fcs3
VFC
client adapter name :
fcs3
Host
partition name (VIOS) : vio1
VFC
host adapter name :
vfchost3
VFC
host adapter location code :
U9009.22A.7891CA0-V2-C19
FC
adapter name on VIOS :
fcs4
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C2-T2
It is worth noting that you can prevent this information from being available to the client LPAR by changing the secure_va_info attribute on your 3.1.3.00 VIOS.
For example, if we were to change the secure_va_info value from no to yes, like so:
$
chdev -dev viosnpiv0 -attr secure_va_info=yes
viosnpiv0
changed
$ virtadapinfo -list
secure
: yes
Then the client LPAR will see the following (Secure) output for that VIOS:
#
cat /proc/sys/adapter/fc/fcs1/hostinfo
VFC
client adapter name :
fcs1
Host
partition name (VIOS) : Secure
VFC
host adapter name :
Secure
VFC
host adapter location code :
Secure
FC
adapter name on VIOS :
Secure
FC
adapter location code on VIOS : Secure
If your VIOS is not running the latest VIOS code, 3.1.3.00, you'll find that the "FC adapter name on VIOS" attribute will be blank e.g.
fcs0
VFC
client adapter name :
fcs0
Host
partition name (VIOS) : vio2
VFC
host adapter name :
vfchost2
VFC
host adapter location code :
U9009.22A.7891CA0-V3-C16
FC
adapter name on VIOS :
FC
adapter location code on VIOS : U78D3.001.WZS0AJN-P1-C8-T1
Based on my tests, this new feature only stores information for AIX virtual fibre channel adapters and not VSCSI adapters. In that case you can still use the older, less reliable and unsupported kdb method (for both VSCSI or VFCS). Of course this may change at any time in the future.
e.g.
VSCSI
# echo
cvai | kdb -script
read
vscsi_scsi_ptrs OK, ptr =
0xF10009D5B0129E98
(0)>
cvai
Executing
cvai command
NAME STATE
CMDS_ACTIVE ACTIVE_QUEUE HOST
vscsi0 0x000007 0x000000001A 0x0 vios2->vhost3
End
of execution for cvai command
(0)>
Executing q command
VFCS
# echo
vfcs | kdb -script
read
vscsi_scsi_ptrs OK, ptr =
0xF10009D5B0129E98
(0)>
vfcs
Executing
vfcs command
NAME ADDRESS STATE OPENED CH HOST_ADAP PHYS
HOST
fcs0 0xF1000B01C0084000 0x0010 0x0001 8 Secure
Secure Secure
fcs1 0xF1000B01C0088000 0x0010 0x0001 0 vfchost0 vios1