Allow ceph pool names to be configurable

Change-Id: Ic408ef7aec7f1c95396a0ccf0209b104908a3f21
Partially-Implements: blueprint ceph-improvements
This commit is contained in:
Sam Yaple 2015-10-18 19:46:16 +00:00
parent 6932ca48b8
commit 1d60be3770
7 changed files with 17 additions and 12 deletions

View File

@ -176,3 +176,8 @@ cinder_volume_driver: "{{ 'ceph' if enable_ceph | bool else 'lvm' }}"
# A requirement for using the erasure-coded pools is you must setup a cache tier
# Valid options are [ erasure, replicated ]
ceph_pool_type: "replicated"
ceph_cinder_pool_name: "volumes"
ceph_cinder_backup_pool_name: "backups"
ceph_glance_pool_name: "images"
ceph_nova_pool_name: "vms"

View File

@ -19,7 +19,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Creating ceph pool for cinder
command: docker exec ceph_mon ceph osd pool create volumes 128 {{ ceph_pool_type }}
command: docker exec ceph_mon ceph osd pool create {{ ceph_cinder_pool_name }} 128 {{ ceph_pool_type }}
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False
failed_when: False
@ -27,7 +27,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Creating ceph pool for cinder-backup
command: docker exec ceph_mon ceph osd pool create backups 128 {{ ceph_pool_type }}
command: docker exec ceph_mon ceph osd pool create {{ ceph_cinder_backup_pool_name }} 128 {{ ceph_pool_type }}
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False
failed_when: False
@ -35,7 +35,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Pulling cephx keyring for cinder
command: docker exec ceph_mon ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'
command: docker exec ceph_mon ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ ceph_cinder_pool_name }}, allow rwx pool={{ ceph_nova_pool_name }}, allow rx pool={{ ceph_glance_pool_name }}'
register: cephx_key_cinder
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False
@ -43,7 +43,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Pulling cephx keyring for cinder-backup
command: docker exec ceph_mon ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=backups'
command: docker exec ceph_mon ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ ceph_cinder_backup_pool_name }}'
register: cephx_key_cinder_backup
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False

View File

@ -26,7 +26,7 @@ backup_driver = cinder.backup.drivers.ceph
backup_ceph_conf = /etc/ceph/ceph.conf
backup_ceph_user = cinder-backup
backup_ceph_chunk_size = 134217728
backup_ceph_pool = backups
backup_ceph_pool = {{ ceph_cinder_backup_pool_name }}
backup_ceph_stripe_unit = 0
backup_ceph_stripe_count = 0
restore_discard_excess_bytes = true
@ -71,7 +71,7 @@ volume_backend_name = lvmdriver-1
{% elif cinder_volume_driver == "ceph" %}
[rbd-1]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_pool = {{ ceph_cinder_pool_name }}
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 5

View File

@ -13,7 +13,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Creating ceph pool for glance
command: docker exec ceph_mon ceph osd pool create images 128 {{ ceph_pool_type }}
command: docker exec ceph_mon ceph osd pool create {{ ceph_glance_pool_name }} 128 {{ ceph_pool_type }}
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False
failed_when: False
@ -21,7 +21,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Pulling cephx keyring
command: docker exec ceph_mon ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'
command: docker exec ceph_mon ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ ceph_glance_pool_name }}'
register: cephx_key
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False

View File

@ -37,7 +37,7 @@ flavor = keystone
default_store = rbd
stores = rbd
rbd_store_user = glance
rbd_store_pool = images
rbd_store_pool = {{ ceph_glance_pool_name }}
rbd_store_chunk_size = 8
{% else %}
default_store = file

View File

@ -19,7 +19,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Creating ceph pool for vms
command: docker exec ceph_mon ceph osd pool create vms 128 {{ ceph_pool_type }}
command: docker exec ceph_mon ceph osd pool create {{ ceph_nova_pool_name }} 128 {{ ceph_pool_type }}
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False
failed_when: False
@ -27,7 +27,7 @@
# TODO(SamYaple): Improve failed_when and changed_when tests
- name: Pulling cephx keyring for nova
command: docker exec ceph_mon ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'
command: docker exec ceph_mon ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool={{ ceph_volumes_pool_name }}, allow rwx pool={{ ceph_nova_pool_name }}, allow rx pool={{ ceph_glance_pool_name }}'
register: cephx_key
delegate_to: "{{ groups['ceph-mon'][0] }}"
changed_when: False

View File

@ -121,7 +121,7 @@ password = {{ nova_keystone_password }}
{% if enable_ceph | bool %}
[libvirt]
images_type = rbd
images_rbd_pool = vms
images_rbd_pool = {{ ceph_nova_pool_name }}
images_rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_user = nova
rbd_secret_uuid = {{ rbd_secret_uuid }}