From 5250a00781a214911fec78718ef6dfb91154b0de Mon Sep 17 00:00:00 2001 From: SamYaple Date: Fri, 18 Mar 2016 13:52:32 +0000 Subject: Allow external ceph journals and fix bootstrap This allows us to specify external journals for osds which can greatly improve performance when the external journals are on the solid-state drives. The new lookup and startup methods fix the previous races we had preventing osds from being created properly. This retains the same functionality as before and is completely compatible with the previous method and labels, however this does set new labels for all new bootstrap OSDs. This was due to a limitation in the length of the name of a GPT partition. Closes-Bug: #1558853 DocImpact Partially-Implements: blueprint ceph-improvements Change-Id: I61fd10cb35c67dabc53bd82270f26909ef51fc38 --- ansible/roles/ceph/tasks/bootstrap_osds.yml | 16 ++++++++++++++-- ansible/roles/ceph/tasks/start_osds.yml | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'ansible') diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml index 16599170e..471d173c9 100644 --- a/ansible/roles/ceph/tasks/bootstrap_osds.yml +++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml @@ -2,7 +2,7 @@ - name: Looking up disks to bootstrap for Ceph command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP'" + -a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix'" register: osd_lookup changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS' @@ -14,7 +14,7 @@ - name: Looking up disks to bootstrap for Ceph command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP'" + -a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP' match_mode='prefix'" register: osd_cache_lookup changed_when: "{{ osd_cache_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_cache_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_cache_lookup.stdout.split()[2] != 'SUCCESS' @@ -32,6 +32,12 @@ KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" OSD_DEV: "{{ item.1.device }}" + OSD_PARTITION: "{{ item.1.partition }}" + OSD_PARTITION_NUM: "{{ item.1.partition_num }}" + JOURNAL_DEV: "{{ item.1.journal_device }}" + JOURNAL_PARTITION: "{{ item.1.journal }}" + JOURNAL_PARTITION_NUM: "{{ item.1.journal_num }}" + USE_EXTERNAL_JOURNAL: "{{ item.1.external_journal | bool }}" OSD_FILESYSTEM: "{{ ceph_osd_filesystem }}" OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}" HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}" @@ -56,6 +62,12 @@ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" CEPH_CACHE: OSD_DEV: "{{ item.1.device }}" + OSD_PARTITION: "{{ item.1.partition }}" + OSD_PARTITION_NUM: "{{ item.1.partition_num }}" + JOURNAL_DEV: "{{ item.1.journal_device }}" + JOURNAL_PARTITION: "{{ item.1.journal }}" + JOURNAL_PARTITION_NUM: "{{ item.1.journal_num }}" + USE_EXTERNAL_JOURNAL: "{{ item.1.external_journal | bool }}" OSD_FILESYSTEM: "{{ ceph_osd_filesystem }}" OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}" HOSTNAME: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}" diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml index 3f2bdd4cd..63787dd12 100644 --- a/ansible/roles/ceph/tasks/start_osds.yml +++ b/ansible/roles/ceph/tasks/start_osds.yml @@ -2,7 +2,7 @@ - name: Looking up OSDs for Ceph command: docker exec -t kolla_toolbox /usr/bin/ansible localhost -m find_disks - -a "partition_name='KOLLA_CEPH_DATA'" + -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix'" register: osd_lookup changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}" failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS' @@ -34,7 +34,7 @@ environment: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" OSD_ID: "{{ item.0.stdout }}" - OSD_DEV: "{{ item.1['device'] }}" + JOURNAL_PARTITION: "{{ item.1.journal }}" image: "{{ ceph_osd_image_full }}" name: "ceph_osd_{{ item.0.stdout }}" pid_mode: "host" -- cgit v1.2.3