From 91a84be6f1a44b82cf2d8723fc48a12c8419f2be Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Tue, 23 Mar 2021 08:09:18 -0700 Subject: [PATCH] Add support for cinder-backup GCS and S3 backends The CinderBackupBackend parameter now supports 'gcs' and 's3' values, and new parameters for configuring the associated backup backends. The template now generates hiera config_settings for only the selected backup backend, rather than generating hiera data for all backup backends regardless of which one is selected. Depends-On: I06857dd2fb64071ea734a0d3ef68ada5e5d2c077 Change-Id: I08293c7a15187b8c60f56bbc0d2d64ccf6e38227 --- deployment/ceph-ansible/ceph-base.yaml | 2 +- deployment/cephadm/ceph-base.yaml | 2 +- .../cinder-backup-container-puppet.yaml | 87 ++++++++++++++++--- .../cinder-backup-pacemaker-puppet.yaml | 2 +- ...ckup-gcs-s3-backends-7dc04376150164fc.yaml | 5 ++ 5 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 releasenotes/notes/cinder-backup-gcs-s3-backends-7dc04376150164fc.yaml diff --git a/deployment/ceph-ansible/ceph-base.yaml b/deployment/ceph-ansible/ceph-base.yaml index b6cf95194e..fadf5dcad0 100644 --- a/deployment/ceph-ansible/ceph-base.yaml +++ b/deployment/ceph-ansible/ceph-base.yaml @@ -323,7 +323,7 @@ parameters: description: The short name of the Cinder Backup backend to use. type: string constraints: - - allowed_values: ['swift', 'ceph', 'nfs'] + - allowed_values: ['swift', 'ceph', 'nfs', 'gcs', 's3'] GnocchiBackend: default: swift description: The short name of the Gnocchi backend to use. Should be one diff --git a/deployment/cephadm/ceph-base.yaml b/deployment/cephadm/ceph-base.yaml index 11fd5178a8..80296a97c9 100644 --- a/deployment/cephadm/ceph-base.yaml +++ b/deployment/cephadm/ceph-base.yaml @@ -286,7 +286,7 @@ parameters: description: The short name of the Cinder Backup backend to use. type: string constraints: - - allowed_values: ['swift', 'ceph', 'nfs'] + - allowed_values: ['swift', 'ceph', 'nfs', 'gcs', 's3'] GnocchiBackend: default: swift description: The short name of the Gnocchi backend to use. Should be one diff --git a/deployment/cinder/cinder-backup-container-puppet.yaml b/deployment/cinder/cinder-backup-container-puppet.yaml index 7b0813f6ab..6b17c84605 100644 --- a/deployment/cinder/cinder-backup-container-puppet.yaml +++ b/deployment/cinder/cinder-backup-container-puppet.yaml @@ -55,7 +55,7 @@ parameters: description: The short name of the Cinder Backup backend to use. type: string constraints: - - allowed_values: ['swift', 'ceph', 'nfs'] + - allowed_values: ['swift', 'ceph', 'nfs', 'gcs', 's3'] CinderBackupRbdPoolName: default: backups type: string @@ -68,6 +68,39 @@ parameters: description: Mount options passed to the NFS client. See NFS man page for details. type: string + CinderBackupGcsCredentials: + default: {} + description: The GCS service account credentials, in JSON format. + type: json + CinderBackupGcsProjectId: + default: '' + description: The GCS project ID. + type: string + CinderBackupGcsBucket: + default: volumebackups + description: The GCS bucket where backups are to be stored. + type: string + CinderBackupGcsBucketLocation: + default: '' + description: If set, it specifies the location where the GCS bucket + should be created. + type: string + CinderBackupS3EndpointUrl: + default: '' + description: The URL where the S3 server is listening. + type: string + CinderBackupS3AccessKey: + default: '' + description: The S3 query token access key. + type: string + CinderBackupS3SecretKey: + default: '' + description: The S3 query token secret key. + type: string + CinderBackupS3Bucket: + default: volumebackups + description: The S3 bucket where backups are to be stored. + type: string MonitoringSubscriptionCinderBackup: default: 'overcloud-cinder-backup' type: string @@ -101,18 +134,46 @@ outputs: config_settings: map_merge: - get_attr: [CinderBase, role_data, config_settings] - - cinder::backup::ceph::backup_ceph_user: {get_param: CephClientUserName} - cinder::backup::ceph::backup_ceph_pool: {get_param: CinderBackupRbdPoolName} - cinder::backup::ceph::backup_ceph_conf: - list_join: - - '' - - - '/etc/ceph/' - - {get_param: CephClusterName} - - '.conf' - cinder::backup::swift::backup_swift_container: volumebackups - cinder::backup::swift::swift_catalog_info: 'object-store:swift:internalURL' - cinder::backup::nfs::backup_share: {get_param: CinderBackupNfsShare} - cinder::backup::nfs::backup_mount_options: {get_param: CinderBackupNfsMountOptions} + - + if: + - {equals: [{get_param: CinderBackupBackend}, 'ceph']} + - cinder::backup::ceph::backup_ceph_user: {get_param: CephClientUserName} + cinder::backup::ceph::backup_ceph_pool: {get_param: CinderBackupRbdPoolName} + cinder::backup::ceph::backup_ceph_conf: + list_join: + - '' + - - '/etc/ceph/' + - {get_param: CephClusterName} + - '.conf' + - {} + - + if: + - {equals: [{get_param: CinderBackupBackend}, 'swift']} + - cinder::backup::swift::backup_swift_container: volumebackups + cinder::backup::swift::swift_catalog_info: 'object-store:swift:internalURL' + - {} + - + if: + - {equals: [{get_param: CinderBackupBackend}, 'nfs']} + - cinder::backup::nfs::backup_share: {get_param: CinderBackupNfsShare} + cinder::backup::nfs::backup_mount_options: {get_param: CinderBackupNfsMountOptions} + - {} + - + if: + - {equals: [{get_param: CinderBackupBackend}, 'gcs']} + - tripleo::profile::base::cinder::backup::gcs::credentials: {get_param: CinderBackupGcsCredentials} + cinder::backup::google::backup_gcs_project_id: {get_param: CinderBackupGcsProjectId} + cinder::backup::google::backup_gcs_bucket: {get_param: CinderBackupGcsBucket} + cinder::backup::google::backup_gcs_bucket_location: {get_param: CinderBackupGcsBucketLocation} + - {} + - + if: + - {equals: [{get_param: CinderBackupBackend}, 's3']} + - cinder::backup::s3::backup_s3_endpoint_url: {get_param: CinderBackupS3EndpointUrl} + cinder::backup::s3::backup_s3_store_access_key: {get_param: CinderBackupS3AccessKey} + cinder::backup::s3::backup_s3_store_secret_key: {get_param: CinderBackupS3SecretKey} + cinder::backup::s3::backup_s3_store_bucket: {get_param: CinderBackupS3Bucket} + - {} service_config_settings: rsyslog: tripleo_logging_sources_cinder_backup: diff --git a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml index ddb39039ae..2f646e369b 100644 --- a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml @@ -29,7 +29,7 @@ parameters: description: The short name of the Cinder Backup backend to use. type: string constraints: - - allowed_values: ['swift', 'ceph', 'nfs'] + - allowed_values: ['swift', 'ceph', 'nfs', 'gcs', 's3'] CinderBackupRbdPoolName: default: backups type: string diff --git a/releasenotes/notes/cinder-backup-gcs-s3-backends-7dc04376150164fc.yaml b/releasenotes/notes/cinder-backup-gcs-s3-backends-7dc04376150164fc.yaml new file mode 100644 index 0000000000..fd2f9bb750 --- /dev/null +++ b/releasenotes/notes/cinder-backup-gcs-s3-backends-7dc04376150164fc.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds support for configuring the cinder-backup service with a Google + Cloud Storage (GCS) backend, or an Amazon S3 backend.