How To
Summary
Under certain circumstance, we may need to remove or make a physical adapter from the VIOS (as to run diagnostic for instance).
In this document, we'll see how to remove all the NPIV mapping, and make the adapter free.
Steps
1. Save the config and backup the current mapping.
Once the operation on the physical adapter is completed, we'll have to restore the mapping as it was before the change, thus we'll first need to backup the current config.
The easiest and most complete way to backup the mapping on the vios is to use the viosbr utility :
$ viosbr -backup -file <filename>
$ viosbr -backup -file <filename>
Should the above command fail, or if you simply prefer some manual output, you may run the following to list the current NPIV mapping :
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid
This will list all the vfchost adapter with there physical location, current state and the physical adapter map to this vfchost.
For instance :
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid
vfchost0:U8233.E8B.1010E1P-V1-C131:Earth:3:LOGGED_IN:fcs0
vfchost1:U8233.E8B.1010E1P-V1-C141:Dathomir:4:LOGGED_IN:fcs0
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:LOGGED_IN:fcs1
For instance :
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid
vfchost0:U8233.E8B.1010E1P-V1-C131:Earth:3:LOGGED_IN:fcs0
vfchost1:U8233.E8B.1010E1P-V1-C141:Dathomir:4:LOGGED_IN:fcs0
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:LOGGED_IN:fcs1
2. Free the adapter
Assuming we want to run a wrap plug test on fcs1 adapter, we'll need to remove all mapping to this adapter.
The best practice is to first remove the client side adapter, so we have to identify this adapter for each mapping.
We can use a short script that runs under padmin to get all the information :
$ for ADAP in `lsmap -all -npiv -fmt : -field name fc | grep -w fcs1 | awk -F ":" '{print $1}'`
> do
> lsmap -vadapter $ADAP -npiv -fmt : -field clntname clntid vfcclient vfcclientdrc
> done
We can use a short script that runs under padmin to get all the information :
$ for ADAP in `lsmap -all -npiv -fmt : -field name fc | grep -w fcs1 | awk -F ":" '{print $1}'`
> do
> lsmap -vadapter $ADAP -npiv -fmt : -field clntname clntid vfcclient vfcclientdrc
> done
In the above script, the fcs1 mentionned in first line (just after the "grep -w") is the physical adapter that you want to free.
It provides the following output :
Venus:5:fcs0:U8233.E8B.1010E1P-V5-C151
Mars:6:fcs0:U8233.E8B.1010E1P-V6-C161
It provides the following output :
Venus:5:fcs0:U8233.E8B.1010E1P-V5-C151
Mars:6:fcs0:U8233.E8B.1010E1P-V6-C161
The above indicates there are 2 client LPAR with a vFC adapter mapped to our fcs1 adapter on the VIOS :
* On LPAR Venus (with LPAR ID 5), the fcs0 adapter is mapped to fcs1 on VIOS. This fcs0 adapter has the following physical location "U8233.E8B.1010E1P-V5-C151"
So the first step is to login to LPAR ID 5 - venus, make sure this is the expected adapter and remove it :
$ lsdev -Cl fcs0 -r physloc
U8233.E8B.1010E1P-V5-C151-T1
--> it confirms this is the same adapter as the VIOS mentionned, we can remove it.
$ rmdev -Rdl fcs0
* On LPAR Venus (with LPAR ID 5), the fcs0 adapter is mapped to fcs1 on VIOS. This fcs0 adapter has the following physical location "U8233.E8B.1010E1P-V5-C151"
So the first step is to login to LPAR ID 5 - venus, make sure this is the expected adapter and remove it :
$ lsdev -Cl fcs0 -r physloc
U8233.E8B.1010E1P-V5-C151-T1
--> it confirms this is the same adapter as the VIOS mentionned, we can remove it.
$ rmdev -Rdl fcs0
The same applies for LPAR ID 6 - mars :
$ lsdev -Cl fcs0 -r physloc
U8233.E8B.1010E1P-V6-C161
$ rmdev -Rdl fcs0
$ lsdev -Cl fcs0 -r physloc
U8233.E8B.1010E1P-V6-C161
$ rmdev -Rdl fcs0
You have to repeat this for all client LPAR with an adapter mapped to fcs1 from VIOS.
Note : If there are some device configured with only one path and using this adapter, those device will be removed as well by the rmdev command. Make sure the multipathing is correct on client LPAR.
Once completed you can remove the mapping from VIOS side :
Get the list of vfchost adapter to be removed (if you need to manually recover the config, keep not of those lines (a) ) :
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid | grep -w fcs1
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:NOT_LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:NOT_LOGGED_IN:fcs1
Get the list of vfchost adapter to be removed (if you need to manually recover the config, keep not of those lines (a) ) :
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid | grep -w fcs1
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:NOT_LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:NOT_LOGGED_IN:fcs1
As you can see, the vfchost now reports a status "NOT_LOGGED_IN". This is expected, as we have removed the client adapter side, the VIOS detects this and now states the vfchost is not logged in.
It confirms we have correctly managed the client LPAR side adapter, we can proceed with vfchost adapter unmapping and physical adapter removal :
$ vfcmap -vadapter vfchost2 -fcp
$ vfcmap -vadapter vfchost3 -fcp
$ rmdev -dev fcs1 -recursive
It confirms we have correctly managed the client LPAR side adapter, we can proceed with vfchost adapter unmapping and physical adapter removal :
$ vfcmap -vadapter vfchost2 -fcp
$ vfcmap -vadapter vfchost3 -fcp
$ rmdev -dev fcs1 -recursive
The fcs1 adapter is now free, you can work on it as desired.
3. Restore the configuration as it was before
Here you can run either 3.1 or 3.2 depending on which backup option you choose.
3.1 If you collected a viosbr backup, then you can simply restore everything with 2 commands :
$ cfgdev
--> This will reconfigure the physical adapter.
$ viosbr -restore -file <filename>.tar.gz -type npiv
Restore summary on polaris:
Backedup Devices that are unable to restore/change
==================================================
$ cfgdev
--> This will reconfigure the physical adapter.
$ viosbr -restore -file <filename>.tar.gz -type npiv
Restore summary on polaris:
Backedup Devices that are unable to restore/change
==================================================
DEPLOYED or CHANGED devices:
============================
Dev name during BACKUP Dev name after RESTORE
---------------------- ----------------------
vfchost2 vfchost2
vfchost3 vfchost3
$ lsmap -all -npiv -fmt : -field name physloc status fc clntname clntid
vfchost0:U8233.E8B.1010E1P-V1-C131:Earth:3:LOGGED_IN:fcs0
vfchost1:U8233.E8B.1010E1P-V1-C141:Dathomir:4:LOGGED_IN:fcs0
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:LOGGED_IN:fcs1
vfchost0:U8233.E8B.1010E1P-V1-C131:Earth:3:LOGGED_IN:fcs0
vfchost1:U8233.E8B.1010E1P-V1-C141:Dathomir:4:LOGGED_IN:fcs0
vfchost2:U8233.E8B.1010E1P-V1-C151:Mars:5:LOGGED_IN:fcs1
vfchost3:U8233.E8B.1010E1P-V1-C161:Venus:6:LOGGED_IN:fcs1
3.2 If you choose the manual option, use the output from the command line "a" to recreate the mapping :
$ cfgdev
$ vfcmap -vadapter vfchost2 -fcp fcs1
$ vfcmap -vadapter vfchost3 -fcp fcs1
$ cfgdev
$ vfcmap -vadapter vfchost2 -fcp fcs1
$ vfcmap -vadapter vfchost3 -fcp fcs1
Once 3.1 or 3.2 is completed you can run a "cfgmgr" on all client LPAR where you removed an adapter.
Everything should come up as it was before the change.
Everything should come up as it was before the change.
Should you face any issue during this procedure, please collect :
- a "snap -ac" from root on the client LPAR reporting issue
- a "snap" run as padmin with no option on the VIOS facing issue
and open a case with VIOS support team.
- a "snap -ac" from root on the client LPAR reporting issue
- a "snap" run as padmin with no option on the VIOS facing issue
and open a case with VIOS support team.
Document Location
Worldwide
[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSPHKW","label":"PowerVM Virtual I\/O Server"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]
Was this topic helpful?
Document Information
Modified date:
20 October 2021
UID
ibm16381326