7.4.3. Assigning a Physical FC Port (Mapping)

On AIX, the device name for a virtual FC client adapter is fcs followed by a unique instance number. After adding a virtual FC client adapter to an LPAR, the associated new device is not automatically recognized by the operating system.

aix22 # lscfg -l fcs*
  fcs0             U9009.22A.679F95F-V5-C10-T1  Virtual Fibre Channel Client Adapter
  fcs1             U9009.22A.679F95F-V5-C20-T1  Virtual Fibre Channel Client Adapter
aix22 #

The output shows that only the two virtual FC client adapters in slots 10 and 20 are known to the operating system. The adapter created above in slot 11 is not yet known to the operating system.

After adding a virtual FC client adapter to a client LPAR, the operating system of the client LPAR must first recognize the new client adapter. In the case of AIX as the operating system, the config manager cfgmgr must be started:

aix22 # cfgmgr -v
cfgmgr is running in phase 2
----------------

----------------
Attempting to configure device 'fcs2'
Time: 0 LEDS: 0x2701
Invoking /usr/lib/methods/cfg_vfc -l fcs2
Number of running methods: 5
----------------

----------------
Attempting to configure device 'fscsi2'
Time: 1 LEDS: 0x2700
Invoking /usr/lib/methods/cfgefscsi -l fscsi2
Number of running methods: 1
----------------
Completed method for: fscsi2, Elapsed time = 19
Return code = 61
*** no stdout ****
*** no stderr ****
Method error (/usr/lib/methods/cfgefscsi -l fscsi2 ):
        0514-061 Cannot find a child device.
----------------

aix22 #

The output shows that the adapter fcs2 was recognized. However, the associated protocol device fscsi2 reports the error “0514-061 Cannot find a child device.”. This is because the virtual FC client and virtual FC server adapters have been created, but the virtual FC server adapter has not yet been assigned to a physical FC port. There is therefore no connection to an FC fabric, as figure 7.13 shows.

The mapping to a physical FC port is missing for the LPAR aix22.
Figure 7.13: The mapping to a physical FC port is missing for the LPAR aix22.

In the LPAR on the left, the virtual FC client adapter fcs0 (blue) has a connection to the physical FC port fcs0 on the virtual I/O server and thus a connection to an FC fabric via the associated virtual FC server adapter . This assignment has yet to be made for the new virtual FC server adapter (red).

The existing mappings on a virtual I/O server can be displayed with the command “vios lsnpiv” (list NPIV mappings):

$ vios lsnpiv ms03-vio1
NAME      SLOT  FC    FCLABEL  CLIENT        CLNTOS  VFCCLIENT  VFCSLOT  STATUS       PORTS
vfchost2  C5    fcs0  Fabric1  aix22(5)   AIX     fcs0       C10      LOGGED_IN      7
vfchost3  C125  fcs0  Fabric1  aixsap01(9)   AIX     fcs0       C10      LOGGED_IN      7
vfchost4  C181  fcs0  Fabric1  aixdbp02(11)  AIX     fcs0       C10      LOGGED_IN      5
vfchost5  C182  fcs0  Fabric1  aixdbi02(13)  AIX     fcs0       C10      LOGGED_IN      5
vfchost6  C38   -     -        -(5)     -       -          -        NOT_LOGGED_IN  0
$

The column NAME on the far left shows the device name of the virtual FC server adapter on the virtual I/O server. The designation vfchost (virtual FC host) clearly indicates that it is a virtual FC server (host) adapter. Next, the virtual slot number of the virtual FC server adapter on the virtual I/O server is shown in the column SLOT. If the server (host) adapter has been assigned to a physical port, the physical FC port is named in the FC column, otherwise a “” is shown. The label attribute of the physical FC port is shown in the FCLABEL column as additional information. This is followed by information about the client LPAR (name and LPAR ID), as well as the client’s operating system and the device name of the associated virtual FC client adapter and the associated virtual slot number on the client LPAR. Finally, the status of the virtual FC server adapter and, if logged into the fabric (STATUS=LOGGED_IN), the number of visible FC ports is given. One of the visible FC ports is always the virtual FC server adapter itself, the other visible FC ports are usually FC ports of the storage used. A storage port can provide more than one disk (LUN), so the number of visible storage ports does not provide any indication of how many LUNs have been assigned to the client.

