6.5.2. 使用块存储服务后端部署的镜像服务


重要

本节中的内容 作为技术预览提供,因此不受红帽完全支持。它只应用于测试,不应部署在生产环境中。如需更多信息,请参阅 技术预览

采用您在 Red Hat OpenStack Platform (RHOSP)环境中使用块存储服务(cinder)后端部署的 Image Service (glance)。control plane glanceAPI 实例使用以下配置进行部署。您可以在使用块存储后端部署镜像服务的补丁清单中使用此配置:

..
spec
  glance:
   ...
      customServiceConfig: |
          [DEFAULT]
          enabled_backends = default_backend:cinder
          [glance_store]
          default_backend = default_backend
          [default_backend]
          description = Default cinder backend
          cinder_store_auth_address = {{ .KeystoneInternalURL }}
          cinder_store_user_name = {{ .ServiceUser }}
          cinder_store_password = {{ .ServicePassword }}
          cinder_store_project_name = service
          cinder_catalog_info = volumev3::internalURL
          cinder_use_multipath = true
          [oslo_concurrency]
          lock_path = /var/lib/glance/tmp

先决条件

  • 您已完成了以前的采用步骤。

流程

  1. 创建一个新文件,如 glance_cinder.patch,并包含以下内容:

    spec:
      glance:
        enabled: true
        apiOverride:
          route: {}
        template:
          secret: osp-secret
          databaseInstance: openstack
          storage:
            storageRequest: 10G
          customServiceConfig: |
            [DEFAULT]
            enabled_backends = default_backend:cinder
            [glance_store]
            default_backend = default_backend
            [default_backend]
            description = Default cinder backend
            cinder_store_auth_address = {{ .KeystoneInternalURL }}
            cinder_store_user_name = {{ .ServiceUser }}
            cinder_store_password = {{ .ServicePassword }}
            cinder_store_project_name = service
            cinder_catalog_info = volumev3::internalURL
            cinder_use_multipath = true
            [oslo_concurrency]
            lock_path = /var/lib/glance/tmp
          glanceAPIs:
            default:
              replicas: 1
              override:
                service:
                  internal:
                    metadata:
                      annotations:
                        metallb.universe.tf/address-pool: internalapi
                        metallb.universe.tf/allow-shared-ip: internalapi
                        metallb.universe.tf/loadBalancerIPs: 172.17.0.80 
    1
    
                    spec:
                      type: LoadBalancer
              networkAttachments:
                - storage
    1
    如果使用 IPv6,请将负载均衡器 IP 更改为环境中的负载均衡器 IP,如 metallb.universe.tf/loadBalancerIPs: fd00:bbbb::80
    注意

    块存储服务作为后端与镜像服务建立依赖项。如果镜像服务配置了 OpenStackControlPlane 自定义资源中不可用的块存储服务,则任何部署的 GlanceAPI 实例都无法正常工作。在块存储服务以及特定的 CinderVolume 应用之后,您可以继续采用 GlanceAPI。如需更多信息,请参阅 使用块存储服务

  2. 验证 CinderVolume 是否可用:

    $ oc get pod -l component=cinder-volume | grep Running
    cinder-volume-75cb47f65-92rxq   3/3     Running   0
  3. 对 control plane 中部署的 GlanceAPI 服务进行补丁:

    $ oc patch openstackcontrolplane openstack --type=merge --patch-file=glance_cinder.patch
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部