2.5. Provisioning Storage Amazon Elastic Block Storage (EBS) is designed specifically for use with Amazon EC2 instances. Amazon EBS provides storage that works 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, and Gluster three-way replicated volumes. 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. 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 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 are unavailable. 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 or an instance where Red Hat Gluster Storage Server is installed as a guest operating system, and Fibre Channel or 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. Create a physical volume (PV) by using the following command: For example: Note /dev/xvdd is a storage device. This command has to be executed on all the disks if there are multiple volumes. For example: The device name and the alignment value will vary based on the device you are using. Create a Volume Group (VG) from the PV using the following command: For example: Note /dev/xvdd is a storage device. If you have multiple devices, create multiple VGs. Create a thin pool of the maximum possible size or the pool size of 0.5% of the EBS volume size: 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: Example 2 To create 0.5% pool metadata size of the EBS volume of size of 20 GiB. 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. Create a logical volume using the LSize obtained in the command to consume the entire thin pool into a single LV or you can create multiple LVs from a single thin pool. Example 1 Create a single LV using LSize obtained in the command to consume entire thin pool into a single LV: 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. Format the logical volume using the following command: For example, to format /dev/rhgs_vg/rhgs_lv: : Create a mount point and mount the logical device using the following commands: For example: Mount the file system automatically by adding the following line in the /etc/fstab : For example: 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 arbitrated replicated volumes, and three-way replicated volumes, see chapter Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide .

Commands:
pvcreate device
pvcreate /dev/xvdd Physical volume "/dev/xvdd" successfully created.
pvcreate /dev/xvdd /dev/xvde /dev/xvdf...
vgcreate volume_group device
vgcreate rhs_vg /dev/xvdd Volume group "rhs_vg" successfully created
lvcreate --thinpool VOLGROUP / POOLNAME -l 100%FREE --chunksize chunk_size --poolmetadatasize metadata_pool_size --zero n
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.
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
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
lvcreate -V lv_size -T VOLGROUP / POOLNAME -n lv_name
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.
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.
mkfs.xfs -i size=512 -n size=8192 /VOLGROUP/POOLNAME/
mkfs.xfs -i size=512 -n size=8192 /dev/rhgs_vg/rhgs_lv
mkdir File Mount Path # mount -t xfs -o inode64,noatime Logical Volume Path File Mount Path
mkdir /export/mountlv mount -t xfs -o inode64,noatime /dev/rhgs_vg/rhgs_lv /export/mountlv
Logical Volume Path File Mount Path xfs rw,inode64,noatime,nouuid 0 0
/dev/rhgs_vg/rhgs_lv /export/mountlv xfs rw,inode64,noatime,nouuid 0 0