The newly created virtual FC server adapter is vfchost6 (slot C38). You can easily see from the output, that no physical FC port has yet been assigned.
The assignment of a physical FC port for a virtual FC server adapter is done with the help of the command “vios vfcmap” (map virtual FC adapter):

$ vios vfcmap ms03-vio1 vfchost6 fcs0
vfchost6 mapped to fcs0
$

The vfchost device and the physical FC port are specified after the virtual I/O server (on which the mapping is to be carried out). When mapping, the virtual FC server adapter logs into the fabric immediately:

$ vios lsnpiv ms03-vio1
NAME      SLOT  FC    FCLABEL  CLIENT        CLNTOS  VFCCLIENT  VFCSLOT  STATUS       PORTS
vfchost2  C5    fcs0  Fabric1  aix22(5)   AIX     fcs0       C10      LOGGED_IN      7
vfchost3  C125  fcs0  Fabric1  aixsap01(9)   AIX     fcs0       C10      LOGGED_IN      7
vfchost4  C181  fcs0  Fabric1  aixdbp02(11)  AIX     fcs0       C10      LOGGED_IN      5
vfchost5  C182  fcs0  Fabric1  aixdbi02(13)  AIX     fcs0       C10      LOGGED_IN      5
vfchost6  C38   fcs0  Fabric1  aix22(5)   AIX     fcs2       C11      LOGGED_IN      1
$

Instead of the vfchost device, the “vios vfcmap” command also allows the slot number of the virtual FC server adapter to be specified:

$ vios vfcmap ms03-vio1 38 fcs0
vfchost6 mapped to fcs0
$

The associated vfchost device is searched for, using slot number 38 (C38 can also be specified) and then, if found, the vfchost is used for the mapping.

The label attribute can also be used instead of the physical FC port. This means that the desired fabric can also be specified directly during mapping, without having to know the device name of the physical FC port:

$ vios vfcmap ms03-vio1 vfchost6 Fabric1
vfchost6 mapped to fcs0
$

If several FC ports have the same label, the first FC port is used!

The physical location code of the device can also be specified for both the vfchost device and the physical FC port. The physical FC port fcs0 has the location code U78AA.001.VYRGU0Q-P1-C5-T1, for example. Instead of the device name fcs0, U78AA.001.VYRGU0Q-P1-C5-T1 can therefore also be specified. This, of course, is not really a simplification. But it is not necessary to enter the complete location code, it is sufficient to enter a unique suffix of the location code, whereby the suffix must always start a part after a period “.” or a hyphen ““. The following suffixes are unique on the example system and can be used instead of the full location code:

U78AA.001.VYRGU0Q-P1-C5-T1
001.VYRGU0Q-P1-C5-T1
VYRGU0Q-P1-C5-T1
P1-C5-T1
C5-T1

This means that the mapping could also be carried out as follows:

$ vios vfcmap ms03-vio1 C38 C5-T1
vfchost6 mapped to fcs0
$

The vfchost device was specified using the slot number C38 and the physical FC port using the unique suffix C5-T1. The result is the same as in all the other examples above: vfchost6 is mapped to fcs0.

The suffix T1, on the other hand, is not unique; you get a corresponding error message when mapping:

$ vios vfcmap ms03-vio1 vfchost6 T1
ERROR: more than one matching fcs adapter
did you mean: fcs0 , U78AA.001.VYRGU0Q-P1-C5-T1 (label: Fabric1)
did you mean: fcs4 , U78AA.001.VYRGU0Q-P1-C1-C1-T1 (label: Fabric1)
 
USAGE:
   vios [-h <hmc>] [-m <ms>] vfcmap [-v] <vios> <vfchost>|<physloc>|<client>[/{<fcs>|<slot>}] <fcs>|<physloc>|<label>
$

All Physical Location Codes for which T1 is a suffix are displayed, together with the error message.