This section explains how to configure OpenStack Block Storage
to use GlusterFS as a back end. You must be able to access the
GlusterFS shares from the server that hosts the
cinder volume
service.
![]() | Note |
|---|---|
The
In Ubuntu and Debian distributions, the
|
Mounting GlusterFS volumes requires utilities and libraries from the glusterfs-fuse package. This package must be installed on all systems that will access volumes backed by GlusterFS.
![]() | Note |
|---|---|
The utilities and libraries required for mounting GlusterFS volumes on Ubuntu and Debian distributions are available from the glusterfs-client package instead. |
For information on how to install and configure GlusterFS, refer to the GlusterDocumentation page.
Procedure 6.2. Configure GlusterFS for OpenStack Block Storage
The GlusterFS server must also be configured accordingly in order to allow OpenStack Block Storage to use GlusterFS shares:
Log in as
rootto the GlusterFS server.Set each Gluster volume to use the same UID and GID as the
cinderuser:# gluster volume set
VOL_NAMEstorage.owner-uidcinder-uid# gluster volume setVOL_NAMEstorage.owner-gidcinder-gidWhere:
VOL_NAMEis the Gluster volume name.cinder-uidis the UID of thecinderuser.cinder-gidis the GID of thecinderuser.
![[Note]](../common/images/admon/note.png)
Note The default UID and GID of the
cinderuser is165on most distributions.Configure each Gluster volume to accept
libgfapiconnections. To do this, set each Gluster volume to allow insecure ports:# gluster volume set
VOL_NAMEserver.allow-insecure onEnable client connections from unprivileged ports. To do this, add the following line to
/etc/glusterfs/glusterd.vol:option rpc-auth-allow-insecure on
Restart the
glusterdservice:# service glusterd restart
Procedure 6.3. Configure Block Storage to use a GlusterFS back end
After you configure the GlusterFS service, complete these steps:
Log in as
rootto the system hosting the cinder volume service.Create a text file named
glusterfsin/etc/cinder/.Add an entry to
/etc/cinder/glusterfsfor each GlusterFS share that OpenStack Block Storage should use for back end storage. Each entry should be a separate line, and should use the following format:HOST:/VOL_NAMEWhere:
HOSTis the IP address or host name of the Red Hat Storage server.VOL_NAMEis the name an existing and accessible volume on the GlusterFS server.
Optionally, if your environment requires additional mount options for a share, you can add them to the share's entry:
HOST:/VOL_NAME-oOPTIONSReplace
OPTIONSwith a comma-separated list of mount options.Set
/etc/cinder/glusterfsto be owned by therootuser and thecindergroup.# chown root:cinder /etc/cinder/glusterfs
Set
/etc/cinder/glusterfsto be readable by members of thecindergroup:# chmod 0640
FILEConfigure OpenStack Block Storage to use the
/etc/cinder/glusterfsfile created earlier. To do so, open the/etc/cinder/cinder.confconfiguration file and set theglusterfs_shares_configconfiguration key to/etc/cinder/glusterfs.On distributions that include openstack-config, you can configure this by running the following command instead:
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT glusterfs_shares_config /etc/cinder/glusterfs
The following distributions include openstack-config:
CentOS
Fedora
openSUSE
Red Hat Enterprise Linux
SUSE Linux Enterprise
Configure OpenStack Block Storage to use the correct volume driver, namely
cinder.volume.drivers.glusterfs. To do so, open the/etc/cinder/cinder.confconfiguration file and set thevolume_driverconfiguration key tocinder.volume.drivers.glusterfs.On distributions that include openstack-config, you can configure this by running the following command instead:
# openstack-config --set /etc/cinder/cinder.conf \ DEFAULT volume_driver cinder.volume.drivers.glusterfs.GlusterfsDriver
You can now restart the service to apply the configuration.
To restart the
cindervolume service on CentOS, Fedora, openSUSE, RedHat Enterprise Linux, or SUSE Linux Enterprise, run:# service openstack-cinder-volume restart
To restart the
cindervolume service on Ubuntu or Debian, run:# service cinder-volume restart
OpenStack Block Storage is now configured to use a GlusterFS back end.
![]() | Note |
|---|---|
In
Setting
However, should you choose to set
On distributions that include openstack-config, you can configure this by running the following command instead: # openstack-config --set /etc/cinder/cinder.conf \ DEFAULT glusterfs_sparsed_volumes false |
![]() | Important |
|---|---|
If a client host has SELinux enabled, the
# setsebool -P virt_use_fusefs on This command also makes the Boolean persistent across reboots. Run this command on all client hosts that require access to GlusterFS volumes on an instance. This includes all compute nodes. |

![[Important]](../common/images/admon/important.png)
