Skip to content

Commit

Permalink
Allow cinder-backup to use ceph
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattt416 authored and Jesse Pretorius committed Sep 3, 2015
1 parent 0cb1da4 commit 44d3f25
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
4 changes: 4 additions & 0 deletions etc/openstack_deploy/env.d/cinder.yml
Expand Up @@ -23,6 +23,9 @@ component_skel:
cinder_volume:
belongs_to:
- cinder_all
cinder_backup:
belongs_to:
- cinder_all


container_skel:
Expand All @@ -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".
Expand Down
2 changes: 2 additions & 0 deletions playbooks/roles/ceph_client/defaults/main.yml
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion playbooks/roles/ceph_client/tasks/ceph_auth.yml
Expand Up @@ -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 }}'
Expand Down
8 changes: 8 additions & 0 deletions playbooks/roles/ceph_client/vars/main.yml
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions playbooks/roles/os_cinder/defaults/main.yml
Expand Up @@ -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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/os_cinder/tasks/cinder_upstart_init.yml
Expand Up @@ -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
7 changes: 5 additions & 2 deletions playbooks/roles/os_cinder/templates/cinder.conf.j2
Expand Up @@ -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' %}
Expand All @@ -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 %}

Expand Down

0 comments on commit 44d3f25

Please sign in to comment.