Configuring Red Hat Virtualization with Red Hat Gluster Storage

Red Hat Gluster Storage 3.5

Traditional, non-hyperconverged storage for virtual machines

Red Hat Customer Content Services

Abstract

This document is a step-by-step guide for first-time users to install and configure a basic Red Hat Virtualization environment and enable Red Hat Gluster Storage as a storage domain in a traditional (non-hyperconverged) configuration.
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright's message

Chapter 1. Introduction to Red Hat Gluster Storage for Virtualization

Red Hat Gluster Storage can be configured as a storage domain for Red Hat Virtualization, allowing you to store virtual machine images on Red Hat Gluster Storage instead of in network-attached storage appliances or a storage area network array.
This guide shows you how to configure Red Hat Gluster Storage as a Red Hat Virtualization storage domain in a traditional, non-hyperconverged configuration.
This configuration consists of Red Hat Virtualization hosts, and Red Hat Gluster Storage servers, as illustrated in Figure 1.1, “Architecture of integrated Red Hat Virtualization and Red Hat Gluster Storage”.
Architecture of integrated Red Hat Virtualization and Red Hat Gluster Storage

Figure 1.1. Architecture of integrated Red Hat Virtualization and Red Hat Gluster Storage

Important

Red Hat Virtualization 3.3 onwards includes the GlusterFS storage domain to enable future support for the libgfapi protocol. The GlusterFS storage domain uses the same access mechanism as the POSIXFS domain.

Chapter 2. Support Requirements

This chapter outlines the requirements for creating a supported integration of Red Hat Gluster Storage and Red Hat Virtualization.

2.1. Prerequisites

Integrating Red Hat Gluster Storage with Red Hat Virtualization has the following requirements:

2.2. Compatible Versions

The product and package versions required to create a supported deployment of Red Hat Gluster Storage (RHGS) nodes managed by the specified version of Red Hat Virtualization (RHV) are documented in the following knowledge base article: https://access.redhat.com/articles/2356261.

Chapter 3. Enabling Red Hat Gluster Storage in Red Hat Virtualization Manager

3.1. Using Red Hat Gluster Storage Volumes in the Red Hat Virtualization Manager

Red Hat Virtualization supports Red Hat Gluster Storage volumes as storage domains. Enabling Red Hat Gluster Storage volumes in Red Hat Virtualization Manager requires installation and configuration of several components to create a functioning virtualization environment. You must install and configure each component in the following order:
Installation Workflow

Figure 3.1. Installation Workflow

