Merge "Add support for glance multistore"

This commit is contained in:
Zuul 2020-02-27 05:18:25 +00:00 committed by Gerrit Code Review
commit b5ef03c9c9
3 changed files with 103 additions and 18 deletions

View File

@ -127,7 +127,13 @@ parameter_defaults:
NovaEnableRbdBackend: true
CinderEnableRbdBackend: true
CinderBackupBackend: ceph
GlanceBackend: rbd
GlanceBackend: cinder
GlanceStoreDescription: 'Cinder glance store'
GlanceMultistoreConfig:
rbd_store:
GlanceBackend: rbd
GlanceStoreDescription: 'RBD glance store'
CephClientUserName: 'glance'
GnocchiBackend: rbd
CinderEnableIscsiBackend: false
GnocchiArchivePolicy: 'ceilometer-high-rate'

View File

@ -211,6 +211,40 @@ parameters:
type: string
constraints:
- allowed_values: ['swift', 'file', 'rbd', 'cinder']
GlanceBackendID:
type: string
default: 'default_backend'
description: The default backend's identifier.
constraints:
- allowed_pattern: "[a-zA-Z0-9_-]+"
GlanceStoreDescription:
type: string
default: 'Default glance store backend.'
description: User facing description for the Glance backend.
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 backends are allowed, but
cinder, 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
cinder_store:
GlanceBackend: cinder
GlanceStoreDescription: 'Cinder store'
CephClientUserName:
default: openstack
type: string
@ -241,17 +275,35 @@ parameters:
conditions:
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
cinder_backend_enabled: {equals: [{get_param: GlanceBackend}, cinder]}
cinder_backend_enabled:
or:
- equals:
- get_param: GlanceBackend
- cinder
- equals:
- yaql:
expression: $.data.values().any($.get("GlanceBackend", "") = "cinder")
data: {get_param: GlanceMultistoreConfig}
- true
cinder_multipathd_enabled:
and:
- cinder_backend_enabled
- equals:
- get_param: MultipathdEnable
- true
rbd_backend_enabled: {equals: [{get_param: GlanceBackend}, rbd]}
rbd_backend_enabled:
or:
- equals:
- get_param: GlanceBackend
- rbd
- equals:
- yaql:
expression: $.data.values().any($.get("GlanceBackend", "") = "rbd")
data: {get_param: GlanceMultistoreConfig}
- true
enable_image_conversion:
and:
- equals: [{get_param: GlanceBackend}, rbd]
- rbd_backend_enabled
- equals: [{get_param: NovaEnableRbdBackend}, true]
use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]}
glance_workers_unset: {equals : [{get_param: GlanceWorkers}, '']}
@ -264,9 +316,7 @@ conditions:
- glance_netapp_nfs_enabled
- and:
# Keep this for compat, but ignore NovaEnableRbdBackend if it's a role param
- equals:
- get_param: GlanceBackend
- rbd
- rbd_backend_enabled
- equals:
- get_param: NovaEnableRbdBackend
- true
@ -425,6 +475,9 @@ outputs:
glance::backend::rbd::rbd_store_pool: {get_param: GlanceRbdPoolName}
glance::backend::rbd::rbd_store_user: {get_param: CephClientUserName}
glance_backend: {get_param: GlanceBackend}
tripleo::profile::base::glance::api::glance_backend_id: {get_param: GlanceBackendID}
tripleo::profile::base::glance::api::glance_store_description: {get_param: GlanceStoreDescription}
tripleo::profile::base::glance::api::multistore_config: {get_param: GlanceMultistoreConfig}
glance::notify::rabbitmq::notification_driver: {get_param: NotificationDriver}
-
if:
@ -499,17 +552,31 @@ outputs:
merge: true
preserve_properties: true
permissions:
- path: /var/lib/glance
owner: glance:glance
recurse: true
- path:
str_replace:
template: /etc/ceph/CLUSTER.client.USER.keyring
params:
CLUSTER: {get_param: CephClusterName}
USER: {get_param: CephClientUserName}
owner: glance:glance
perm: '0600'
list_concat:
-
- path: /var/lib/glance
owner: glance:glance
recurse: true
- path:
str_replace:
template: /etc/ceph/CLUSTER.client.USER.keyring
params:
CLUSTER: {get_param: CephClusterName}
USER: {get_param: CephClientUserName}
owner: glance:glance
perm: '0600'
- repeat:
template:
path: /etc/ceph/<%keyring%>
owner: glance:glance
perm: '0600'
for_each:
<%keyring%>:
yaql:
expression: let(u => $.data.user) -> $.data.multistore.values().where($.get("CephClusterName")).select("{0}.client.{1}.keyring".format($.CephClusterName, $.get("CephClientUserName", $u)))
data:
user: {get_param: CephClientUserName}
multistore: {get_param: GlanceMultistoreConfig}
/var/lib/kolla/config_files/glance_api_tls_proxy.json:
command: /usr/sbin/httpd -DFOREGROUND
config_files:

View File

@ -0,0 +1,12 @@
---
features:
- |
Add parameters for configuring multiple glance-api backends. The existing
``GlanceBackend`` parameter represents the default backend, and a new
``GlanceMultistoreConfig`` parameter is a hash representing the
configuration of additional backends. A new ``GlanceStoreDescription``
parameter provides a means of describing each backend.
The configuration can specify any combination of supported backend types.
Multiple rbd backends can be specified, but cinder, file and swift
backends are limited to one each.