How to Check NPIV Virtual Fibre Channel Adapter Mapping on AIX
# 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-T1This will make tracking LPAR/VIOS changes, during large migrations (for example, from P9 to P10 with LPM), a lot easier (and more reliable than using 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:
# oslevel -s 7200-05-03-2136 # cd /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 fcs0In each of the fcsX directories you'll find a new entry named hostinfo:
# cd fcs0 # ls -ltr total 0 prw-r--r-- 1 root system 0 Oct 04 16:16 hostinfoYou can "cat" this file to determine which VIOS is serving your virtual fibre channel adapter:
# 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-T1You 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:
# cat /usr/local/bin/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 # 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-T2It’s 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 : SecureIf 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. For example:
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-T1Based 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 and VFCS). Of course this may change at any time in the future. For example:
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 fcs1 0xF1000B01C0088000 0x0010 0x0001 0 vfchost0 vios1