Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 4. Configuring the Block Storage service (cinder)

download PDF

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:

  1. To ensure network connectivity between the NFS server, the Red Hat OpenShift cluster, and the Compute nodes, complete the following tasks:

    1. Confirm all Block Storage services are operational.
    2. Create a test volume from an Image service (glance) image.
    3. Boot a VM from the test volume or attach a VM to the test volume.
  2. Create a secret containing NFS server connection information.
  3. Configure the OpenStackControlPlane custom resource (CR) to use the NFS storage as the back end for the Block Storage service.
Note

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

  1. 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
  2. Save the configuration file.
  3. 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.
  4. 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.

Note

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

  1. Edit the OpenStackControlPlane CR.
  2. Add the customServiceConfig parameter to the cinder 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.
  3. Apply the CR changes:

    $ oc apply -f <control_plane_file>
    • Replace <control_plane_file> with the name of your OpenStackControlPlane CR file.

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.

Note

The Image service (glance) also purges database entries automatically but this functionality is not currently user configurable.

Procedure

  1. Open your openstack_control_plane.yaml file to edit the OpenStackControlPlane CR.
  2. Add the dbPurge parameter to the cinder or manila 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
    1
    The number of days a record has been marked for deletion before it is purged. The default value is 30 days. The minimum value is 1 day.
    2
    The schedule of when to run the job in a crontab format. The default value is 1 0 * * *. This default value is equivalent to 00:01 daily.
  3. Update the control plane:

    $ oc apply -f openstack_control_plane.yaml
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.