How to extend a logical volume in a cluster that is using "HA LVM"?
Environment
- Red Hat Enterprise Linux Server 5, 6, 7, 8 and 9 (with the High Availability and Resilient Storage Add Ons)
- HA-LVM tagging and system_id variant
Issue
- How to extend a logical volume in a cluster that is using High Availability LVM (HA-LVM)?
Resolution
Assuming that HA-LVM is configured according to instructions in What is a Highly Available LVM (HA-LVM) configuration and how do I implement it? you can follow steps below.
-
If there were any changes to storage then first follow article How to rescan the SCSI bus to add or remove a SCSI device without rebooting the computer on all cluster nodes. This is is to ensure that there are no discrepancies in how the nodes in cluster see the storage. All shared storage should be visible same way across the whole cluster.
-
(Optional ) Prepare cluster services/resources for changes by "unmanaging" LVM resources as described in the article below:
- Instructions for rgmanager style clusters
- Instructions for pacemaker style clusters
-
Once prepared, you can follow instructions in solution How to extend a logical volume and its filesystem online in Red Hat Enterprise Linux? to resize the LV and filesystem on it. The resize of LV and extending of filesystem should be carried from the node where the
LVM/LVM-activateresource is marked asStartedstate.- For example, in the following cluster the resize of LV and extend of filesystem should be carried from
ha-node2:
# pcs status Cluster name: testcluster ... Node List: * Online: [ ha-node1 ha-node2 ] ... Full List of Resources: * Resource Group: testgroup: * my_lvm (ocf::heartbeat:LVM-activate): Started ha-node2 * my_fs (ocf::heartbeat:Filesystem): Started ha-node2 - For example, in the following cluster the resize of LV and extend of filesystem should be carried from
-
After finishing changes restore the cluster services/resources as described in articles from step 2.
Possible errors that could be encountered with RHEL8 and RHEL9 clusters with /etc/lvm/devices/system.devices
-
Support for the lvmdevices command set was made available in Rhel 8.5+ and later. This command set is used to limit logical volume manager access to only LV's attached to devices listed in
/etc/lvm/devices/system.devicesfile. If you are using an LVM devices file, anduse_devicesfileis enabled inlvm.conf, additionally add the shared device to the devices file on the second node of the cluster. -
The lvmdevices is enabled by default in RHEL 9 while in RHEL 8.5+ it is disabled by default. When
lvmdevicesis enabled, ensure that the shared devices are added tolvmdeviceson passive node as well else it will result in issue as detailed in following article:
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments