7.4.9. Removing a Virtual FC Adapter

If a virtual FC client adapter is no longer required, it can of course be removed again. Devices that can only be reached by the adapter to be removed can then no longer be used and must therefore be deleted first. A virtual FC client adapter can be removed with the command “lpar rmfc” (remove virtual FC adapter).

Note: A virtual FC client adapter cannot be removed, if it is still in use or the associated fcs device is still configured in the operating system.

$ lpar rmfc aix22 10
hmc01: chhwres -m ms03 -r virtualio --rsubtype fc  -o r -p aix22 -s 10
ERROR: remote HMC command returned an error (1)
StdErr: HSCL294D Dynamic remove of virtual I/O resources failed:
StdErr: 
StdErr:
StdErr: 0931-029 The specified slot contains a device or devices that are currently
StdErr:  configured. Unconfigure the following device or devices with the rmdev
StdErr:  command and try again.
StdErr:
StdErr: fcs0
StdErr:
StdErr:
StdErr:
StdErr:
StdErr: The OS return code is 1.
StdErr:
$

The attempt results in an error message, which indicates that a device (here fcs0) is still in use. It is therefore not possible to “accidentally” delete an active virtual FC adapter.

As an example, it is shown how the virtual FC client adapter fcs0 of the LPAR aix22 can be removed correctly:

The first thing to do is to note down informations, such as WWPNs, slot numbers and virtual I/O servers for the virtual FC client adapter to be removed. If there is a problem, it is relatively easy to recreate the adapter, with the recorded informations:

$ lpar lsvslot aix22
SLOT  REQ  ADAPTER_TYPE   DATA
0     Yes  serial/server  remote: (any)/any connect_status= hmc=1
1     Yes  serial/server  remote: (any)/any connect_status= hmc=1
5     No   eth            PVID=100 VLANS= ETHERNET0
10    No   fc/client      remote: ms03-vio1(1)/5 c05076030aba0002,c05076030aba0003
20    No   fc/client      remote: ms03-vio2(2)/4 c05076030aba0000,c05076030aba0001
$

The virtual FC client adapter fcs0 was the adapter in slot 10 (as a precaution you can check this again using “vios lsnpiv”), the associated virtual FC server adapter is in slot 5 of the virtual I/O server ms03-vio1 . The adapter’s two WWPNs are c05076030aba0002 and c05076030aba0003.

It should be checked whether all LUNs used have alternative paths using another virtual FC adapter:

aix22 # lspath
Enabled hdisk0 fscsi0
Enabled hdisk1   fscsi0
Enabled hdisk2   fscsi0
Enabled hdisk3   fscsi0
Enabled hdisk4   fscsi0
Enabled hdisk5   fscsi0
Enabled hdisk0 fscsi0
Enabled hdisk1   fscsi0
Enabled hdisk2   fscsi0
Enabled hdisk3   fscsi0
Enabled hdisk4   fscsi0
Enabled hdisk5   fscsi0
Enabled hdisk0 fscsi1
Enabled hdisk1   fscsi1
Enabled hdisk3   fscsi1
Enabled hdisk4   fscsi1
Enabled hdisk5   fscsi1
Enabled hdisk0 fscsi1
Enabled hdisk1   fscsi1
Enabled hdisk3   fscsi1
Enabled hdisk4   fscsi1
Enabled hdisk5   fscsi1
aix22 #

In the example output, all LUNs except hdisk2 have alternative paths using the second virtual FC adapter fcs1. The physical volume hdisk2 only has paths through fcs0:

aix22 # lspath -l hdisk2
Enabled hdisk2 fscsi0
Enabled hdisk2 fscsi0
aix22 #

I.e. if the mapping for fcs0 is removed, I/O to hdisk2 is no longer possible! However, physical volume hdisk2 is not in use in our case:

aix22 # lspv|grep hdisk2
hdisk2          cafe000000000002                    None                       
aix22 #

Therefore we permanently remove hdisk2 from the operating system:

aix22 # rmdev -dl hdisk2
hdisk2 deleted
aix22 #

All other LUNs have additional paths through fcs1 and therefore remain available. We remove the paths using fcs0 permanently (option „-d“):

aix22 # rmpath -dp fscsi0
paths Deleted
aix22 #

Finally, the device fcs0 for the virtual FC client adapter must be removed from the operating system. Since the virtual FC client adapter will be removed, the definition in the ODM is no longer required. Therefore, the option “-d” should be used with rmdev, when removing the device, in order to remove the ODM definitions for the device as well. The device fcs0 has at least one child device (fscsi0), which must also be removed. We use the option “-R” (recursive) with rmdev, to recursively remove all child devices:

aix22 # rmdev -Rdl fcs0
fscsi0 deleted
fcs0 deleted
aix22 #

The virtual FC server adapter is still assigned (mapped) to the physical FC port on the virtual I/O server ms03-vio1. This mapping must be removed in order to be able to delete the virtual FC server adapter. Using “vios lsnpiv“, the current NPIV mappings of the virtual I/O server ms03-vio1 can be displayed again in order to find out the vfchost device of the mapping:

$ vios lsnpiv ms03-vio1
NAME      SLOT  FC    FCLABEL  CLIENT        CLNTOS  VFCCLIENT  VFCSLOT  STATUS       PORTS
vfchost2  C5    fcs4  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
$

The server adapter belonging to the virtual FC client adapter is vfchost2! The mapping can be removed using the command “vios vfcunmap“:

$ vios vfcunmap ms03-vio1 vfchost2
vfchost2 unmapped
$

Finally, virtual FC client and server adapters can now be removed by the POWER Hypervisor using the “lpar rmfc” command:

$ lpar rmfc aix22 10
aix22 slot 10 -> ms03-vio1 slot 5 removed by DLPAR operation
aix22 slot 10 -> ms03-vio1 slot 5 removed from current profile (standard)
ms03-vio1 slot 5 -> aix22 slot 10 removed by DLPAR operation
$

The output confirms that the virtual FC server adapter on the virtual I/O server has also been removed.

If a virtual FC client adapter is to be removed from a profile of an LPAR only, then the option “-p” has to be specified together with the profile name.