6.4. 为单个镜像服务 API 实例配置多存储
您可以使用多个存储后端配置 Image 服务(glance)。
要为单个镜像服务 API (glanceAPI
)实例配置多个后端,您可以使用键值对设置 enabled_backends
参数。键是存储的标识符,值是存储的类型。以下值有效:
-
file
-
http
-
rbd
-
swift
-
cinder
先决条件
- 您已规划了存储网络,以确保存储后端、控制平面和数据平面上的 Compute 节点连接。如需更多信息,请参阅 规划部署以及在 OpenShift 上部署 Red Hat OpenStack Services 中的为 Red Hat OpenStack Services 准备网络。https://docs.redhat.com/en/documentation/red_hat_openstack_services_on_openshift/18.0/html/planning_your_deployment/index#assembly_assembly_planning-storage-networks_planning
流程
打开
OpenStackControlPlane
CR 文件openstack_control_plane.yaml
,并在glance
模板中添加参数来配置后端。在以下示例中,有两个 Ceph RBD 存储和一个 Object Storage 服务(swift)存储:... spec: glance: template: customServiceConfig: | [DEFAULT] debug=True enabled_backends = ceph-0:rbd,ceph-1:rbd,swift-0:swift ...
指定要用作默认后端的后端。在以下示例中,默认后端为
ceph-1
:... customServiceConfig: | [DEFAULT] debug=True enabled_backends = ceph-0:rbd,ceph-1:rbd,swift-0:swift [glance_store] default_backend = ceph-1 ...
为您要使用的每个后端类型添加配置:
添加第一个 Ceph RBD 存储
ceph-0
的配置:... customServiceConfig: | [DEFAULT] ... [ceph-0] rbd_store_ceph_conf = /etc/ceph/ceph-0.conf store_description = "RBD backend" rbd_store_pool = images rbd_store_user = openstack ...
添加第二个 Ceph RBD 存储
ceph-1
的配置:... customServiceConfig: | [DEFAULT] ... [ceph-0] ... [ceph-1] rbd_store_ceph_conf = /etc/ceph/ceph-1.conf store_description = "RBD backend 1" rbd_store_pool = images rbd_store_user = openstack ...
添加对象存储服务 store,
swift-0
的配置:... customServiceConfig: | [DEFAULT] ... [ceph-0] ... [ceph-1] ... [swift-0] swift_store_create_container_on_put = True swift_store_auth_version = 3 swift_store_auth_address = {{ .KeystoneInternalURL }} swift_store_key = {{ .ServicePassword }} swift_store_user = service:glance swift_store_endpoint_type = internalURL ...
更新 control plane:
$ oc apply -f openstack_control_plane.yaml -n openstack
等待 RHOCP 创建与
OpenStackControlPlane
CR 相关的资源。运行以下命令来检查状态:$ oc get openstackcontrolplane -n openstack
当状态为 "Setup complete" 时,会创建
OpenStackControlPlane
资源。提示将
-w
选项附加到get
命令的末尾,以跟踪部署进度。