Red Hat Training

A Red Hat training course is available for Red Hat Gluster Storage

3.6.  Appendix - Setting up Red Hat Gluster Storage in Microsoft Azure in ASM Mode

This section provides step-by-step instructions to set up Red Hat Gluster Storage in Microsoft Azure.

3.6.1. Obtaining Red Hat Gluster Storage for Microsoft Azure

To download the Red Hat Gluster Storage Server files using a Red Hat Subscription or a Red Hat Evaluation Subscription:
  1. Visit the Red Hat Customer Service Portal at and enter your user name and password to log in.
  2. Click Downloads to visit the Software & Download Center.
  3. In the Red Hat Gluster Storage Server area, click Download Software to download the latest version of the VHD image.
  4. Navigate to the directory where the file was downloaded and execute the sha256sum command on the file.
    For example,
    $ sha256sum rhgs-azure-3.2-rhel-7-x86_64.tar.gz
    2d083222d6a3c531fa2fbbd21c9ea5b2c965d3b8f06eb8ff3b2b0efce173325d rhgs-azure-3.2-rhel-7-x86_64.tar.gz
    The value generated by the sha256sum utility must match the value displayed on the Red Hat Customer Portal for the file. If they are not the same, your download is either incomplete or corrupt, and you will need to download the file again. If the checksum is not successfully validated after several attempted downloads, contact Red Hat Support for assistance.
  5. Unzip the downloaded file rhgs-azure-[version].zip to extract the archive contents.
    For example,
    # tar -xvzf rhgs-azure-3.2-rhel-7-x86_64.tar.gz

3.6.2.  Define the Network Topology

By default, deploying an instance into a cloud service will pick up a dynamically assigned, internal IP address. This address may change and vary from site to site. For some configurations, consider defining one or more virtual networks within your account for instances to connect to. That establishes a networking configuration similar to an on-premise environment.
To create a simple network:
  1. Create the cloud service for the Gluster Storage nodes.
    # azure service create --serviceName service_name --location location
    For example,
    # azure service create --serviceName rhgs313-cluster --location "East US"
    info:    Executing command service create
    + Creating cloud service                                                       
    data:    Cloud service name rhgs313-cluster
    info:    service create command OK will be appended to the service name, and the full service name will be exposed directly to the Internet. In this case,
  2. Create a virtual network for the Gluster Storage nodes to connect to. In this example, the network is created within the East US location.
    # azure network vnet create --vnet "rhgs313-vnet" --location "East US" --address-space --cidr 16
    info:    Executing command network vnet create
    info:    Using default subnet start IP:
    info:    Using default subnet cidr: 19
    + Looking up network configuration                                             
    + Looking up locations                                                         
    + Setting network configuration                                                
    info:    network vnet create command OK
This defines a network within a single region.
Features like geo-replication within Gluster Storage require a vnet-to-vnet configuration. A vnet-to-vnet configuration connects virtual networks through VPN gateways. Each virtual network can be within the same region or across regions to address disaster recovery scenarios. Joining VPNs together requires a shared key, and it is not possible to pass a shared key through the Microsoft Azure CLI. To define a vnet-to-vnet configuration, use the Windows Powershell or use the Microsoft Azure REST API.

3.6.3.  Upload the Disk Image to Microsoft Azure

The disk image can be uploaded and used as a template for creating Gluster Storage nodes.


Microsoft Azure commands must be issued from the local account configured to use the xplat-cli.
To upload the image to Microsoft Azure, navigate to the directory where the VHD image is stored and run the following command:
# azure vm image create image_name --location location --os linux VHD_image_name
For example,
 # azure vm image create rhgs-3.1.3 --location "East US" --os linux rhgs313.vhd
 info:    Executing command vm image create
+ Retrieving storage accounts
info:    VHD size : 20 GB
info:    Uploading 20973568.5 KB
Requested:100.0% Completed:100.0% Running:   0 Time: 7m50s Speed:  3876 KB/s
info: was uploaded successfully
info:    vm image create command OK
Once complete, confirm the image is available:
# azure vm image list | awk '$3 == "User" {print $2;}'


The output of an instance image list will show public images as well as images specific to your account (User), so awk is used to display only the images added under the Microsoft Azure account.

