Appendix D. Creating New Logical Volumes for an Existing Cluster

The Red Hat High Availability Add-On provides support for high availability LVM volumes (HA-LVM) in a failover configuration.

Note

In Red Hat Enterprise Release 6 HA Cluster with Pacemaker, clvmd is not supported in combination with the LVM resource agent used by Pacemaker when using the volumes in an exclusive, active/passive manner.
To create new volumes, either volumes need to be added to a managed volume group on the node where it is already activated by the service, or the volume_list must be temporarily bypassed or overridden to allow for creation of the volumes until they can be prepared to be configured by a cluster resource.
To create a new logical volume on the same node where the LVM resource for that volume group is already started,m use the following procedure:
  1. The volume group should already be tagged on the node owning that service, so simply create the volumes with a standard lvcreate command on that node.
    Determine the current owner of the relevant service.
    # pcs resource
    On the node where the service is started, create the logical volume.
    # lvcreate -l 100%FREE -n lv2 myVG
  2. Add the volume into the service configuration in whatever way is necessary.
To create a new volume group entirely, use the following procedure.
  1. Create the volume group on one node with the tag pacemaker while overriding the volume_list to allow this tag. Specify any desired settings for this volume group as normal and specify the --addtag and --config options as in the following example:
    #  vgcreate myNewVG /dev/mapper/mpathb --addtag pacemaker --config 'activation { volume_list = [ "@pacemaker" ] }'
  2. Create logical volumes within this volume group as in the following example, otherwise perform any necessary administration on the volume group. This example creates a logical volume that is 1G in size. Create the filesystem as well on the logical volume if required.
    # lvcreate --addtag pacemaker -L +1G -n testlv1 myNewVG --config 'activation { volume_list = [ "@pacemaker" ] }'
    Logical volume "testlv1" created
    
  3. When the volume group activity is complete, deactivate the volume group and remove the tag, as in the following example.

    Note

    Use the same tag as you used previously, if you used a tag other than pacemaker. When you add the volume group as a resource in the cluster, all the logical volumes in that volume group will get activated on a single node.
    # lvchange -an myNewVG/testlv1 --deltag pacemaker
    Logical volume "testlv1" changed.
    # vgchange -an myNewVG --deltag pacemaker
    Volume group "myNewVG" successfully changed
    0 logical volume(s) in volume group "myNewVG" now active
    
  4. Create the volume group resource, as in the following example.
    # pcs resource create mynewvg LVM volgrpname=myNewVG exclusive=true