Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 4. Configuring the Block Storage service (cinder)
You can configure the following back ends for the Block Storage service (cinder):
- Ceph RBD.
- iSCSI, FC, or NVMe-TCP storage protocols. For information about configuring a third-party back end for the Block Storage service, see OSP18 Cinder Alternative Storage.
- NFS.
4.1. Configuring an NFS back end
You can configure the Block Storage service (cinder) with a generic NFS back end to provide an alternative storage solution by completing the following high level tasks:
To ensure network connectivity between the NFS server, the Red Hat OpenShift cluster, and the Compute nodes, complete the following tasks:
- Confirm all Block Storage services are operational.
- Create a test volume from an Image service (glance) image.
- Boot a VM from the test volume or attach a VM to the test volume.
- Create a secret containing NFS server connection information.
-
Configure the
OpenStackControlPlane
custom resource (CR) to use the NFS storage as the back end for the Block Storage service.
When using Red Hat OpenStack in a production environment, use a certified third-party NFS driver. The generic NFS driver is not recommended for a production environment.
4.1.1. Creating the NFS server connection secret
Create a server connection secret to prevent placing server connection information directly in the OpenStackControlPlane
CRD.
Procedure
Create a configuration file that contains NFS server connection information.
The following is an example of the contents of a configuration file:
[nfs] nas_host=192.168.130.1 nas_share_path=/var/nfs/cinder
- Save the configuration file.
Create the secret based on the configuration file:
$ oc create secret generic <secret_name> --from-file=<configuration_file_name>
-
Replace
<secret_name>
with the name you wish to assign to the secret. -
Replace
<configuration_file_name>
with the name of the configuration file you created.
-
Replace
- Delete the configuration file.
4.1.2. Configuring the control plane to use the generic NFS driver
Configure the Block Storage service (cinder) in the OpenStackControlPlane
CR to use NFS storage.
Use a certified third-party NFS driver when using Red Hat OpenStack Services on OpenShift (RHOSO) in a production environment. The generic NFS driver is not recommended for a production environment.
Procedure
-
Edit the
OpenStackControlPlane
CR. Add the
customServiceConfig
parameter to thecinder
template to configure the Block Storage service.The following is an example of using the
customServiceConfig
parameter to configure the Block Storage service:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: openstack spec: cinder: template: cinderVolumes: nfs: replicas: 1 networkAttachments: - storage customServiceConfig: | [nfs] volume_backend_name=nfs volume_driver=cinder.volume.drivers.nfs.NfsDriver nfs_snapshot_support=true nas_secure_file_operations=false nas_secure_file_permissions=false customServiceConfigSecrets: - <nfs_secret_name> 1
- 1
- The name of your secret created in Creating the NFS server connection secret.
Apply the CR changes:
$ oc apply -f <control_plane_file>
-
Replace
<control_plane_file>
with the name of yourOpenStackControlPlane
CR file.
-
Replace
4.2. Configuring automatic database cleanup
The Block Storage (cinder) and Shared File Systems (manila) services automatically purge database entries marked for deletion for a set number of days. By default, records are marked for deletion for 30 days. You can configure a different record age and schedule for purge jobs.
The Image service (glance) also purges database entries automatically but this functionality is not currently user configurable.
Procedure
-
Open your
openstack_control_plane.yaml
file to edit theOpenStackControlPlane
CR. Add the
dbPurge
parameter to thecinder
ormanila
template to configure database cleanup depending on the service you want to configure.The following is an example of using the
dbPurge
parameter to configure the Block Storage service:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: openstack spec: cinder: template: dbPurge: age: 20 1 schedule: 1 0 * * 0 2
Update the control plane:
$ oc apply -f openstack_control_plane.yaml