2.4. Provisioning Storage

Amazon Elastic Block Storage (EBS) is designed specifically for use with Amazon EC2 instances. Amazon EBS provides storage that behaves like a raw, unformatted, external block device. This section provides step-by-step instructions to provision storage for creating bricks in form of logical volumes. These bricks can be used to create different types of volumes like Gluster arbitrated replicated volumes, Gluster three-way replicated volumes, and Gluster two-way replicated volumes.

Important

  • The supported configuration for a Red Hat Gluster Storage EC2 instance is up to 24 Amazon EBS volumes.
  • If you are provisioning storage for three-way replicated volumes or arbitrated volumes, you must ensure to create each replica set of a volume in three different zones. With this configuration, there will be no impact on the data availability even if two availability zones have hit an outage. Client-side quorum is enabled by default and hence unavailability of two zones would make the access read-only.
  • External snapshots, such as snapshots of a virtual machine/instance, where Red Hat Gluster Storage Server is installed as a guest OS or FC/iSCSI SAN snapshots are not supported.
  • If you want to create arbitrated replicated volumes or three-way replicated volumes, you must use EBS volume type comprising general purpose SSD or PIOPS SSD.
  1. Create a physical volume (PV) by using the following command:
    # pvcreate device
    For example:
    # pvcreate /dev/xvdd
    Physical volume "/dev/xvdd" successfully created.

    Note

    • Here, /dev/xvdd is a storage device. This command has to be executed on all the disks if there are multiple volumes. For example:
      # pvcreate /dev/xvdd /dev/xvde /dev/xvdf…
    • The device name and the alignment value will vary based on the device you are using.
  2. Create a Volume Group (VG) from the PV using the following command:
    # vgcreate volume_group device 
    For example:
    # vgcreate rhs_vg /dev/xvdd
    Volume group "rhs_vg" successfully created

    Note

    Here, /dev/xvdd is a storage device. If you have multiple devices, create multiple VGs.

    Important

    Starting with Red Hat Gluster Storage 3.4, Red Hat does not recommend the aggregation of multiple EBS volumes when they are consumed by a Red Hat Gluster Storage instance. Follow the steps provided in this chapter to configure Red Hat Gluster Storage in an AWS environment.
  3. Create a thin pool of the maximum possible size or the pool size of 0.5% of the EBS volume size:
    # lvcreate --thinpool VOLGROUP/POOLNAME -l 100%FREE --chunksize chunk_size --poolmetadatasize metadata_pool_size --zero n
    
    The maximum possible size for a metadata LV is 16 GiB. Red Hat Gluster Storage recommends creating the metadata device of the maximum supported size. You can allocate less than the maximum if space is a concern, but in this case you should allocate a minimum of 0.5% of the pool size.
    Example 1
    To create a thin pool with the maximum possible metadata device size of the maximum possible size for your device:
    # lvcreate --thinpool rhs_vg/rhs_pool -l 100%FREE --chunksize 256K --poolmetadatasize 16g --zero n
    Using default stripesize 64.00 KiB.
    Logical volume "rhs_pool" created.
    
    Example 2
    To create 0.5% pool metadata size of the EBS volume of size of 20 GiB.
    # lvcreate --thinpool rhs_vg1/rhs_pool1 -l 100%FREE --chunksize 256K --poolmetadatasize 0.1g --zero n
    Using default stripesize 64.00 KiB.
    Rounding up size to full physical extent 104.00 MiB
    
  4. Execute lvs command to get the maximum available device space in the EBS volume. You can use the LSize size listed in this command while creating logical volume. This is to ensure that the entire EBS volume is used and no space is wasted.
    # lvs rhs_vg
    LV       VG     Attr        LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    rhs_pool rhs_vg twi-a-t---  1.97t      0.00   0.02
    
  5. Create a logical volume using the LSize obtained in the previous command to consume entire thin pool into a single LV or you can create multiple LVs from a single thin pool.
    # lvcreate -V lv_size -T VOLGROUP/POOLNAME -n lv_name
    Example 1
    Create a single LV using LSize obtained in the previous command to consume entire thin pool into a single LV:
    # lvcreate -V 1.96T -T rhs_vg/rhs_pool -n rhs_lv
    Using default stripesize 64.00 KiB.
    Rounding up size to full physical extent 1.96 TiB
    Logical volume "rhs_lv" created.
    
    For thin pool auto extension activation/thin_pool_autoextend_threshold should be below 100.
    Example 2
    Create multiple LVs from the single thin pool. This example creates two LVs of size 2G from the thin pool rhs_pool1.
    # lvcreate -V 2G -T rhs_vg1/rhs_pool1 -n rhs_lv
    Using default stripesize 64.00 KiB.
    Logical volume "rhs_lv" created.
    
    # lvcreate -V 2G -T rhs_vg1/rhs_pool1 -n rhs_lv1
    Using default stripesize 64.00 KiB.
    Logical volume "rhs_lv1" created.
    
  6. Format the logical volume using the following command:
    # mkfs.xfs -i size=512 -n size=8192 /VOLGROUP/POOLNAME/
    For example, to format /dev/rhgs_vg/rhgs_lv::
    # mkfs.xfs -i size=512 -n size=8192  /dev/rhgs_vg/rhgs_lv
  7. Create a mount point and mount the logical device using the following commands:
    # mkdir File Mount Path
       # mount -t xfs -o inode64,noatime Logical Volume Path File Mount Path
    For example:
    # mkdir /export/mountlv
    # mount -t xfs -o inode64,noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
  8. Mount the file system automatically by adding the following line in the /etc/fstab:
    # Logical Volume Path File Mount Path  xfs rw,inode64,noatime,nouuid  0 0
    
    For example:
    # /dev/rhgs_vg/rhgs_lv /export/mountlv  xfs rw,inode64,noatime,nouuid  0 0
    
After adding the EBS volumes, you can use the mount points as bricks to be a part of existing or new volumes. For more information on creating two-way replicated volumes, arbitrated replicated volumes, and three-way replicated volumes, see chapter Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide.