13.6. Define the File Share Service Back End

The File Share Service requires a back end. Each back end is defined in its own section in /etc/manila/manila.conf. As mentioned earlier in Chapter 13, Install the File Share Service (Technology Preview), the File Share Service can use either of two share drivers; the back end configuration is different depending on your chosen driver. For detailed information about back end configuration for either driver type, refer to the appropriate subsection.

13.6.1. Define a Back End for the gluster_native Driver

The gluster_native driver uses the FUSE protocol to serve shares, and secures share access through TLS. In addition, provisioning a share with this driver consumes an entire volume; this volume must already exist at the back end. The following code snippet defines a suitable back end for this scenario, named glusternative:
[glusternative1] # 1
share_backend_name = GLUSTERNATIVE # 2
share_driver = manila.share.drivers.glusterfs_native.GlusterfsNativeShareDriver # 3
glusterfs_servers = root@RHGSNODE1,root@RHGSNODE2 # 4
driver_handles_share_servers=False # 5
glusterfs_volume_pattern = manila-share-volume-#{size}G-\d+$ # 6

1

The header ([glusternative1]) specifies the back end definition. The File Share Service uses this definition when enabling back ends (through the enabled_share_backends option).

2

share_backend_name: the name of the back end. When multiple back ends are enabled, use this value (GLUSTERNATIVE) as an extra specification when creating a share type for the back end (as in Section 13.9, “Create a Share Type for the Defined Back End” later on).

3

share_driver: the share driver that the File Share Service should use for the defined back end. In this case, manila.share.drivers.glusterfs_native.GlusterfsNativeShareDriver sets the glusterfs_native driver.

4

glusterfs_servers: specifies the server/s that provide the pool of Red Hat Gluster Storage volumes. Each IP/host name in the comma-separated list (RHGSNODE1, RHGSNODE2, and so on) is the node from a distinct Red Hat Gluster Storage cluster (specifically, this must be the node where the shared volumes are available).

5

driver_handles_share_servers: defines whether the driver should handle share servers. The glusterfs_native driver does not use share servers, so this is set to False for now.

6

glusterfs_volume_pattern: defines the naming convention used by the pre-created volumes available as back ends for the File Share Service.
The string manila-share-volume-#{size}G-\d+$ is a REGEX pattern that helps filter available volumes on the back end based on name. This pattern will match volume names that:
  • start with manila-share-volume-,
  • are followed by the size (in gigabytes) + G, and
  • end in a number (which can serve as a unique identifier).
The purpose of using this particular pattern is to allow the File Share Service to filter available volumes on the back end by size based on the volume name alone. For example, the naming convention used in Section 13.1.1, “glusterfs_native” calls for the creation of a 1GB volume named manila-share-volume-1GB-01, which would be matched when creating a share requiring 1GB.

Note

When configured to filter size using volume names, the File Share Service will also match larger-sized volumes, and will choose the closest size. For example, if you provision a 3GB share and no manila-share-volume-3G-* volumes exist, the File Share Service will match both manila-share-volume-4G-* and manila-share-volume-5G-*, but will pick manila-share-volume-4G-*.
Next, enable the back end definition [glusternative1] by configuring the following options in the [DEFAULT] section of /etc/manila/manila.conf:
enabled_share_backends=glusternative1 # 1
enabled_share_protocols=GLUSTERFS # 2

1

enabled_share_backends: defines which back ends are enabled. Each specified value here must have a corresponding section defining a back end’s settings. You can enable multiple back ends here by listing them all as a comma-separated list (for example, enabled_share_backends=glusternative1,generic).

2

enabled_share_protocols: defines what protocols are used for all enabled back ends. The GLUSTERFS protocol is the only protocol supported by the glusterfs_native driver.
After configuring the back end, you will also need to configure compute instances for TLS-based authentication. The following subsection describes how to do so.

13.6.1.1. Configure Compute Instances for TLS-Based Authentication

Red Hat Gluster Storage supports TLS-based authentication and network encryption to secure back end access. The File Share Service’s gluster_native driver, in turn, is TLS-compatible; instances can then authenticate through TLS and use shares securely.
As such, if your Red Hat Gluster Storage back ends have TLS authentication enabled, all instances that will use provisioned shares must be able to authenticate first. For instructions on how to properly set up secure, encrypted communication between the Red Hat Gluster Storage host and its clients, see Configuring Network Encryption in Red Hat Gluster Storage and Authorizing a New Client.
After configuring the back end, see Section 13.7, “Enable Passwordless SSH Access to Back End” for instructions on how to enable passwordless access to it.

13.6.2. Define an NFS Back End for the glusterfs Driver

The glusterfs driver allows you to serve shares through either NFS or NFS-Ganesha. The following code snippet is suitable for a back end serving shares over NFS:
[glusternfs] # 1
share_backend_name = GLUSTERNFS # 2
share_driver = manila.share.drivers.glusterfs.GlusterfsShareDriver # 3
glusterfs_target = root@RHGSNODE1:/manila-nfs-volume-01  # 4
glusterfs_nfs_server_type = Gluster # 5
driver_handles_share_servers=False # 6

1

The header ([glusternfs]) specifies the back end definition. The File Share Service uses this definition when enabling back ends (through the enabled_share_backends option).

2