3.6.4.  Deploy the Gluster Storage Instances

Individual Gluster Storage instances in Microsoft Azure can be configured into a cluster. You must first create the instances from the prepared image and then attach the data disks.
  1. To create instances from the prepared image
    # azure vm create --vm-name vm_name --availability-set name_of_the_availability_set --vm-size size --virtual-network-name vnet_name --ssh port_number --connect cluster_name username_and_password
    For example,
    # azure vm create --vm-name rhgs313-1 --availability-set AS1 -S --vm-size Medium --virtual-network-name rhgs313-vnet --ssh 50001 --connect rhgs313-cluster rhgs-3.1.3  rhgsuser 'AzureAdm1n!'
     info:    Executing command vm create
    + Looking up image rhgs-313                                                    
    + Looking up virtual network                                                   
    + Looking up cloud service                                                     
    + Getting cloud service properties                                             
     + Looking up deployment                                                        
    + Creating VM                                                                  
    info:    OK
    info:    vm create command OK
  2. Adding 1023 GB data disk to each of the instances.
    # azure vm disk attach-new VM_name 1023
    For example
    # azure vm disk attach-new rhgs313-1 1023
    info:    Executing command vm disk attach-new
    + Getting virtual machines                                                     
    + Adding Data-Disk                                                             
    info:    vm disk attach-new command OK
  3. Perform the above steps of creating instances and attaching disks for all the instances
  4. Confirm that the instances have been properly created:
    # azure vm list
    # azure vm show vm-name
  • A Microsoft Azure availability set provides a level of fault tolerance to the instances it holds, protecting against system failure or planned outages. This is achieved by ensuring instances within the same availability set are deployed across different fault and upgrade domains within a Microsoft Azure datacenter.
  • When Gluster Storage replicates data between bricks, associate the replica sets to a specific availability set. By using availability sets in the replication design, incidents within the Microsoft Azure infrastructure cannot affect all members of a replica set simultaneously.
  • Each instance is assigned a static IP (-S) within the rhgs-- virtual network and an endpoint added to the cloud service to allow SSH access (--ssh port).
  • There are single quotation marks (') around the password to prevent bash interpretation issues.

Following is the example for creating four instances from the prepared image.

  • They are named rhgs31-n .
  • Their IP address are to
As the instances are created (azure vm create), they can be added to the same availability set (--availability-set).
for i in 1 2 3 4; do as=$((i/3)); azure vm create --vm-name rhgs31-$i --availability-set AS$as -S$i --vm-size Medium --virtual-network-name rhgs-vnet --ssh 5000$i --connect rhgs-cluster rhgs3.1 rhgsuser 'AzureAdm1n!'; done
Add four 1023 GB data disks to each of the instances.
for node in 1 2 3 4; do for disk in 1 2 3 4; do azure vm disk attach-new rhgs31-$node 1023; done ; done
Confirm that the instances have been properly created:
# azure vm list
# azure vm show vm-name


This example uses static IP addresses, but this is not required. If you’re creating a single Gluster Storage cluster and do not need features like geo-replication, it is possible to use the dynamic IPs automatically assigned by Microsoft Azure. The only important thing is that the Gluster Storage cluster is defined by name.

3.6.5.  Configure the Gluster Storage Cluster

Configure these instances to form a trusted storage pool (cluster).


If you are using Red Hat Enterprise Linux 7 machines, log in to the Microsoft Azure portal and reset the password for the VMs and also restart the VMs. On Red Hat Enterprise Linux 6 machines, password reset is not required.
  1. Log into each node.
    # ssh -p 50001
  2. Register each node to Red Hat Network using the subscription-manager command, and attach the relevant Red Hat Storage subscriptions.
    For information on subscribing to the Red Hat Gluster Storage 3.2 channels, refer to the Installing Red Hat Gluster Storage chapter in the Red Hat Gluster Storage Installation Guide.
  3. Update each node to ensure the latest enhancements and patches are in place.
    # yum update
  4. Follow the instructions in the Adding Servers to the Trusted Storage Pool chapter in the Red Hat Gluster Storage Administration Guide to create the trusted storage pool.