8.6.5. Extending and Reducing a Logical Volume Storage Pool

If more and more backing devices are added to a storage pool and/or existing backing devices are extended, sooner or later the storage pool will run out of capacity. If you try to enlarge a backing device, for example, you will get an error message:

$ vios chbdsp ms05-vio1 testpool bd001 +3g
hmc01: viosvrcmd -m ms05 -p ms05-vio1 -c \"chbdsp -sp testpool -bd bd001 -size 3072M\"
ERROR: remote HMC command returned an error (1)
StdErr: HSCL2970 The IOServer command has failed because of the following reason:
StdErr:
StdErr:
StdErr: Some error messages may contain invalid information
StdErr: for the Virtual I/O Server environment.
StdErr:
StdErr:
StdErr:
StdErr: Some error messages may contain invalid information
StdErr: for the Virtual I/O Server environment.
StdErr:
StdErr: 0516-404 allocp: This system cannot fulfill the allocation request.
StdErr: There are not enough free partitions or not enough physical volumes
StdErr: to keep strictness and satisfy allocation requests.  The command
StdErr: should be retried with different allocation characteristics.
StdErr: rc=1
$

If you look at the free capacities of the storage pools, you can see that the storage pool testpool obviously has too little free capacity to expand a backing device by 3 GB:

$ vios lssp ms05-vio1
POOL      TYPE    SIZE       FREE       ALLOC      BDS
rootvg    LVPOOL  558.00 GB   68.00 GB  512.00 MB  0
testpool  LVPOOL    9.93 GB    1.93 GB    8.00 MB  3
$

If unused physical volumes are still available on the virtual I/O server, the logical volume storage pool can be expanded. In our case there are still 2 unused physical volumes:

$ vios lspv -a ms05-vio1
PVNAME  PVID  SIZE       VTDS
hdisk3  none   10.00 GB  -
hdisk4  none   10.00 GB  vtscsi4
hdisk6  none   10.00 GB  -
$

A storage pool of type logical volume can be expanded by adding further physical volumes to the storage pool. The command for this is “vios addsppv“:

$ vios addsppv ms05-vio1 testpool hdisk3
$

(If the physical volume has already been in use and still has a VGDA, the “-f” option can be used to force adding the physical volume to the storage pool.)

The free capacity has grown from 1.93 GB to 11.86 GB:

$ vios lssp ms05-vio1
POOL      TYPE    SIZE       FREE       ALLOC      BDS
rootvg    LVPOOL  558.00 GB   68.00 GB  512.00 MB  0
testpool  LVPOOL   19.86 GB   11.86 GB    8.00 MB  3
$

The attempt to extend the backing device bd001 by 3 GB is then successful:

$ vios chbdsp ms05-vio1 testpool bd001 +3g
$

Should the free space in the storage pool run out of space again, further available physical volumes can be added:

$ vios addsppv ms05-vio1 testpool hdisk6
$

Which physical volumes a logical storage volume pool uses currently, can be displayed using the command “vios lssp” and the specification of the storage pool:

$ vios lssp ms05-vio1 testpool
PVNAME  PVID              SIZE
hdisk2  00ecafe53d2c1269    9.93 GB
hdisk3  00ecafe541b1be91    9.93 GB
hdisk6  00ecafe541b81905    9.93 GB
$

A logical volume storage pool can also be reduced in size, if not all capacities are used. In the same way as adding physical volumes, physical volumes can also be removed again. We remove the physical volume added last, hdisk6. The command for this is “vios rmsppv“:

$ vios rmsppv ms05-vio1 testpool hdisk6
$

In many cases, however, removal will not work quite as easily, since parts of one or more backing devices are usually located on the physical volume to be removed, as the following example shows:

$ vios rmsppv ms05-vio1 testpool hdisk3
hmc01: viosvrcmd -m ms05 -p ms05-vio1 -c \"chsp -rm -sp testpool hdisk3\"
ERROR: remote HMC command returned an error (1)
StdErr: HSCL2970 The IOServer command has failed because of the following reason:
StdErr: 0516-914 rmlv: Warning, all data belonging to logical volume
StdErr: bd001 on physical volume hdisk3 will be destroyed.
StdErr: rmlv: Do you wish to continue? y(es) n(o)?
StdErr: Cannot delete a physical volume with allocated
StdErr:    partitions. Use either migratepv to move the partitions or
StdErr:    reducevg with the -rmlv option to delete the partitions.
StdErr:
StdErr: rc=2
$

The backing device must either be moved to other physical volumes, if there is enough free capacity, or it must be deleted (no client LPAR may be using the backing device for this). First of all, we determine which backing devices are using the physical volume hdisk3:

$ vios lspv -l ms05-vio1 hdisk3
LVNAME  LPS  PPS  DISTRIBUTION         MOUNT
bd001   137  137  00..137..00..00..00  N/A
$

In this case, only the backing device bd001 is partially on the physical volume. The backing device is not in use, because we only created it for test purposes and it can therefore be deleted:

$ vios rmbdsp ms05-vio1 testpool bd001
$

Afterwards, the removal of the physical volume hdisk3 from the logical volume storage pool testpool is now successful:

$ vios rmsppv -f ms05-vio1 testpool hdisk3
$