LVM Volume Group Dynamic LUN Expansion (DLE) and Contraction (DLC) (September 2009)
52
Online DLC to decrease the space used by a physical volume
A physical volume needs to be reconfigured to prepare the LUN for dynamic contraction. You can use
the online vgmodify DLC –C option to prepare the LUN. In some cases, free extents at the end of the
PV might need to be removed. If insufficient free extents are available at the end of the PV, it might be
necessary to make the extents at the end of the PV free by using the pvmove command to relocate the
portions of the logical volumes that are using those extents. After the LUN is prepared, you can use
the appropriate storage device utility (such as those available on EVA arrays) to contract the LUN.
The use case for this is a LUN that has been over-provisioned, and the LUN is being contracted to
reclaim the space for use by other LUNs. If a DLC is performed on the storage device without first
preparing the physical volume for DLC with the vgmodify command, the LUN is marked as
unavailable.
Online reprovisioning to decrease the ma
ximum volume group size
The maximum VG size chosen at vgcreate time is larger than necessary for the application using
the volume group. You can use the online vgmodify –S option to decrease (or reprovision) the
maximum VG size. The maximum VG size is changed immediately in this case, and LVM proceeds to
reconfigure all PVs in the VG to decrease the amount of space used for LVM configuration data and
make the space available as new extents for user data.
Online vgmodify
This section provides the typical procedures for using the vgmodify command to perform online
dynamic LUN expansion (DLE), online dynamic LUN contraction (DLC), and online volume group
reprovisioning (changing maximum VG size) for Version 2.x volume groups.
Prerequisites
• T
he volume group must be active.
• The volume group must not be activated in shared mode or read-only mode.
• The volume group must not be in the quiesced state.
• The volume group must not have a cluster lock physical volume. The cmviewcl –v
command displays the device path name of the disk configured as a cluster lock LUN.
• The increase (DLE) or decrease (DLC) in disk size must be greater than the size of a physical
extent on the physical volume.
Online DLE
1. Determin
e which physical volumes in the volume group require expansion and decide how
much each LUN needs to be expanded. This decision can be based on which logical volumes
need to grow and which physical volumes they reside on. Use the lvdisplay –v command
to assist in this analysis. This decision can also be based on whether or not the DLE is being
performed as part of increasing the maximum VG size. See the reprovisioning procedure in
this section for a description of DLE in combination with reprovisioning.
2. For each physical volume being expanded, run the appropriate storage utility to expand the
LUN. Verify that the LUN is expanded by running the diskinfo command.
3. Use the vgmodify review mode to verify which physical volumes require reconfiguration for
DLE and to check if the reconfiguration will yield the desired results. If no PVs are listed on the
command line, vgmodify checks all PVs in the VG. Optionally, you can list the PVs you
want to check in the command line after the VG name.
# vgmodify –r –a –E vg1 # Review mode (-r)
4. Perform the actual DLE reconfiguration (change mode). If no PVs are listed on the command
line, vgmodify attempts reconfiguration on all PVs in the VG (if it detects them as having
been expanded). Optionally, you can list the PVs you want to reconfigure in the command
line after the VG name.
# vgmodify –a –E vg1 # Change mode (–r removed)