8.6.6. Deleting a Logical Volume Storage Pool

If a logical volume storage pool is no longer needed, it can of course be removed again. However, it should be ensured beforehand, that no client LPAR is using a backing device from the storage pool. In addition, it should be ensured that, if data on backing devices is still needed, the data should be backed up before removing the logical volume storage pool.

We demonstrate the removal of a logical volume storage pool using the example of the previously used storage pool testpool. First, we list the backing devices which are still available in the storage pool:

$ vios lsbdsp ms05-vio1 testpool
BDNAME  SIZE       VTD         SVSA
bd002     3.00 GB  lpar1_hd02  vhost0
bd003     3.00 GB  lpar1_hd03  vhost0

There are only 2 backing devices, both of which are currently assigned to vhost0. We can find out the associated client LPAR using the “vios lsvscsi” command:

$ vios lsvscsi ms05-vio1 
SVSA    SLOT  CLIENT              LUNS
vhost0  C25   lpar1(3)            4
vhost1  C28   lpar2(4)            2
vhost2  C31   lpar3(5)            2

The client LPAR is lpar1, which currently has 4 backing devices assigned. We list the backing devices of the LPAR lpar1 (vhost0):

$ vios lsvscsi ms05-vio1 vhost0
VTD         STATUS     BACKING                             BDPHYSLOC  MIRRORED  LUN
lpar1_hd02  Available  bd002                               -          N/A       0x8500000000000000
lpar1_hd03  Available  bd003                               -          N/A       0x8300000000000000
vtopt0      Available  /var/vio/VMLibrary/AIX710506_2.iso  -          N/A       0x8100000000000000
vtscsi0     Available  lpar1_hd00                          -          N/A       0x8200000000000000

The backing devices bd002 and bd003 in the storage pool have the LUN IDs (LUN column) 0x8500000000000000 and 0x8300000000000000, respectively. We use the lscfg command on lpar1 to check which associated physical volumes are involved:

lpar1 # lscfg -l hdisk\*
  hdisk0           U8205.E6C.05E4E5Q-V3-C5-T1-L8200000000000000  Virtual SCSI Disk Drive
  hdisk1           U8205.E6C.05E4E5Q-V3-C5-T1-L8300000000000000  Virtual SCSI Disk Drive
  hdisk2           U8205.E6C.05E4E5Q-V3-C5-T1-L8500000000000000  Virtual SCSI Disk Drive
lpar1 #

The two physical volumes are hdisk2 and hdisk1. A quick check with the command lspv shows that they are not in use:

lpar1 # lspv
hdisk0          00ecafe541e13592                    rootvg          active     
hdisk1          00ecafe53e3abb01                    None     
hdisk2          none                                None                       
lpar1 #

We delete the two physical volumes on the client LPAR:

lpar1 # rmdev -dl hdisk1
hdisk1 deleted
lpar1 # rmdev -dl hdisk2
hdisk2 deleted
lpar1 #

Since the backing devices bd002 and bd003 were only created for test purposes, they can be deleted without creating a backup:

$ vios rmbdsp ms05-vio1 testpool bd002
$ vios rmbdsp ms05-vio1 testpool bd003

A brief check shows that the storage pool testpool no longer contains any backing devices:

$ vios lsbdsp ms05-vio1 testpool

A logical volume storage pool can not be removed with the “vios rmsp” command! This command can only be used for file storage pools. A logical volume storage pool can only be removed by removing all physical volumes. As a result, the storage pool itself is then removed. The command for this is “vios rmsppv“:

$ vios rmsppv ms05-vio1 testpool hdisk2

A list of all storage pools on the virtual I/O server shows, that the storage pool testpool has been deleted:

$ vios lssp ms05-vio1
rootvg  LVPOOL  571392  69632  512    0