Consider GlanceMultistoreConfig when setting glance_pool

With glance supporting multiple stores we need to update glance_pool
so that it explores the content of GlanceMultistoreConfig to see if
any of the configured backends are of rbd type.

We also add a the CephClusterName parameter into the CI rbd_store
multistore for Glance, which is a mandatory parameter to correctly
set the permissions on the keyring files of every Ceph cluster.

Co-Authored-By: Yatin Karel <ykarel@redhat.com>
Change-Id: Iee670befb2bcbaa2b666c6b99f5153391b62049e
This commit is contained in:
Giulio Fidente 2021-08-18 15:58:13 +02:00 committed by Francesco Pantano
parent e332fbf503
commit 151ca15e81
2 changed files with 34 additions and 3 deletions

View File

@ -132,6 +132,7 @@ parameter_defaults:
GlanceBackend: rbd
GlanceStoreDescription: 'RBD glance store'
CephClientUserName: 'glance'
CephClusterName: ceph
GnocchiBackend: rbd
CinderEnableIscsiBackend: false
BannerText: |

View File

@ -102,6 +102,35 @@ parameters:
CinderBackupRbdPoolName:
default: backups
type: string
GlanceMultistoreConfig:
type: json
default: {}
description: |
Dictionary of settings when configuring additional glance backends. The
hash key is the backend ID, and the value is a dictionary of parameter
values unique to that backend. Multiple rbd and cinder backends are allowed, but
file and swift backends are limited to one each. Example:
# Default glance store is rbd.
GlanceBackend: rbd
GlanceStoreDescription: 'Default rbd store'
# GlanceMultistoreConfig specifies a second rbd backend, plus a cinder
# backend.
GlanceMultistoreConfig:
rbd2_store:
GlanceBackend: rbd
GlanceStoreDescription: 'Second rbd store'
CephClusterName: ceph2
# Override CephClientUserName if this cluster uses a different
# client name.
CephClientUserName: client2
cinder1_store:
GlanceBackend: cinder
GlanceCinderVolumeType: 'volume-type-1'
GlanceStoreDescription: 'First cinder store'
cinder2_store:
GlanceBackend: cinder
GlanceCinderVolumeType: 'volume-type-2'
GlanceStoreDescription: 'Seconde cinder store'
GlanceRbdPoolName:
default: images
type: string
@ -540,12 +569,13 @@ outputs:
glance_pool:
name: {get_param: GlanceRbdPoolName}
enabled:
if:
or:
- yaql:
data: {get_param: GlanceMultistoreConfig}
expression: $.data.values().where($ != null).GlanceBackend.contains("rbd")
- equals:
- {get_param: GlanceBackend}
- 'rbd'
- true
- false
cinder_pool:
name: {get_param: CinderRbdPoolName}
enabled: {get_param: CinderEnableRbdBackend}