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: Visit the Red Hat Customer Service Portal at https://access.redhat.com/login and enter your user name and password to log in. Click Downloads to visit the Software & Download Center . In the Red Hat Gluster Storage Server area, click Download Software to download the latest version of the VHD image. Navigate to the directory where the file was downloaded and execute the sha256sum command on the file. For example, 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. Unzip the downloaded file rhgs-azure-[version].zip to extract the archive contents. For example, 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: Create the cloud service for the Gluster Storage nodes. For example, cloudapp.net will be appended to the service name, and the full service name will be exposed directly to the Internet. In this case, rhgs313-cluster.cloudapp.net. Create a virtual network for the Gluster Storage nodes to connect to. In this example, the network is created within the East US location. 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. Note 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: For example, Once complete, confirm the image is available: Note 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. To create instances from the prepared image For example, Adding 1023 GB data disk to each of the instances. For example Perform the above steps of creating instances and attaching disks for all the instances Confirm that the instances have been properly created: 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. Example Following is the example for creating four instances from the prepared image. They are named rhgs31-n . Their IP address are 10.18.0.11 to 10.18.0.14. As the instances are created ( azure vm create ), they can be added to the same availability set ( --availability-set ). Add four 1023 GB data disks to each of the instances. Confirm that the instances have been properly created: Note 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). Note 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. Log into each node. 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.5 channels, see the Installing Red Hat Gluster Storage chapter in the Red Hat Gluster Storage 3.5 Installation Guide . Update each node to ensure the latest enhancements and patches are in place. 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.

Commands:
sha256sum rhgs-azure-3.5-rhel-7-x86_64.tar.gz 2d083222d6a3c531fa2fbbd21c9ea5b2c965d3b8f06eb8ff3b2b0efce173325d rhgs-azure-3.5-rhel-7-x86_64.tar.gz
tar -xvzf rhgs-azure-3.5-rhel-7-x86_64.tar.gz
azure service create --serviceName service_name --location location
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
azure network vnet create --vnet "rhgs313-vnet" --location "East US" --address-space 10.18.0.0 --cidr 16 info: Executing command network vnet create info: Using default subnet start IP: 10.18.0.0 info: Using default subnet cidr: 19 + Looking up network configuration + Looking up locations + Setting network configuration info: network vnet create command OK
azure vm image create image_name --location location --os linux VHD_image_name
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: https://bauderhel7.blob.core.windows.net/vm-images/rhgs313.vhd was uploaded successfully info: vm image create command OK
azure vm image list | awk 'USD3 == "User" {print USD2;}'
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
azure vm create --vm-name rhgs313-1 --availability-set AS1 -S 10.18.0.11 --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
azure vm disk attach-new VM_name 1023
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
azure vm list azure vm show vm-name
for i in 1 2 3 4; do as=USD((i/3)); azure vm create --vm-name rhgs31-USDi --availability-set ASUSDas -S 10.18.0.1USDi --vm-size Medium --virtual-network-name rhgs-vnet --ssh 5000USDi --connect rhgs-cluster rhgs3.1 rhgsuser 'AzureAdm1n!'; done
for node in 1 2 3 4; do for disk in 1 2 3 4; do azure vm disk attach-new rhgs31-USDnode 1023; done ; done
azure vm list azure vm show vm-name
ssh rhgsuser@rhgs313-cluster.cloudapp.net -p 50001
yum update