7.5.4. Removing a Virtual SCSI Adapter

If a virtual SCSI adapter is to be removed, all paths via this adapter on the client LPAR must first be removed, or even the corresponding physical volume must be completely removed from the operating system, in case a physical volume has no other paths.

We demonstrate the procedure using again the example of the LPAR aix22. We first remove the virtual SCSI adapter in slot 11 of the client LPAR:

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

The associated virtual SCSI server adapter is located on the virtual I/O server ms03-vio1 in slot 33. First, let’s take a look at which physical volumes on the client LPAR use the virtual SCSI client adapter in slot 11. For this we need the device name of the corresponding vscsi adapter under AIX:

aix22 # lscfg -l vscsi\*
  vscsi0           U9009.22A.8991971-V5-C11-T1  Virtual SCSI Client Adapter
  vscsi1           U9009.22A.8991971-V5-C21-T1  Virtual SCSI Client Adapter
aix22 #

The adapter vscsi0 is located in virtual slot 11 (V5-C11-T1). The lspath command can be used to find out, which physical volumes have paths using this adapter:

aix22 # lspath -p vscsi0
Enabled hdisk9 vscsi0
Enabled hdisk10 vscsi0
aix22 #

Both disks still have paths through the adapter vscsi1:

aix22 # lspath -l hdisk9
Enabled hdisk9 vscsi0
Enabled hdisk9 vscsi1
aix22 # lspath -l hdisk10
Enabled hdisk10 vscsi0
Enabled hdisk10 vscsi1
aix22 #

Only the paths using adapter vscsi0 of the two physical volumes have to be removed. This can be done either for each of the physical volumes individually, as in the last subsection, or for all the physical volumes in question together. We decided to use the last variant here:

aix22 # rmpath -dp vscsi0
paths Deleted
aix22 #

The two physical volumes can now only be accessed via the remaining paths by the adapter vscsi1.

In order that the virtual SCSI client adapter can be removed, the associated device vscsi0 must be removed from the operating system:

aix22 # rmdev -dl vscsi0
vscsi0 deleted
aix22 #

Next, the mappings to the associated virtual SCSI server adapter must be removed. To do this, we first look at which of the vhost adapters on the virtual I/O server is using slot 33:

$ vios lsvscsi ms03-vio1
SVSA    SLOT  CLIENT     LUNS
vhost0  C33   aix22(5)  2
vhost1  C34   aixsap01(9)  7
vhost2  C35   aixdbp02(11)  21
vhost3  C36   aixdbi02(13)  13
$

It is the first adapter in the output – vhost0. 2 LUNs are mapped over that VSCSI server adapter. By specifying the adapter with the command „vios lsvscsi“, the mappings can be shown in detail:

$ vios lsvscsi ms03-vio1 vhost0
VTD      STATUS     BACKING  BDPHYSLOC  MIRRORED  LUN
vtscsi0  Available  hdisk3   -          N/A       0x8100000000000000
vtscsi1  Available  hdisk4   -          N/A       0x8200000000000000
$

Both mappings must be removed:

$ vios unmap ms03-vio1 vtscsi0
$ vios unmap ms03-vio1 vtscsi1
$

Finally, the virtual SCSI client adapter and the associated virtual SCSI server adapter can be removed:

$ lpar rmscsi aix22 11
aix22: slot 11 -> ms03-vio1/33 removed by DLPAR operation
aix22: slot 11 -> ms03-vio1/33 removed from current profile (standard)
ms03-vio1: slot 33 -> aix22/11 removed by DLPAR operation
$

The command removes the virtual SCSI client adapter on the client LPAR and the associated virtual SCSI server adapter on the virtual I/O server.

If one or more physical volumes on the LPAR only have paths through the virtual SCSI client adapter to be removed, the physical volumes must be removed from the operating system. Without an adapter, the physical volumes can no longer be accessed. We demonstrate this case by removing the remaining second virtual SCSI client adapter as well. Here, too, only the two physical volumes hdisk9 and hdisk10 are affected:

aix22 # lspath -p vscsi1
Enabled hdisk9 vscsi1
Enabled hdisk10 vscsi1
aix22 #

Both physical volumes do not have other paths through another adapter:

aix22 # lspath -l hdisk9
Enabled hdisk9 vscsi1
aix22 # lspath -l hdisk10
Enabled hdisk10 vscsi1
aix22 #

The physical volumes can only be removed from the operating system when they are not in use. But this is the case in our example:

aix22 # lspv | grep hdisk9
hdisk9          00dead00beef000e                    None                       
aix22 # lspv | grep hdisk10
hdisk10         00dead00beef0001                    None                       
aix22 #

Both physical volumes do not belong to any volume group and can therefore be removed:

aix22 # rmdev -dl hdisk9
hdisk9 deleted
aix22 # rmdev -dl hdisk10
hdisk10 deleted
aix22 #

In order that the virtual SCSI client adapter can be removed, the associated device vscsi1 must be removed first from the operating system:

aix22 # rmdev -dl vscsi1
vscsi1 deleted
aix22 #

The removal of the physical volumes and the vscsi device can also be carried out in one operation by using the option “-R” (recursive) of rmdev:

aix22 # rmdev -dl vscsi1
hdisk9 deleted
hdisk10 deleted
vscsi1 deleted
aix22 #

Now that the mapped physical volumes are no longer in use by the client LPAR, the VSCSI mappings on the virtual I/O server can be removed. The associated virtual SCSI server adapter is in slot 33 of the virtual I/O server ms03-vio2:

$ vios lsvscsi ms03-vio2
SVSA    SLOT  CLIENT     LUNS
vhost0  C33   aix22(5)  2
vhost1  C34   aixsap01(9)  7
vhost2  C35   aixdbp02(11)  21
vhost3  C36   aixdbi02(13)  13
$

Here, too, the adapter is again vhost0, with 2 assigned backing devices:

$ vios lsvscsi ms03-vio2 vhost0
VTD      STATUS     BACKING  BDPHYSLOC  MIRRORED  LUN
vtscsi0  Available  hdisk3   -          N/A       0x8100000000000000
vtscsi1  Available  hdisk4   -          N/A       0x8200000000000000
$

We remove the two mappings again using the command “vios unmap“:

$ vios unmap ms03-vio2 vtscsi0
$ vios unmap ms03-vio2 vtscsi1
$

Finally, the virtual SCSI adapters can now be removed (client and server adapters):

$ lpar rmscsi aix22 21
aix22: slot 21 -> ms03-vio2/33 removed by DLPAR operation
aix22: slot 21 -> ms03-vio2/33 removed from current profile (standard)
ms03-vio2: slot 33 -> aix22/21 removed by DLPAR operation
$