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,14 +36,34 @@ # 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 }} {{ journal_device }} - when: item.0.rc != 0 + 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 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 # - allocate an osd id (if needed)