Procedure 3.1. To Enable Red Hat Gluster Storage in Red Hat Virtualization Manager

  1. Install Red Hat Virtualization Manager

    The Red Hat Virtualization Manager is the control center of the Red Hat Virtualization environment. Ensure that Red Hat Virtualization Manager is installed and configured.
    Install and configure Red Hat Virtualization Manager. See Installing the Red Hat Virtualization Manager in the Red Hat Virtualization Installation Guide for more information: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/installing_red_hat_virtualization_as_a_self-hosted_engine_using_the_cockpit_web_interface/installing_the_red_hat_virtualization_manager_she_cockpit_deploy.
  2. Install Hosts

    Install the virtual machine hosts using either Red Hat Virtualization Hypervisor or Red Hat Enterprise Linux as hosts. Before beginning the installation process, ensure that all virtualization hosts meet the hardware requirements and that the installation of Red Hat Virtualization Manager is complete.
    You can use the following hypervisors as hosts:
    • Red Hat Virtualization Host 4.3
    • Red Hat Enterprise Linux 7
    During installation, set the fully qualified domain name (FQDN) and IP address for the server in order to avoid network conflicts. For information on installing the hypervisor, see Installing Hypervisor Hosts in the Red Hat Virtualization Installation Guide: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/installing_red_hat_virtualization_as_a_self-hosted_engine_using_the_cockpit_web_interface/installing_the_self-hosted_engine_deployment_host_she_cockpit_deploy#Installing_Red_Hat_Virtualization_Hosts_SHE_deployment_host.

    Note

    You must install Red Hat Enterprise Linux 7 on a system to use it as a virtualization host in a Red Hat Virtualization environment. See Installing Red Hat Enterprise Linux Hosts in the Red Hat Virtualization Installation Guide for details: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/installing_red_hat_virtualization_as_a_self-hosted_engine_using_the_cockpit_web_interface/installing_hosts_for_rhv_she_cockpit_deploy#Red_Hat_Enterprise_Linux_hosts_SHE_cockpit_deploy.
  3. Subscribe hosts to channels or repositories

    Red Hat Enterprise Linux hosts need to be registered and subscribed to a number of entitlements using either Subscription Manager or Red Hat Network Classic. For more information, see Enabling the Red Hat Virtualization Manager Repositories in the Red Hat Virtualization Installation Guide: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/installing_red_hat_virtualization_as_a_self-hosted_engine_using_the_cockpit_web_interface/installing_hosts_for_rhv_she_cockpit_deploy.
    Subscribe Red Hat Enterprise Linux 7 hosts to the channel listed below:
    • rhel-7-server-rpms
    • rhel-7-server-rhv-4-mgmt-agent-rpms
    For information on how to install native clients, see Installing Native Client in the Red Hat Gluster Storage Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/sect-native_client#Installing_Native_Client
  4. Configure the Hypervisor

    Red Hat Virtualization Hypervisor host
    Install Red Hat Virtualization Hypervisor 3.5 on bare metal. See Installing the Red Hat Virtualization Hypervisor chapter of the Red Hat Virtualization Installation Guide: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/installing_red_hat_virtualization_as_a_standalone_manager_with_local_databases/installing_hosts_for_rhv_sm_localdb_deploy
    Red Hat Enterprise Linux 7 host
    A Red Hat Enterprise Linux virtualization host must be registered and subscribed to a number of entitlements using either Subscription Manager, See Subscribing to Required Channels using Red Hat Subscription Manager in the Installing Red Hat Enterprise Linux Hosts chapter of the Red Hat Virtualization Installation Guide for more information.
    Subscribe to the Red Hat Gluster Storage Native Client from the Additional Services Channels to ensure the server has the latest clients installed:
    # yum install glusterfs-fuse glusterfs
  5. Configure the data centers

    Define data centers and clusters to organize the virtualization hosts. The installation process creates a data center and associated cluster named Default.

    Note

    A server can be a Red Hat Virtualization Hypervisor or a Red Hat Enterprise Linux host. A trusted storage pool requires a minimum of one storage host, and at least one active virtualization host is required to connect the system to a storage pool.
  6. Install Red Hat Gluster Storage

    Install the latest version of Red Hat Gluster Storage on new servers, not the virtualization hosts.
    For more information on obtaining and installing the software, see the Red Hat Gluster Storage Installation Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/installation_guide/chap-installing_red_hat_storage.
    If you want to configure combined virtualization hosts and storage servers, see the Red Hat Hyperconverged Infrastructure documentation: https://access.redhat.com/documentation/en-us/red_hat_hyperconverged_infrastructure_for_virtualization/1.6/html-single/deploying_red_hat_hyperconverged_infrastructure_for_virtualization/
  7. Configure Storage

    Configure Red Hat Gluster Storage volumes as required by your use case, ensuring that you adhere to the Chapter 2, Support Requirements.
    Optimize your Red Hat Gluster Storage volumes for storing virtual machine images by following the instructions in Procedure 4.1, “Configuring Volumes Using the Command Line Interface”.
    Red Hat Virtualization uses a centralized storage system for virtual machine disk images. Before adding storage, ensure that you have a working Red Hat Virtualization Manager environment. You must be able to access the Administration Portal, and there must be at least one host connected with Up status.
  8. Attach Storage to Hypervisor

    Check that you can access the Red Hat Virtualization Manager Administration Portal and that at least one virtualization host has Up status before you continue.
    Create a new storage domain with a Data domain function and the GlusterFS storage type. For further information, see the Adding a Red Hat Gluster Storage Volume as a Storage Domain section in the Red Hat Virtualization Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html-single/administration_guide/index#Adding_Red_Hat_Gluster_Storage
You can now create virtual machines and its disk images on the Red Hat Gluster Storage volumes by following the instructions in Section 4.2, “Configuring Virtual Machines on Red Hat Gluster Storage volumes using the Red Hat Virtualization Manager”.

Chapter 4. Hosting Virtual Machine Images on Red Hat Gluster Storage volumes

Red Hat Gluster Storage provides a POSIX-compatible file system to store virtual machine images in Red Hat Gluster Storage volumes.
This chapter describes how to configure volumes using the command line interface, and how to prepare Red Hat Gluster Storage servers for virtualization using Red Hat Virtualization Manager.

4.1. Configuring Volumes Using the Command Line Interface

Red Hat recommends configuring volumes before starting them. For information on creating volumes, see Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/chap-red_hat_storage_volumes..

Procedure 4.1. Configuring Volumes Using the Command Line Interface

  1. Configure the rhgs-random-io tuned profile

    Install the tuned tuning daemon and configure Red Hat Gluster Storage servers to use the rhgs-random-io profile:
    # yum install tuned
    # tuned-adm profile rhgs-random-io
    For more information on available tuning profiles, refer to the tuned-adm man page, or see the Red Hat Gluster Storage 3.5 Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/.

    Note

    When you upgrade, a new virt file may be created in /var/lib/glusterd/groups/virt.rpmnew. Apply the new virt file to the existing volumes by renaming the virt.rpmnew file to virt.
  2. Assign volumes to virt group

    Assign volumes that store virtual machine images to the virt volume group to apply the settings in the virt profile. This has the same effect as the Optimize for Virt Store option in the management console.
    # gluster volume set VOLNAME group virt
    See Appendix A, The virt group profile for more information about this configuration.

    Important

    Volumes in the virt group must only be used for storing machine images, and must only be accessed using the native FUSE client.
  3. (Recommended) Configure improved self-heal performance

    Run the following command to improve the performance of volume self-heal operations.
    # gluster volume heal volname cluster.granular-entry-heal enable
  4. Allow KVM and VDSM brick access

    Set the brick permissions for vdsm and kvm. If you do not set the required brick permissions, creation of virtual machines fails.
    1. Set the user and group permissions using the following commands:
      # gluster volume set VOLNAME storage.owner-uid 36
      # gluster volume set VOLNAME storage.owner-gid 36
    2. If you are using QEMU/KVM as a hypervisor, set the user and group permissions using the following commands:
      # gluster volume set VOLNAME storage.owner-uid 107
      # gluster volume set VOLNAME storage.owner-gid 107

4.2. Configuring Virtual Machines on Red Hat Gluster Storage volumes using the Red Hat Virtualization Manager

The following procedure describes how to add a Red Hat Gluster Storage server for virtualization using Red Hat Virtualization Manager.

Note

It is recommended that you use a separate data center for Red Hat Gluster Storage nodes.

Procedure 4.2. To Add a Red Hat Gluster Storage Server for Virtualization Using Red Hat Virtualization Manager

  1. Create a data center:
    1. Select the Data Centers resource tab to list all data centers.
    2. Click New to open the New Data Center window.
      New Data Center Window

      Figure 4.1. New Data Center Window

    3. Enter the Name and Description of the data center.
    4. Select the storage Type as Shared from the drop-down menu.
    5. Select the Quota Mode as Disabled.
    6. Click OK.
    The new data center is Uninitialized until you configure the cluster, host, and storage settings.
  2. Create a cluster:
    1. Select the Clusters resource tab to list all clusters.
    2. Click New to open the New Cluster window.
      New Cluster Window

      Figure 4.2. New Cluster Window

    3. Select a Data Center for the cluster from the drop-down menu.
    4. Enter a Name and Description for the cluster.
    5. Select the CPU Name and Compatibility Version from the drop-down menus.
    6. Check Enable Virt Service.
    7. Click OK.
  3. Add hosts:
    1. Select the Hosts resource tab to view a list of all hosts in the system.
    2. Click New to open the New Host window.
      New Host Window

      Figure 4.3. New Host Window

      Important

      A Red Hat Enterprise Linux hypervisor and Red Hat Virtualization hypervisor on a single VDSM cluster accessing the same virtual machine image store is not supported.
    3. Select the Data Center and Host Cluster for the new host from the drop-down menus.
    4. Enter the Name, Address, and Root Password of the new hypervisor host.
    5. Check Automatically configure host firewall if required.
    6. Click OK.
    The new host appears in the list of hypervisor hosts with the status Installing. After the host is activated, the status changes to Up automatically.
  4. Create and configure volumes on the Red Hat Gluster Storage cluster using the command line interface. For information on creating and configuring volumes, see Section 4.1, “Configuring Volumes Using the Command Line Interface” and Red Hat Gluster Storage Volumes in the Red Hat Gluster Storage Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/chap-red_hat_storage_volumes.
  5. Add a storage domain using Red Hat Virtualization Manager:
    1. Select the Storage resource tab to list existing storage domains.
    2. Click New Domain to open the New Domain window.
      New Domain Window

      Figure 4.4. New Domain Window

    3. Enter a Name for the storage domain.
    4. Select a shared Data Center to associate with the storage domain.
    5. Set the Domain Function to Data and the Storage Type to GlusterFS.
    6. Select a host from the Host to Use drop-down menu.
    7. Check the Use managed gluster volume checkbox and select the appropriate volume from the Gluster dropdown menu.

      Note

      This dropdown menu is only populated with volumes whose nodes are managed by Red Hat Virtualization Manager. See Chapter 5, Managing Red Hat Gluster Storage Servers and Volumes using Red Hat Virtualization Manager for instructions on how to set up management of your Red Hat Gluster Storage nodes by Red Hat Virtualization Manager.
    8. Enter the applicable Red Hat Gluster Storage native client Mount Options. Enter multiple mount options separated by commas. For more information on native client mount options, see Creating Access to Volumes in the Red Hat Gluster Storage Administration Guide: https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/chap-accessing_data_-_setting_up_clients. Note that only the native client is supported when integrating Red Hat Gluster Storage and Red Hat Virtualization.
    9. Click OK.
You can now create virtual machines using Red Hat Gluster Storage as a storage domain. For more information on creating virtual machines, see the Red Hat Virtualization Virtual Machine Management Guide: https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.1/html/virtual_machine_management_guide/.

Note

To prevent the risk of split brain incidents on Red Hat Gluster Storage domains, the use of shareable disks on Red Hat Gluster Storage domains is disabled. Attempting to create a shareable disk brings up a warning in the administration portal which recommends the use of Quorum on the Red Hat Gluster Storage server to ensure data integrity.
This policy is not enforced on Red Hat Gluster Storage domains created on a POSIX domain with GlusterFS specified as the virtual file system type.

Chapter 5. Managing Red Hat Gluster Storage Servers and Volumes using Red Hat Virtualization Manager

You can create and configure Red Hat Gluster Storage volumes using Red Hat Virtualization Manager 3.3 or later by creating a separate cluster with the Enable Gluster Service option enabled.

Note

Red Hat Gluster Storage nodes must be managed in a separate cluster to Red Hat Virtualization hosts. If you want to configure combined management of virtualization hosts and storage servers, see the Red Hat Hyperconverged Infrastructure documentation: https://access.redhat.com/documentation/en-us/red_hat_hyperconverged_infrastructure/1.0/html/deploying_red_hat_hyperconverged_infrastructure/
A volume is a logical collection of bricks where each brick is an export directory on a server in the trusted storage pool. Most of the management operations for Red Hat Gluster Storage happen on these volumes. You can use Red Hat Virtualization Manager to create and start new volumes featuring a single global namespace.

Note

With the exception of the volume operations described in this section, all other Red Hat Gluster Storage functionalities must be executed from the command line.

5.1. Creating a Data Center

  1. Select the Data Centers resource tab to list all data centers in the results list.
  2. Click the New button to open the New Data Center window.
    New Data Center Window

    Figure 5.1. New Data Center Window

  3. Enter the Name and Description of the data center.
  4. Set Type to Shared from the drop-down menu.
    Set Quota Mode as Disabled.
  5. Click OK.
The new data center is added to the virtualization environment. It will remain Uninitialized until a cluster, host, and storage are configured.

5.2. Creating a Cluster

  1. Create a cluster with the gluster service enabled.
    New Cluster Window

    Figure 5.2. New Cluster Window

  2. Select the Compatibility Version from the drop-down menu.
  3. Click OK.

Important

While creating a cluster, use iptables for the option Firewall Type.

5.3. Adding Red Hat Gluster Storage Server to the Cluster

There are two ways to add hosts. You can either add new hosts or import the existing gluster configuration into a cluster.
  • To import an existing gluster configuration:
    1. Select Enable Gluster Service.
    2. Select Import existing gluster configuration. With this option you can import the existing Gluster configurations into a cluster.
    3. Provide the IP address of one of the hosts.
  • To add new hosts:
    1. Use the drop-down lists to select the Data Center and Host Cluster for the new host.
    2. Click OK.
      The new host displays in the list of hosts with a status of Installing. The host is activated and the status changes to Up automatically.
    You can manage the lifecycle of a volume using hook scripts.

    Note

    Install cockpit using # yum install cockpit, before adding the Red Hat Gluster Storage 3.5 node to Red Hat Virtualization Manager 4.3 in 4.3 compatible cluster.

    Note

    To add multiple servers to a cluster, you must first add a Red Hat Gluster Storage server to the cluster. An error message appears if you add multiple servers in the first attempt.
    New Host window

    Figure 5.3. New Host window

5.4. Optimizing Red Hat Gluster Storage Volumes for Virtual Machine Images

If you have not already selected Optimize for Virt Store while creating a volume, select this option now to optimize your storage for virtual machine images. This has the same effect as adding the volume to the virt group.

5.5. Starting the Red Hat Gluster Storage Volume

  • In the Volumes tab, select the new volume and click Start to start the volume.
    The volume status changes to Up.

    Important

    If you are using Red Hat Gluster Storage Volumes for hosting Virtual Machine images, you must optimize the volume before attaching the volume to the storage domain.

5.6. Adding Bricks to Volumes

  1. Click Add Bricks to add bricks to your volume.
    A brick is the basic unit of storage, represented by an export directory on a server in the storage cluster. You can expand or shrink your cluster by adding new bricks or deleting existing bricks.
    Add Bricks

    Figure 5.5. Add Bricks

  2. Enter the path for the brick and click OK.
  3. In the Allow Access From field, specify volume access control as a comma-separated list of IP addresses or hostnames.
    By default, an asterisk (*) is used as a wildcard to specify ranges of addresses such as IP addresses or hostnames. You need to use IP-based authentication for Gluster exports.
  4. Click OK to create the volume.
    The new volume is added and it appears on the Volumes tab.
You can reuse a brick by selecting Allow bricks in root partition and reuse the bricks by clearing xattrs
You can create a storage domain using the optimized volume and manage it using Red Hat Virtualization Manager.

5.7. Performing Asynchronous Tasks

From the Red Hat Virtualization Manager 3.5 release onwards, you can perform asynchronous tasks on the Red Hat Gluster Storage volume such as rebalance and remove brick operations.

Appendix A. The virt group profile

The /var/lib/glusterd/groups/virt file defines a configuration that is used for all volumes in the virt group. Defining a group configuration and adding volumes to a group helps save time and effort when you want to update the settings on all volumes in the group.
The default contents of the /var/lib/glusterd/groups/virt file are as follows:
performance.quick-read=off
performance.read-ahead=off
performance.io-cache=off
performance.low-prio-threads=32
network.remote-dio=enable
cluster.eager-lock=enable
cluster.quorum-type=auto
cluster.server-quorum-type=server
cluster.data-self-heal-algorithm=full
cluster.locking-scheme=granular
cluster.shd-max-threads=8
cluster.shd-wait-qlength=10000
features.shard=on
user.cifs=off
cluster.choose-local=off
client.event-threads=4
server.event-threads=4
performance.client-io-threads=on
The majority of these settings prevent caching in the client stack.
The cluster.eager-lock option optimizes write performance by using synchronous replication when there is a single writer to a file.
The cluster.data-self-heal option specifies how self-heal operations are performed.
The features.shard and features.shard-block-size options enable sharding behavior in the volume and set a block size appropriate for storing disk images.
The cluster.quorum-type=auto and cluster.server-quorum-type options enable client and server-side quorum to help ensure consistency and to prevent split-brain scenarios.

Note

The default settings of cluster.quorum-type=auto and cluster.server-quorum-type=server provide consistency at the cost of fault tolerance. Using these settings, if server-side quorum is not met, virtual machines pause because volumes are not available. If client-side quorum is not met, virtual machines pause even though a read-only replica pair is available. Manual intervention is then required to make the VMs resume the operations after the quorum is restored.
If fault tolerance is preferred over consistency, disable server-side and client-side quorum with the following commands:
# gluster volume reset volname server-quorum-type
# gluster volume reset volname quorum-type
See Supported Volume Options in the Red Hat Gluster Storage 3.5 Administration Guide for more information about any of these settings.

Appendix B. Revision History

Revision History
Revision 3.5-2Tue Sep 04 2018Red Hat Gluster Storage Documentation Team
Updates for Red Hat Gluster Storage 3.5 release.
Revision 3.5-1Tue Feb 06 2018Laura Bailey
Clarified that this document is for the non-hyperconverged virtualization and storage use case (BZ#1402404)

Legal Notice

Copyright © 2015-2018 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.