7.7.7. Removing a vNIC Backing Device

VNIC backing devices that are no longer required can be removed at any time. The command for this is “lpar rmvnicbkdev” (remove vNIC backing device). Before we remove one of the 3 vNIC backing devices, here is an overview of the current vNIC backing devices of the LPAR aix22:

$ lpar lsvnic -a aix22
                           FAILOVER                                         PHYS  LOGICAL   CURRENT     MAX  
LPAR_NAME  SLOT  FAILOVER  PRIORITY  ACTV  STATUS       VIOS_NAME  ADAPTER  PORT  PORT      CAPACITY  CAPACITY
aix22  6     Yes       50        1     Operational  ms03-vio1  1        0     27004005  2.0       100.0
aix22  6     Yes       60        0     Operational  ms03-vio2  2        0     27008004  2.0       100.0
aix22  6     Yes       55        0     Operational  ms03-vio3  3        2     2700c00a  2.0       100.0
$

We remove the third vNIC backing device with the logical port ID 2700c00a. This is currently not the active vNIC backing device.

$ lpar rmvnicbkdev aix22 6 2700c00a
$

A renewed overview of the vNIC backing devices of the LPAR aix22 shows that the named vNIC backing device has been successfully removed:

$ lpar lsvnic -a aix22
                           FAILOVER                                         PHYS  LOGICAL   CURRENT     MAX  
LPAR_NAME  SLOT  FAILOVER  PRIORITY  ACTV  STATUS       VIOS_NAME  ADAPTER  PORT  PORT      CAPACITY  CAPACITY
aix22  6     Yes       50        1     Operational  ms03-vio1  1        0     27004005  2.0       100.0
aix22  6     Yes       60        0     Operational  ms03-vio2  2        0     27008004  2.0       100.0
$

The attempt to remove the currently active vNIC backing device with the logical port ID 27004005 fails, however:

$ lpar rmvnicbkdev aix22 6 27004005
hmc01: chhwres -m ms03 -r virtualio --rsubtype vnic -o s -p aix22   -s 6 -a 'backing_devices-=sriov///1/0///'
ERROR: remote HMC command returned an error (1)
StdErr: HSCLAB44 The active backing device for a virtual NIC cannot be deleted.
$

The active vNIC backing device cannot be removed! If you still want to remove the vNIC backing device, you must first activate another vNIC backing device. In our case, only one additional vNIC backing device is available:

$ lpar actvnicbkdev aix22 6 27008004
$

The first vNIC backing device can then be removed without any problems:

$ lpar rmvnicbkdev aix22 6 27004005
$

This leaves only one vNIC backing device:

$ lpar lsvnic -a aix22
                           FAILOVER                                         PHYS  LOGICAL   CURRENT     MAX  
LPAR_NAME  SLOT  FAILOVER  PRIORITY  ACTV  STATUS       VIOS_NAME  ADAPTER  PORT  PORT      CAPACITY  CAPACITY
aix22  6     Yes       60        1     Operational  ms03-vio2  2        0     27008004  2.0       100.0
$

Since a vNIC adapter must always have at least one vNIC backing device, the last vNIC backing device cannot be removed:

$ lpar rmvnicbkdev aix22 6 27008004
hmc01: chhwres -m ms03 -r virtualio --rsubtype vnic -o s -p aix22   -s 6 -a 'backing_devices-=sriov///2/0///'
ERROR: remote HMC command returned an error (1)
StdErr: HSCLAB43 This operation is not allowed because it will cause all of the backing devices for the virtual NIC to be deleted.
$

The only option left here is to delete the entire vNIC adapter.