From 73fc230fe3f1d159b5bb9d62a6e15f93cecb6e7c Mon Sep 17 00:00:00 2001 From: Sergei Raiskii Date: Wed, 13 Jul 2022 17:33:53 +0300 Subject: [PATCH] Allow cinder-backup to be configured to use S3 backend. Added options to configure S3 cinder backup driver, so cinder backup can use S3 storage, for safekeeping backups. Change-Id: Id6ff6206714581555baacecebfb6d8dd53bed8ac --- ansible/group_vars/all.yml | 2 +- ansible/roles/cinder/defaults/main.yml | 8 ++++++++ ansible/roles/cinder/templates/cinder.conf.j2 | 6 ++++++ etc/kolla/globals.yml | 8 +++++++- releasenotes/notes/s3-cinder-backup-180f57b6d0e417f2.yaml | 3 +++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/s3-cinder-backup-180f57b6d0e417f2.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 0f370feab0..4feed4c918 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -940,7 +940,7 @@ cinder_target_helper: "{{ 'lioadm' if ansible_facts.os_family == 'RedHat' else ' # Valid options are [ '', redis, etcd ] cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" -# Valid options are [ nfs, swift, ceph ] +# Valid options are [ nfs, swift, ceph, s3 ] cinder_backup_driver: "ceph" cinder_backup_share: "" cinder_backup_mount_options_nfs: "" diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index fa29ffb46c..ce8e1600ef 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -271,6 +271,14 @@ pure_fc_backend: "pure_fc_backend" pure_api_token: pure_san_ip: +################################ +# Cinder Backup S3 +################################ +cinder_backup_s3_endpoint: "{{ s3_url }}" +cinder_backup_s3_store_bucket: "volumebackups" +cinder_backup_s3_store_access_key: "{{ s3_access_key }}" +cinder_backup_s3_store_secret_key: "{{ s3_secret_key }}" + #################### # Kolla #################### diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 355b53696f..56c425dde2 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -47,6 +47,12 @@ backup_swift_auth = per_user backup_swift_auth_version = 1 backup_swift_user = backup_swift_key = +{% elif cinder_backup_driver == "s3" %} +backup_driver = cinder.backup.drivers.s3.S3BackupDriver +backup_s3_endpoint_url = {{ cinder_backup_s3_endpoint }} +backup_s3_store_bucket = {{ cinder_backup_s3_store_bucket }} +backup_s3_store_access_key = {{ cinder_backup_s3_store_access_key }} +backup_s3_store_secret_key = {{ cinder_backup_s3_store_secret_key }} {% endif %} {% endif %} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index f80dc13c2f..13e7259156 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -518,11 +518,17 @@ workaround_ansible_issue_8743: yes # Valid options are [ '', redis, etcd ] #cinder_coordination_backend: "{{ 'redis' if enable_redis|bool else 'etcd' if enable_etcd|bool else '' }}" -# Valid options are [ nfs, swift, ceph ] +# Valid options are [ nfs, swift, ceph, s3 ] #cinder_backup_driver: "ceph" #cinder_backup_share: "" #cinder_backup_mount_options_nfs: "" +# Cinder backup S3 options +#cinder_backup_s3_endpoint: "{{ s3_url }}" +#cinder_backup_s3_store_bucket: "volumebackups" +#cinder_backup_s3_store_access_key: "{{ s3_access_key }}" +#cinder_backup_s3_store_secret_key: "{{ s3_secret_key }}" + ####################### # Cloudkitty options ####################### diff --git a/releasenotes/notes/s3-cinder-backup-180f57b6d0e417f2.yaml b/releasenotes/notes/s3-cinder-backup-180f57b6d0e417f2.yaml new file mode 100644 index 0000000000..a3353bf9d5 --- /dev/null +++ b/releasenotes/notes/s3-cinder-backup-180f57b6d0e417f2.yaml @@ -0,0 +1,3 @@ +--- +features: + - Allow cinder-backup to be configured to use S3 backend.