From bb4796774bed2c380d787e11d267d7e6178787fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Fri, 7 Mar 2014 14:04:25 +0100 Subject: [PATCH] Add multi-journal support and fix collocation scenario MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This commits brings the support of multiple journals where each journal points to a specific OSD and vice-versa. The commit also clarifies the usage of multi scenarios for both journal and osd_data. In the meantime, it fixes the collocation scenario. Signed-off-by: Sébastien Han --- group_vars/osds | 45 ++++++++++++++++++++++++++++++++++------ roles/osd/tasks/main.yml | 22 +++++++++++++++++++- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/group_vars/osds b/group_vars/osds index 10f5f7dbe..517725366 100644 --- a/group_vars/osds +++ b/group_vars/osds @@ -7,12 +7,45 @@ # Ansible will just skip them. Newly added disk will be # automatically configured during the next run. # -devices: - - /dev/sdc - - /dev/sdd -# Use 'None' to undefined the variable. -# Using 'None' will colocate both journal and data on the same disk + +# !! WARNING !! +# +# /!\ ENABLE ONLY ONE SCENARIO AT A TIME /!\ +# +# !! WARNING !! + + +# Declare devices +# All the scenarii inherit from the following device declaration +# +devices: [ 'sdd', 'sde', 'sdf', 'sdg'] + + +# I. First scenario: journal and osd_data on the same device +# Use 'true' to enable this scenario +# This will collocate both journal and data on the same disk # creating a partition at the beginning of the device # -journal_device: /dev/sdb +journal_collocation: true + + +# II. Second scenario: single journal device for N OSDs +# Use 'true' to enable this scenario +# +raw_journal: false +raw_journal_device: /dev/sdb + + +# III. Third scenario: N journal devices for N OSDs +# Use 'true' to enable this scenario +# +# In the following example: +# * sdd and sde will get sdb as a journal +# * sdf and sdg will get sdc as a journal +# While starting you have 2 options: +# 1. Pre-allocate all the devices +# 2. Progressively add new devices + +raw_multi_journal: false +raw_journal_devices: [ 'sdb', 'sdb', 'sdc', 'sdc' ] diff --git a/roles/osd/tasks/main.yml b/roles/osd/tasks/main.yml index c381975fc..5e1e3b566 100644 --- a/roles/osd/tasks/main.yml +++ b/roles/osd/tasks/main.yml @@ -36,13 +36,33 @@ # if you have 64 disks with 4TB each, this will take a while # since Ansible will sequential process the loop +# Scenario 1 without dedicated journal +- name: Prepare OSD disk(s) + command: ceph-disk prepare {{ item.1 }} + when: item.0.rc != 0 and journal_collocation + ignore_errors: True + with_together: + - parted.results + - devices + +# Scenario 2 with dedicated journal - name: Prepare OSD disk(s) command: ceph-disk prepare {{ item.1 }} {{ journal_device }} - when: item.0.rc != 0 + when: item.0.rc != 0 and raw_journal + ignore_errors: True + with_together: + - parted.results + - devices + +# Scenario 3 +- name: Prepare OSD disk(s) + command: ceph-disk prepare /dev/{{ item.1 }} /dev/{{ item.2 }} + when: item.0.rc != 0 and raw_multi_journal ignore_errors: True with_together: - parted.results - devices + - raw_journal_devices # Activate means: # - mount the volume in a temp location -- 2.39.5