7.5.3. Removing a VSCSI Mapping

The mapping between the backing device and the vhost adapter can be removed at any time. If there is no path via another adapter on the client LPAR, access to the devices is then no longer possible.

The client LPARs have the following VSCSI mappings on the virtual I/O server ms03-vio2:

$ vios lsvscsi ms03-vio2  vhost0
vtscsi0  Available  hdisk3   -          N/A       0x8100000000000000
vtscsi1  Available  hdisk4   -          N/A       0x8200000000000000

The mapping for the backing device hdisk3 is to be removed from the virtual I/O server. The associated client LPAR for the virtual SCSI server adapter can easily be determined with “vios lsvscsi“:

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

The associated client LPAR is aix22 (LPAR-ID 5) and the adapter vhost0 is in the virtual slot 33 of the virtual I/O server. The associated virtual SCSI client adapter can then be determined from the output of “lpar lsvslot“:

$ lpar lsvslot aix22
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 virtual SCSI client adapter in slot 21 of the client LPAR aix22 is connected to the virtual SCSI server adapter in slot 33 of the virtual I/O server ms03-vio2. The associated vscsi device can be identified in the client LPAR using the slot number:

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 mapping to be removed goes via the virtual SCSI client adapter vscsi1 of the LPAR, the physical location code contains the slot number 21: V5-C21-T1.

The next step is to determine the physical volume on the client LPAR, belonging to hdisk3 on the virtual I/O server. The virtual target device vtscsi0 of the virtual I/O server has the LUN ID 0x8100000000000000 (see the output of „vios lsvscsi ms03-vio2 vhost0“ above). The associated hdisk can be found using lscfg:

aix22 # lscfg -l hdisk\* |grep 81
  hdisk9      U9009.22A.8991971-V5-C11-T1-L8100000000000000         Virtual SCSI Disk Drive
aix22 #

It is hdisk9 of the client LPAR. We check whether it has paths through other adapters:

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

In addition to the path via the adapter vscsi1, the physical volume has another active (Enabled) path using the adapter vscsi0. To prevent the LPAR from using the path over vscsi1, we delete the path, since it will no longer work, after removing the mapping:

aix22 # rmpath -dl hdisk9 -p vscsi1
path Deleted
aix22 #

All I/O to hdisk9 is now exclusively performed by the adapter vscsi0!

Finally, the mapping of hdisk3 to the adapter vhost0 on the virtual I/O server can be removed:

$ vios unmap ms03-vio2 vtscsi0

(Instead of specifying the virtual target device vtscsi0, the backing device hdisk3 can be specified as well.)

If the disk in the client LPAR for which the mapping is to be removed on a virtual I/O server does not have any paths via other adapters, another procedure must be selected. To show this, we also remove the second mapping for hdisk9 of the client LPAR aix22. After one of the two paths has been removed above, the LPAR only has one active path:

aix22 # lspath -l hdisk9
Enabled hdisk9 vscsi0
aix22 #

The last path of physical volume cannot be removed using rmpath:

aix22 # rmpath -dl hdisk9 -p vscsi0
Method error (/etc/methods/ucfgdevice):
        0514-076 Cannot perform the requested function because the specified
                 paths include all paths for the device.
aix22 #

The physical volume must be completely removed from the operating system. Of course, this only works when it is not in use. In our example, the physical volume is not in use:

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

The hdisk9 does not belong to any volume group, so it can be removed from the operating system without any problems:

aix22 # rmdev -dl hdisk9
hdisk9 deleted
aix22 #

Finally, the mapping can be removed (now on ms03-vio1):

$ vios unmap ms03-vio1 vtscsi0