From eabf6f7af63bd2d660ede36846b274422d91366b Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Wed, 5 Aug 2015 15:31:46 +0100 Subject: [PATCH] Allow cinder-backup to use ceph This change updates ceph_client and os_cinder roles to allow cinder-backup to use ceph. We also create a new group called 'cinder_backup' which allows us to only retreive the cinder backup key if cinder-backup is actually in use. To use, you would simply need to set cinder_service_backup_driver to cinder.backup.drivers.ceph in your user_variables.yml file. NOTE: You will need to update your /etc/openstack_deploy/env.d/cinder.yml in order for this change to execute successfully. Change-Id: Ib94effa40208bbc8de0f78c5487316be007adcf1 Closes-Bug: #1481787 Implements: blueprint ceph-block-devices DocImpact --- defaults/main.yml | 4 ++++ tasks/cinder_upstart_init.yml | 2 +- templates/cinder.conf.j2 | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6ece6f96..6dc13625 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -89,6 +89,8 @@ cinder_keystone_auth_plugin: password ## In order to enable the cinder backup you MUST set ``cinder_service_backup_program_enabled`` to "true" cinder_service_backup_program_enabled: false cinder_service_backup_program_name: cinder-backup +# cinder_service_backup_driver: Options include 'cinder.backup.drivers.swift' or +# 'cinder.backup.drivers.ceph' cinder_service_backup_driver: cinder.backup.drivers.swift # cinder_service_backup_swift_auth: Options include 'per_user' or 'single_user', we default to # 'per_user' so that backups are saved to a user's swift account. @@ -106,6 +108,8 @@ cinder_service_backup_swift_container: volumebackups cinder_service_backup_swift_object_size: 52428800 cinder_service_backup_swift_retry_attempts: 3 cinder_service_backup_swift_retry_backoff: 2 +cinder_service_backup_ceph_user: cinder-backup +cinder_service_backup_ceph_pool: backups cinder_service_backup_compression_algorithm: zlib cinder_service_backup_metadata_version: 2 diff --git a/tasks/cinder_upstart_init.yml b/tasks/cinder_upstart_init.yml index 04877112..5c50c86c 100644 --- a/tasks/cinder_upstart_init.yml +++ b/tasks/cinder_upstart_init.yml @@ -57,7 +57,7 @@ system_group: "{{ cinder_system_group_name }}" service_home: "{{ cinder_system_home_folder }}" when: > - inventory_hostname in groups['cinder_volume'] and + inventory_hostname in groups['cinder_backup'] and cinder_service_backup_program_enabled == true tags: - upstart-init diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 0e59d17e..bcef1437 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -23,6 +23,8 @@ enable_v2_api = {{ cinder_enable_v2_api }} {% if cinder_service_backup_program_enabled == true %} ## Cinder Backup backup_driver = {{ cinder_service_backup_driver }} +backup_metadata_version = {{ cinder_service_backup_metadata_version }} +backup_compression_algorithm = {{ cinder_service_backup_compression_algorithm }} {% if cinder_service_backup_driver == 'cinder.backup.drivers.swift' %} backup_swift_auth = {{ cinder_service_backup_swift_auth }} {% if cinder_service_backup_swift_auth == 'single_user' %} @@ -36,9 +38,10 @@ backup_swift_container = {{ cinder_service_backup_swift_container }} backup_swift_object_size = {{ cinder_service_backup_swift_object_size }} backup_swift_retry_attempts = {{ cinder_service_backup_swift_retry_attempts }} backup_swift_retry_backoff = {{ cinder_service_backup_swift_retry_backoff }} +{% elif cinder_service_backup_driver == 'cinder.backup.drivers.ceph' %} +backup_ceph_user = {{ cinder_service_backup_ceph_user }} +backup_ceph_pool = {{ cinder_service_backup_ceph_pool }} {% endif %} -backup_compression_algorithm = {{ cinder_service_backup_compression_algorithm }} -backup_metadata_version = {{ cinder_service_backup_metadata_version }} {% endif %} {% endif %}