diff options
| author | Sam Yaple <sam@yaple.net> | 2015-10-18 19:46:16 +0000 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-10-22 10:51:44 +0000 |
| commit | 1d60be37706756c9501dcbc96f34859505091fe1 (patch) | |
| tree | 6e84627f1508cba3e161e1b15e8a75310f3eb793 | |
| parent | 6932ca48b8830cc179e7cccf15d68bc58391b900 (diff) | |
| download | kolla-1d60be37706756c9501dcbc96f34859505091fe1.tar.gz kolla-1d60be37706756c9501dcbc96f34859505091fe1.zip | |
Allow ceph pool names to be configurable
Change-Id: Ic408ef7aec7f1c95396a0ccf0209b104908a3f21
Partially-Implements: blueprint ceph-improvements
| -rw-r--r-- | ansible/group_vars/all.yml | 5 | ||||
| -rw-r--r-- | ansible/roles/cinder/tasks/ceph.yml | 8 | ||||
| -rw-r--r-- | ansible/roles/cinder/templates/cinder.conf.j2 | 4 | ||||
| -rw-r--r-- | ansible/roles/glance/tasks/ceph.yml | 4 | ||||
| -rwxr-xr-x | ansible/roles/glance/templates/glance-api.conf.j2 | 2 | ||||
| -rw-r--r-- | ansible/roles/nova/tasks/ceph.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/nova/templates/nova.conf.j2 | 2 |
7 files changed, 17 insertions, 12 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index a44369dd8..3083be964 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -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" diff --git a/ansible/roles/cinder/tasks/ceph.yml b/ansible/roles/cinder/tasks/ceph.yml index a26b99bb2..444d729a9 100644 --- a/ansible/roles/cinder/tasks/ceph.yml +++ b/ansible/roles/cinder/tasks/ceph.yml @@ -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 diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 9fa0d763b..ac021e819 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -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 diff --git a/ansible/roles/glance/tasks/ceph.yml b/ansible/roles/glance/tasks/ceph.yml index f690ecd70..9dd320c8f 100644 --- a/ansible/roles/glance/tasks/ceph.yml +++ b/ansible/roles/glance/tasks/ceph.yml @@ -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 diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index ebb002033..7d47439f8 100755 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -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 diff --git a/ansible/roles/nova/tasks/ceph.yml b/ansible/roles/nova/tasks/ceph.yml index 4f68a469e..626f09cc1 100644 --- a/ansible/roles/nova/tasks/ceph.yml +++ b/ansible/roles/nova/tasks/ceph.yml @@ -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 diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index 043f47ad0..2d57dd4ec 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -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 }} |
