8.6.5. Vergrößern und Verkleinern eines Logical Volume Storage Pools

Werden einem Storage Pools immer weitere Backing-Devices hinzugefügt und/oder bestehende Backing-Devices vergrößert, geht dem Storage Pool früher oder später die Kapazität aus. Versucht man dann z.B. ein Backing-Device zu vergrößern, kommt es zu Fehlermeldungen:

$ 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
$

Schaut man sich die freien Kapazitäten der Storage Pools an, erkennt man das der Storage Pool testpool offensichtlich zu wenig freie Kapazität besitzt, um ein Backing-Device um 3 GB zu erweitern:

$ 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
$

Sind noch ungenutzte Physical Volumes auf dem Virtual-I/O-Server verfügbar, dann kann der Logical Volume Storage Pool erweitert werden. In unserem Falle gibt es noch 2 ungenutzte 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  -
$

Ein Storage Pool vom Typ Logical Volume kann erweitert werden, indem dem Pool weitere Physical Volumes hinzugefügt werden. Das Kommando hierfür ist „vios addsppv“:

$ vios addsppv ms05-vio1 testpool hdisk3
$

(Sollte das Physical Volume schon einmal in Verwendung gewesen sein und hat noch eine VGDA, dann kann die Option „-f“ verwendet werden, um ein Hinzufügen zu erzwingen.)

Die freie Kapazität ist von 1.93 GB auf 11.86 GB gewachsen:

$ 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
$

Der Versuch das Banking-Device bd001 um 3 GB zu vergrößern ist anschließend auch erfolgreich:

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

Sollte der freie Platz in dem Storage Pool wieder zur Neige gehen, können weitere verfügbare Physical Volumes hinzugefügt werden:

$ vios addsppv ms05-vio1 testpool hdisk6
$

Welche Physical Volumes ein Logical Storage Volume Pool verwendet kann mit „vios lssp“ und der Angabe des Storage Pools angezeigt werden:

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

Ein Logical Volume Storage Pool kann auch wieder verkleinert werden, falls nicht alle Kapazitäten genutzt werden. Analog dem Hinzufügen von Physical Volumes können Physical Volumes auch wieder weggenommen werden. Wir nehmen das zuletzt hinzugefügte Physical Volume hdisk6 wieder weg. Das Kommando hierfür ist „vios rmsppv“:

$ vios rmsppv ms05-vio1 testpool hdisk6
$

In vielen Fällen wird das Wegnehmen aber nicht ganz so leicht funktionieren, da sich üblicherweise Teile von einem oder mehreren Backing-Devices auf dem wegzunehmenden Physical Volume befinden, wie das folgende Beispiel zeigt:

$ 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
$

Das Backing-Device muß entweder auf andere Physical Volumes verschoben werden, falls genügend freie Kapazität vorhanden ist, oder es muß gelöscht werden (dazu darf keine Client-LPAR das Backing-Device in Verwendung haben). Wir stellen zunächst erst einmal fest welche Backing-Devices das Physical Volume hdisk3 verwenden:

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

In diesem Falle liegt lediglich das Backing-Device bd001 teilweise auf dem Physical Volume. Das Backing-Device ist nicht in Verwendung, da wir es nur zu Test-Zwecken angelegt hatten, und kann daher gelöscht werden:

$ vios rmbdsp ms05-vio1 testpool bd001
$

Anschließend ist auch das Entfernen des Physical Volumes hdisk3 aus dem Logical Volume Storage Pool testpool erfolgreich:

$ vios rmsppv -f ms05-vio1 testpool hdisk3
$