From c6c513a96aa80072025fc626e823febaa76238b4 Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Wed, 14 Apr 2021 12:35:03 -0700 Subject: [PATCH] Support cinder backups to specific ceph cluster New CinderBackupRbdClusterName and CinderBackupRbdClientUserName parameters support configuring the cinder-backup service to store backups on an external ceph cluster defined by CephExternalMultiConfig. The new parameters default to an empty string, in which case the default CephClusterName and CephClientUserName values are used. Change-Id: I0aa4108c029cbb9b8d88a5f87b1ea517bb54059e --- .../cinder-backup-container-puppet.yaml | 33 +++++++++++++++---- ...p-other-ceph-cluster-36852bf2edfd11a7.yaml | 8 +++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/cinder-backup-other-ceph-cluster-36852bf2edfd11a7.yaml diff --git a/deployment/cinder/cinder-backup-container-puppet.yaml b/deployment/cinder/cinder-backup-container-puppet.yaml index 021c3c8898..c3965b8fbf 100644 --- a/deployment/cinder/cinder-backup-container-puppet.yaml +++ b/deployment/cinder/cinder-backup-container-puppet.yaml @@ -56,6 +56,16 @@ parameters: type: string constraints: - allowed_values: ['swift', 'ceph', 'nfs', 'gcs', 's3'] + CinderBackupRbdClusterName: + type: string + default: '' + description: The Ceph cluster where backups are to be stored. If no value + is specified then the CephClusterName value is used. + CinderBackupRbdClientUserName: + default: '' + type: string + description: The Ceph client name used by the backup service. If no value + is specified then the CephClientUserName value is used. CinderBackupRbdPoolName: default: backups type: string @@ -135,14 +145,25 @@ outputs: - get_attr: [CinderBase, role_data, config_settings] - if: - {equals: [{get_param: CinderBackupBackend}, 'ceph']} - - cinder::backup::ceph::backup_ceph_user: {get_param: CephClientUserName} + - cinder::backup::ceph::backup_ceph_user: + str_replace: + template: USERNAME + params: + USERNAME: + if: + - {equals: [{get_param: CinderBackupRbdClientUserName}, '']} + - {get_param: CephClientUserName} + - {get_param: CinderBackupRbdClientUserName} cinder::backup::ceph::backup_ceph_pool: {get_param: CinderBackupRbdPoolName} cinder::backup::ceph::backup_ceph_conf: - list_join: - - '' - - - '/etc/ceph/' - - {get_param: CephClusterName} - - '.conf' + str_replace: + template: /etc/ceph/CLUSTER.conf + params: + CLUSTER: + if: + - {equals: [{get_param: CinderBackupRbdClusterName}, '']} + - {get_param: CephClusterName} + - {get_param: CinderBackupRbdClusterName} - if: - {equals: [{get_param: CinderBackupBackend}, 'swift']} - cinder::backup::swift::backup_swift_container: volumebackups diff --git a/releasenotes/notes/cinder-backup-other-ceph-cluster-36852bf2edfd11a7.yaml b/releasenotes/notes/cinder-backup-other-ceph-cluster-36852bf2edfd11a7.yaml new file mode 100644 index 0000000000..5d9561943c --- /dev/null +++ b/releasenotes/notes/cinder-backup-other-ceph-cluster-36852bf2edfd11a7.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The cinder-backup service can be configured to store backups on external + Ceph clusters defined by the ``CephExternalMultiConfig`` parameter. New + ``CinderBackupRbdClusterName`` and ``CinderBackupRbdClientUserName`` + parameters can be specified, which override the default ``CephClusterName`` + and ``CephClientUserName`` values respectively.