share_backend_name: the name of the back end. When multiple back ends are enabled, use this value (GLUSTERNFS) as an extra specification when creating a share type for the back end (as in Section 13.9, “Create a Share Type for the Defined Back End” later on).

3

share_driver: the share driver that the File Share Service should use for the defined back end. In this case, manila.share.drivers.glusterfs.GlusterfsShareDriver sets the glusterfs driver (as explained in Section 13.1.2, “glusterfs”).

4

glusterfs_target: specifies the Red Hat Gluster Storage volume on which sub-directories should be created for the share. Replace RHGSNODE1 with the IP address of the Red Hat Gluster Storage host.

5

glusterfs_nfs_server_type: defines what type of NFS server the Red Hat Gluster Storage back end uses. In this deployment, the type should be Gluster. For more information about the NFS server used in this scenario, see NFS.

6

driver_handles_share_servers: specifies whether the driver should handle share servers. As the glusterfs driver does not use share servers, this should be False.
Next, enable the back end definition [glusternfs] by configuring the following options in the [DEFAULT] section of /etc/manila/manila.conf:
enabled_share_backends=glusternfs # 1
enabled_share_protocols=NFS # 2

1

enabled_share_backends: defines which back ends are enabled. Each specified value here must have a corresponding section defining a back end’s settings. By default, this is set to enabled_share_backends=generic. You can enable multiple back ends here by listing them all as a comma-separated list (for example, enabled_share_backends=glusternfs,generic).

2

enabled_share_protocols: defines what protocols are used for all enabled back ends. The glusterfs driver supports the NFS protocol. This setting is not configured by default.
After configuring the back end, see Section 13.7, “Enable Passwordless SSH Access to Back End” for instructions on how to enable passwordless access to it.

13.6.3. Define an NFS-Ganesha Back End for the glusterfs Driver

On the File Share Service host, the service’s settings are configured in /etc/manila/manila.conf. Each back end is defined in its own section; Packstack defines a default one named [generic]. You can add the following code snippet to define a new back end section named glusternfsganesha to the File Share Service:
[glusternfsganesha] # 1
share_backend_name = GLUSTERNFSGANESHA # 2
share_driver = manila.share.drivers.glusterfs.GlusterfsShareDriver # 3
glusterfs_target = root@RHGSNODE1:/manila-nfs-volume-01  # 4
glusterfs_nfs_server_type = Ganesha # 5
ganesha_service_name = nfs-ganesha # 6
glusterfs_ganesha_server_username = NFSGADMIN # 7
glusterfs_ganesha_server_password = NFSGPW # 8
driver_handles_share_servers=False # 9

1

The header ([glusternfsganesha]) specifies the back end definition. The File Share Service uses this definition when enabling back ends (through the enabled_share_backends option).

2

share_backend_name: the name of the back end. When multiple back ends are enabled, use this value (GLUSTERNFSGANESHA) as an extra specification when creating a share type for the back end (as in Section 13.9, “Create a Share Type for the Defined Back End” later on).

3

share_driver: the share driver that the File Share Service should use for the defined back end. In this case, manila.share.drivers.glusterfs.GlusterfsShareDriver sets the glusterfs driver.

4

glusterfs_target: specifies the Red Hat Gluster Storage volume on which sub-directories should be created for the share. Replace RHGSNODE1 with the IP address of the Red Hat Gluster Storage host.

5

glusterfs_nfs_server_type: defines what type of NFS server the Red Hat Gluster Storage back end uses. In this deployment, the type should be Ganesha. For more information about the NFS server used in this scenario, see NFS-Ganesha.

6

ganesha_service_name: defines the NFS-Ganesha service name. Typically, this is set to nfs-ganesha.

7

glusterfs_ganesha_server_username: sets the username (NFSGADMIN) that the File Share Service should use to use the NFS-Ganesha service.

8

glusterfs_ganesha_server_password: sets the corresponding password (NFSGPW) of the username defined in +glusterfs_ganesha_server_username.

9

driver_handles_share_servers: specifies whether the driver should handle share servers. As the glusterfs driver does not use share servers, this should be False.
Next, enable the back end definition [glusternfsganesha] by configuring the following options in the [DEFAULT] section of /etc/manila/manila.conf:
enabled_share_backends=glusternfsganesha # 1
enabled_share_protocols=NFS # 2

1

enabled_share_backends: defines which back ends are enabled. Each specified value here must have a corresponding section defining a back end’s settings. By default, this is set to enabled_share_backends=generic. You can enable multiple back ends here by listing them all as a comma-separated list (for example, enabled_share_backends=glusternfsganesha,generic).

2

enabled_share_protocols: defines what protocols are used for all enabled back ends. The glusterfs driver supports the NFS protocol. This setting is not configured by default.
After configuring the File Share Service, install the Red Hat Gluster Storage client packages:
# yum -y install glusterfs glusterfs-fuse
Then, log in to the NFS-Ganesha back end (RHGSNODE1). From there, create the following files:
+/etc/ganesha/export.d/INDEX.conf+
+/etc/ganesha/ganesha.conf+
The INDEX.conf must remain empty, while the ganesha.conf file must contain the following:
%include /etc/ganesha/export.d/INDEX.conf
After configuring the back end, see Section 13.7, “Enable Passwordless SSH Access to Back End” for instructions on how to enable passwordless access to it.