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
This commit is contained in:
Matt Thompson 2015-08-05 15:31:46 +01:00 committed by Jesse Pretorius
parent 0cb1da4b06
commit 44d3f25de6
7 changed files with 27 additions and 4 deletions

View File

@ -23,6 +23,9 @@ component_skel:
cinder_volume:
belongs_to:
- cinder_all
cinder_backup:
belongs_to:
- cinder_all
container_skel:
@ -49,6 +52,7 @@ container_skel:
- storage_containers
contains:
- cinder_volume
- cinder_backup
properties:
# When using lvm as a cinder backend its advised to run cinder-volumes on metal.
# If you are using a different backend you may want to remove "is_metal: true".

View File

@ -63,6 +63,7 @@ ceph_mons: []
# Ceph client usernames for glance and cinder+nova
glance_ceph_client: glance
cinder_ceph_client: cinder
cinder_backup_ceph_client: cinder-backup
# by default we assume you use rbd for both cinder and nova, and as libvirt
# needs to access both volumes (cinder) as boot disks (nova) we default to
# reuse the cinder_ceph_client
@ -74,6 +75,7 @@ cephkeys_access_group: cephkeys
openstack_service_system_user: null
ceph_cinder_service_names:
- cinder-volume
- cinder-backup
ceph_nova_service_names:
- nova-compute
ceph_glance_service_names:

View File

@ -26,7 +26,9 @@
with_subelements:
- ceph_components
- client
when: inventory_hostname in groups[item.0.component]
when: >
inventory_hostname in groups[item.0.component] and
(item.0.component != 'cinder_backup' or (cinder_service_backup_program_enabled | bool and cinder_service_backup_driver == 'cinder.backup.drivers.ceph'))
always_run: true
changed_when: false
delegate_to: '{{ ceph_mon_host }}'

View File

@ -31,6 +31,14 @@ ceph_components:
client:
- '{{ cinder_ceph_client }}'
service: '{{ ceph_cinder_service_names }}'
- component: cinder_backup
package:
- ceph # TODO: remove this once http://tracker.ceph.com/issues/11388 is resolved
- ceph-common
- python-ceph
client:
- '{{ cinder_backup_ceph_client }}'
service: '{{ ceph_cinder_service_names }}'
- component: nova_compute
package:
- libvirt-bin

View File

@ -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

View File

@ -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

View File

@ -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 %}