From 54297542224c9e76596070e0f3dc8e8dd1425084 Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Fri, 22 Sep 2017 11:59:22 -0400 Subject: [PATCH] Add support for multiple Cinder RBD backends Add new CinderRbdExtraPools Heat parameter, which specifies a list of Ceph pools for use with RBD backends for Cinder. An extra Cinder RBD backend driver is created for each pool in the list. This is in addition to the standard RBD backend driver associated with the CinderRbdPoolName. The new parameter is optional, and defaults to an empty list. Adding this feature requires changes in two areas: o The extra Cinder RBD backends get created via a new Puppet parameter o The Ceph client key that permits access to specific Ceph pools is updated to allow client access to the extra RBD pools Implements: blueprint multiple-cinder-rbd-backend Depends-On: I3318b9eaef607d6992f9a8cb605817b6f76dd331 Change-Id: If410ed43b2cc70094a3274c1488833fcaae56cca --- docker/services/ceph-ansible/ceph-base.yaml | 40 +++++++++++++------ puppet/services/ceph-base.yaml | 25 +++++++++--- puppet/services/ceph-mon.yaml | 25 ++++++++---- puppet/services/cinder-volume.yaml | 9 +++++ ...e-cinder-rbd-backend-9b015f99887e9241.yaml | 9 +++++ 5 files changed, 83 insertions(+), 25 deletions(-) create mode 100644 releasenotes/notes/multiple-cinder-rbd-backend-9b015f99887e9241.yaml diff --git a/docker/services/ceph-ansible/ceph-base.yaml b/docker/services/ceph-ansible/ceph-base.yaml index 4674ec14fd..3ef4754bbe 100644 --- a/docker/services/ceph-ansible/ceph-base.yaml +++ b/docker/services/ceph-ansible/ceph-base.yaml @@ -79,6 +79,14 @@ parameters: CinderRbdPoolName: default: volumes type: string + CinderRbdExtraPools: + default: [] + description: > + List of extra Ceph pools for use with RBD backends for Cinder. An + extra Cinder RBD backend driver is created for each pool in the + list. This is in addition to the standard RBD backend driver + associated with the CinderRbdPoolName. + type: comma_delimited_list CinderBackupRbdPoolName: default: backups type: string @@ -214,11 +222,14 @@ outputs: rule_name: "" for_each: <%pool%>: - - {get_param: CinderRbdPoolName} - - {get_param: CinderBackupRbdPoolName} - - {get_param: NovaRbdPoolName} - - {get_param: GlanceRbdPoolName} - - {get_param: GnocchiRbdPoolName} + list_concat: + - - {get_param: CinderRbdPoolName} + - {get_param: CinderBackupRbdPoolName} + - {get_param: NovaRbdPoolName} + - {get_param: GlanceRbdPoolName} + - {get_param: GnocchiRbdPoolName} + # CinderRbdExtraPools is a list (do not indent further) + - {get_param: CinderRbdExtraPools} - {get_param: CephPools} openstack_keys: &openstack_keys - name: @@ -230,13 +241,18 @@ outputs: mon_cap: "allow r" osd_cap: str_replace: - template: "allow class-read object_prefix rbd_children, allow rwx pool=CINDER_POOL, allow rwx pool=CINDERBACKUP_POOL, allow rwx pool=NOVA_POOL, allow rwx pool=GLANCE_POOL, allow rwx pool=GNOCCHI_POOL" - params: - NOVA_POOL: {get_param: NovaRbdPoolName} - CINDER_POOL: {get_param: CinderRbdPoolName} - CINDERBACKUP_POOL: {get_param: CinderBackupRbdPoolName} - GLANCE_POOL: {get_param: GlanceRbdPoolName} - GNOCCHI_POOL: {get_param: GnocchiRbdPoolName} + template: 'allow class-read object_prefix rbd_children, allow rwx pool=CEPH_CLIENT_POOLS' + params: + CEPH_CLIENT_POOLS: + list_join: + - ', allow rwx pool=' + - - {get_param: CinderRbdPoolName} + - {get_param: CinderBackupRbdPoolName} + - {get_param: NovaRbdPoolName} + - {get_param: GlanceRbdPoolName} + - {get_param: GnocchiRbdPoolName} + # CinderRbdExtraPools is a list (do not indent further) + - {get_param: CinderRbdExtraPools} mode: "0644" - name: list_join: diff --git a/puppet/services/ceph-base.yaml b/puppet/services/ceph-base.yaml index 8debf8c74b..e120dce3a9 100644 --- a/puppet/services/ceph-base.yaml +++ b/puppet/services/ceph-base.yaml @@ -23,6 +23,14 @@ parameters: CinderRbdPoolName: default: volumes type: string + CinderRbdExtraPools: + default: [] + description: > + List of extra Ceph pools for use with RBD backends for Cinder. An + extra Cinder RBD backend driver is created for each pool in the + list. This is in addition to the standard RBD backend driver + associated with the CinderRbdPoolName. + type: comma_delimited_list CinderBackupRbdPoolName: default: backups type: string @@ -133,13 +141,18 @@ outputs: cap_mon: 'allow r' cap_osd: str_replace: - template: 'allow class-read object_prefix rbd_children, allow rwx pool=CINDER_POOL, allow rwx pool=CINDERBACKUP_POOL, allow rwx pool=NOVA_POOL, allow rwx pool=GLANCE_POOL, allow rwx pool=GNOCCHI_POOL' + template: 'allow class-read object_prefix rbd_children, allow rwx pool=CEPH_CLIENT_POOLS' params: - NOVA_POOL: {get_param: NovaRbdPoolName} - CINDER_POOL: {get_param: CinderRbdPoolName} - CINDERBACKUP_POOL: {get_param: CinderBackupRbdPoolName} - GLANCE_POOL: {get_param: GlanceRbdPoolName} - GNOCCHI_POOL: {get_param: GnocchiRbdPoolName} + CEPH_CLIENT_POOLS: + list_join: + - ', allow rwx pool=' + - - {get_param: CinderRbdPoolName} + - {get_param: CinderBackupRbdPoolName} + - {get_param: NovaRbdPoolName} + - {get_param: GlanceRbdPoolName} + - {get_param: GnocchiRbdPoolName} + # CinderRbdExtraPools is a list (do not indent further) + - {get_param: CinderRbdExtraPools} MANILA_CLIENT_KEY: mode: '0644' secret: {get_param: CephManilaClientKey} diff --git a/puppet/services/ceph-mon.yaml b/puppet/services/ceph-mon.yaml index 5783d18c50..5800c558cc 100644 --- a/puppet/services/ceph-mon.yaml +++ b/puppet/services/ceph-mon.yaml @@ -40,6 +40,14 @@ parameters: CinderRbdPoolName: default: volumes type: string + CinderRbdExtraPools: + default: [] + description: > + List of extra Ceph pools for use with RBD backends for Cinder. An + extra Cinder RBD backend driver is created for each pool in the + list. This is in addition to the standard RBD backend driver + associated with the CinderRbdPoolName. + type: comma_delimited_list ManilaCephFSDataPoolName: default: manila_data type: string @@ -119,13 +127,16 @@ outputs: repeat: for_each: <%pool%>: - - {get_param: CinderRbdPoolName} - - {get_param: ManilaCephFSDataPoolName} - - {get_param: ManilaCephFSMetadataPoolName} - - {get_param: CinderBackupRbdPoolName} - - {get_param: NovaRbdPoolName} - - {get_param: GlanceRbdPoolName} - - {get_param: GnocchiRbdPoolName} + list_concat: + - - {get_param: CinderRbdPoolName} + - {get_param: ManilaCephFSDataPoolName} + - {get_param: ManilaCephFSMetadataPoolName} + - {get_param: CinderBackupRbdPoolName} + - {get_param: NovaRbdPoolName} + - {get_param: GlanceRbdPoolName} + - {get_param: GnocchiRbdPoolName} + # CinderRbdExtraPools is a list (do not indent further) + - {get_param: CinderRbdExtraPools} template: <%pool%>: pg_num: "%{hiera('ceph::profile::params::osd_pool_default_pg_num')}" diff --git a/puppet/services/cinder-volume.yaml b/puppet/services/cinder-volume.yaml index d95370d7da..1567a75a0e 100644 --- a/puppet/services/cinder-volume.yaml +++ b/puppet/services/cinder-volume.yaml @@ -57,6 +57,14 @@ parameters: CinderRbdPoolName: default: volumes type: string + CinderRbdExtraPools: + default: [] + description: > + List of extra Ceph pools for use with RBD backends for Cinder. An + extra Cinder RBD backend driver is created for each pool in the + list. This is in addition to the standard RBD backend driver + associated with the CinderRbdPoolName. + type: comma_delimited_list CephClientUserName: default: openstack type: string @@ -130,6 +138,7 @@ outputs: tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_helper: {get_param: CinderISCSIHelper} tripleo::profile::base::cinder::volume::iscsi::cinder_iscsi_protocol: {get_param: CinderISCSIProtocol} tripleo::profile::base::cinder::volume::rbd::cinder_rbd_pool_name: {get_param: CinderRbdPoolName} + tripleo::profile::base::cinder::volume::rbd::cinder_rbd_extra_pools: {get_param: CinderRbdExtraPools} tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name: {get_param: CephClientUserName} tripleo.cinder_volume.firewall_rules: '120 iscsi initiator': diff --git a/releasenotes/notes/multiple-cinder-rbd-backend-9b015f99887e9241.yaml b/releasenotes/notes/multiple-cinder-rbd-backend-9b015f99887e9241.yaml new file mode 100644 index 0000000000..a281674338 --- /dev/null +++ b/releasenotes/notes/multiple-cinder-rbd-backend-9b015f99887e9241.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Add new CinderRbdExtraPools Heat parameter, which specifies a list of + Ceph pools for use with RBD backends for Cinder. An extra Cinder RBD + backend driver is created for each pool in the list. This is in addition + to the standard RBD backend driver associated with the CinderRbdPoolName. + The new parameter is optional, and defaults to an empty list. All of the + pools are associated with a single Ceph cluster.