1.8.5. 转换块存储服务配置


在之前的部署中,您将对所有服务使用相同的 cinder.conf 文件。要准备块存储服务(cinder)配置以采用,请将此单文件配置分成各个块存储服务的单个配置。参阅以下信息来指导您完成之前的配置:

  • 确定所有块存储服务的配置是通用的,并删除在 Red Hat OpenShift Container Platform (RHOCP)中部署时可能会更改的任何部分,如 [database] 部分中的 连接,即 [DEFAULT] 部分中的 transport_urllog_dir,整个 [coordination][barbican] 部分。剩余的通用配置进入 customServiceConfig 选项或 Secret 自定义资源(CR),然后在 cinder: template: level 的 customServiceConfigSecrets 部分中使用。
  • 确定是否有特定于调度程序的配置,并将其添加到 cinder: template: cinderScheduler 中的 customServiceConfig 选项中。
  • 确定是否有特定于 API 的配置,并将其添加到 cinder: template: cinderAPI 中的 customServiceConfig 选项中。
  • 如果部署了块存储服务备份,请将块存储服务备份配置选项添加到 customServiceConfig 选项,或添加到 cinder: template: cinderBackup: level 的 customServiceConfigSecrets 部分的 Secret CR 中。删除 [DEFAULT] 部分中的主机配置,以便稍后支持多个副本。
  • 确定每个驱动程序的单个卷后端配置。配置位于特定的驱动程序部分,它使用 [backend_defaults] 部分和 FC zoning 部分(如果使用它们)。Block Storage Service operator 不支持所有卷服务的全局 customServiceConfig 选项。每个后端在 cinder: template: cinderVolumes 下都有自己的部分,并且配置位于 customServiceConfig 选项或 Secret CR 中,然后在 customServiceConfigSecrets 部分中使用。
  • 如果任何块存储服务卷驱动程序需要自定义厂商镜像,请在 红帽生态系统目录 中找到镜像的位置,并使用 cinderVolumes 部分中的键创建或修改 OpenStackVersion CR 来指定自定义镜像。

    例如,如果您有以下配置:

    spec:
      cinder:
        enabled: true
        template:
          cinderVolume:
            pure:
              customServiceConfigSecrets:
                - openstack-cinder-pure-cfg
    < . . . >

    然后,描述该后端容器镜像的 OpenStackVersion CR 类似以下示例:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackVersion
    metadata:
      name: openstack
    spec:
      customContainerImages:
        cinderVolumeImages:
          pure: registry.connect.redhat.com/purestorage/openstack-cinder-volume-pure-rhosp-18-0'
    注意

    OpenStackVersion 的名称必须与 OpenStackControlPlane CR 的名称匹配。

  • 如果您的块存储服务使用外部文件(例如,对于自定义策略),或者存储凭证或 SSL 证书颁发机构捆绑包以连接到存储阵列,请将这些文件提供给正确的容器。使用 SecretsConfigMap 将信息存储在 RHOCP 中,然后存储在 extraMounts 键中。例如,对于存储在名为 ceph-conf-filesSecret 中的 Red Hat Ceph Storage 凭证,您可以在 OpenstackControlPlane CR 中修补顶级 extraMounts 密钥:

    spec:
      extraMounts:
      - extraVol:
        - extraVolType: Ceph
          mounts:
          - mountPath: /etc/ceph
            name: ceph
            readOnly: true
          propagation:
          - CinderVolume
          - CinderBackup
          - Glance
          volumes:
          - name: ceph
            projected:
              sources:
              - secret:
                  name: ceph-conf-files
  • 对于特定于服务的文件,如 API 策略,您可以在服务本身中添加配置。在以下示例中,您将包含 CinderAPI 配置来引用您要从名为 my-cinder-confConfigMap 添加 的策略,其具有策略 键,其内容如下:

    spec:
      cinder:
        enabled: true
        template:
          cinderAPI:
            customServiceConfig: |
               [oslo_policy]
               policy_file=/etc/cinder/api/policy.yaml
          extraMounts:
          - extraVol:
            - extraVolType: Ceph
              mounts:
              - mountPath: /etc/cinder/api
                name: policy
                readOnly: true
              propagation:
              - CinderAPI
              volumes:
              - name: policy
                projected:
                  sources:
                  - configMap:
                      name: my-cinder-conf
                      items:
                        - key: policy
                          path: policy.yaml
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部