Skip to content

Commit

Permalink
Merge pull request #1882 from ceph/multi-journal
Browse files Browse the repository at this point in the history
osd: drop support for device partition
  • Loading branch information
leseb committed Sep 13, 2017
2 parents 911fa20 + fdf9244 commit f67b47d
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 68 deletions.
21 changes: 6 additions & 15 deletions roles/ceph-osd/tasks/activate_osds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,23 @@
# partition.

- name: activate osd(s) when device is a disk
command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_together:
- "{{ ispartition_results.results }}"
command: ceph-disk activate {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_items:
- "{{ devices|unique }}"
changed_when: false
failed_when: false
register: activate_osd_disk
when:
- not item.0.get("skipped")
- item.0.get("rc", 0) != "0"
- not osd_auto_discovery

- name: activate osd(s) when device is a disk (dmcrypt)
command: ceph-disk activate --dmcrypt {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_together:
- "{{ ispartition_results.results }}"
command: ceph-disk activate --dmcrypt {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
with_items:
- "{{ devices|unique }}"
changed_when: false
failed_when: false
register: activate_osd_disk_dmcrypt
when:
- not item.0.get("skipped")
- item.0.get("rc", 0) != "0"
- not osd_auto_discovery
- dmcrypt

Expand All @@ -44,13 +38,10 @@

# NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
- name: activate osd(s) when device is a partition
command: "ceph-disk activate {{ item.1 }}"
with_together:
- "{{ ispartition_results.results }}"
command: "ceph-disk activate {{ item }}"
with_items:
- "{{ devices|unique }}"
changed_when: false
failed_when: false
when:
- not item.0.get("skipped")
- item.0.get("rc", 0) == "0"
- not osd_auto_discovery
16 changes: 3 additions & 13 deletions roles/ceph-osd/tasks/check_devices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,15 @@
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False

- name: check the journal device is partition
shell: "readlink -f {{ item }} | egrep '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p)[0-9]{1,2}|fio[a-z]{1,2}[0-9]{1,2}$'"
with_items: "{{ dedicated_devices }}"
changed_when: false
failed_when: false
always_run: true
register: journal_ispartition_results

- name: check the partition status of the journal devices
shell: "parted --script {{ item.1 }} print > /dev/null 2>&1"
with_together:
- "{{ journal_ispartition_results.results }}"
command: "parted --script {{ item }} print"
with_items:
- "{{ dedicated_devices|unique }}"
changed_when: false
failed_when: false
always_run: true
register: journal_partition_status
when:
- item.0.rc != 0
- osd_scenario == 'non-collocated'

- name: fix partitions gpt header or labels of the journal device(s)
Expand All @@ -50,7 +40,7 @@
- name: create gpt disk label of the journal device(s)
command: parted --script {{ item.1 }} mklabel gpt
with_together:
- "{{ osd_partition_status_results.results }}"
- "{{ journal_partition_status.results }}"
- "{{ dedicated_devices|unique }}"
changed_when: false
when:
Expand Down
20 changes: 4 additions & 16 deletions roles/ceph-osd/tasks/check_devices_static.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
---
- name: check if the device is a partition
shell: "readlink -f {{ item }} | egrep '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p)[0-9]{1,2}|fio[a-z]{1,2}[0-9]{1,2}$'"
with_items: "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
register: ispartition_results

- name: check the partition status of the osd disks
shell: "parted --script {{ item.1 }} print > /dev/null 2>&1"
with_together:
- "{{ ispartition_results.results }}"
command: "parted --script {{ item }} print"
with_items:
- "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
register: osd_partition_status_results
when: item.0.rc != 0

# NOTE: The following calls to sgdisk are retried because sgdisk is known to
# fully wipe a device the first time around. There is no need to halt execution
Expand Down Expand Up @@ -46,12 +36,10 @@
- containerized_deployment

- name: check if a partition named 'ceph' exists
shell: "parted --script {{ item.1 }} print | egrep -sq '^ 1.*ceph'"
with_together:
- "{{ ispartition_results.results }}"
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
with_items:
- "{{ devices }}"
changed_when: false
failed_when: false
always_run: true
register: parted_results
when: item.0.rc != 0
12 changes: 3 additions & 9 deletions roles/ceph-osd/tasks/scenarios/collocated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@
docker run --net=host \
--pid=host \
--privileged=true \
--name=ceph-osd-prepare-{{ ansible_hostname }}-dev{{ item.2 | regex_replace('/', '') }} \
--name=ceph-osd-prepare-{{ ansible_hostname }}-dev{{ item.1 | regex_replace('/', '') }} \
-v /etc/ceph:/etc/ceph \
-v /var/lib/ceph/:/var/lib/ceph/ \
-v /dev:/dev \
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
-e OSD_DEVICE={{ item.2 }} \
-e OSD_DEVICE={{ item.1 }} \
{{ docker_env_args }} \
{{ ceph_osd_docker_prepare_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
with_together:
- "{{ parted_results.results | default([]) }}"
- "{{ ispartition_results.results | default([]) }}"
- "{{ devices }}"
when:
- not item.0.get("skipped")
- not item.1.get("skipped")
- item.0.get("rc", 0) != 0
- item.1.get("rc", 0) != 0
- not osd_auto_discovery
- containerized_deployment

Expand Down Expand Up @@ -56,14 +53,11 @@
- containerized_deployment

- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with collocated osd data and journal
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.2 }}"
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.1 }}"
with_together:
- "{{ parted_results.results | default([]) }}"
- "{{ ispartition_results.results | default([]) }}"
- "{{ devices }}"
when:
- not item.0.get("skipped")
- not item.1.get("skipped")
- item.0.get("rc", 0) != 0
- item.1.get("rc", 0) != 0
- not containerized_deployment
18 changes: 9 additions & 9 deletions roles/ceph-osd/tasks/scenarios/non-collocated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
{{ ceph_osd_docker_prepare_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
with_together:
- "{{ parted_results.results }}"
- "{{ parted_results.results | default([]) }}"
- "{{ devices }}"
- "{{ dedicated_devices }}"
when:
- not item.0.get("skipped")
- item.0.get("rc", 0) != 0
- not osd_auto_discovery
- containerized_deployment
- osd_objectstore == 'filestore'
Expand All @@ -48,35 +49,34 @@
{{ ceph_osd_docker_prepare_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
with_together:
- "{{ parted_results.results }}"
- "{{ parted_results.results | default([]) }}"
- "{{ devices }}"
- "{{ dedicated_devices }}"
- "{{ bluestore_wal_devices }}"
when:
- not item.0.get("skipped")
- item.0.get("rc", 0) != 0
- not osd_auto_discovery
- containerized_deployment
- osd_objectstore == 'bluestore'

- name: prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) non-collocated
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.2 }} {{ item.3 }}"
command: "ceph-disk prepare {{ ceph_disk_cli_options }} {{ item.1 }} {{ item.2 }}"
with_together:
- "{{ parted_results.results }}"
- "{{ ispartition_results.results }}"
- "{{ parted_results.results | default([]) }}"
- "{{ devices }}"
- "{{ dedicated_devices }}"
changed_when: false
when:
- item.0.get("skipped") or item.0.get("rc", 0) != 0
- not item.1.get("skipped")
- item.1.get("rc", 0) != 0
- not item.0.get("skipped")
- item.0.get("rc", 0) != 0
- osd_objectstore == 'filestore'
- not containerized_deployment

- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with a dedicated device for db and wal
command: "ceph-disk prepare {{ ceph_disk_cli_options }} --block.db {{ item.1 }} --block.wal {{ item.2 }} {{ item.3 }}"
with_together:
- "{{ parted_results.results }}"
- "{{ parted_results.results | default([]) }}"
- "{{ dedicated_devices }}"
- "{{ bluestore_wal_devices }}"
- "{{ devices }}"
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/centos/7/bluestore/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ journal_size: 100
osd_objectstore: "bluestore"
devices:
- '/dev/sda'
dedicated_devices:
- '/dev/sdb'
dedicated_devices:
- '/dev/sdc'
- '/dev/sdc'
osd_scenario: non-collocated
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/centos/7/bs-crypt-ded-jrn/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ dmcrypt: true
osd_objectstore: "bluestore"
devices:
- '/dev/sda'
dedicated_devices:
- '/dev/sdb'
dedicated_devices:
- '/dev/sdc'
- '/dev/sdc'
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
- { name: fs.file-max, value: 26234859 }
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/centos/7/bs-dock-ded-jrn/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ osd_scenario: non-collocated
osd_objectstore: bluestore
devices:
- /dev/sda
dedicated_devices:
- /dev/sdb
dedicated_devices:
- /dev/sdc
- /dev/sdc
ceph_osd_docker_prepare_env: -e OSD_FORCE_ZAP=1
ceph_osd_docker_run_script_path: /var/tmp
4 changes: 3 additions & 1 deletion tests/functional/centos/7/cluster/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ radosgw_interface: eth1
osd_objectstore: filestore
devices:
- '/dev/sda'
dedicated_devices:
- '/dev/sdb'
dedicated_devices:
- '/dev/sdc'
- '/dev/sdc'
osd_scenario: non-collocated
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/centos/7/crypt-ded-jrn/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ dmcrypt: true
osd_objectstore: filestore
devices:
- '/dev/sda'
dedicated_devices:
- '/dev/sdb'
dedicated_devices:
- '/dev/sdc'
- '/dev/sdc'
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
- { name: fs.file-max, value: 26234859 }
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/centos/7/docker-ded-jrn/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ osd_objectstore: filestore
osd_scenario: non-collocated
devices:
- /dev/sda
dedicated_devices:
- /dev/sdb
dedicated_devices:
- /dev/sdc
- /dev/sdc
ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
ceph_osd_docker_run_script_path: /var/tmp
2 changes: 2 additions & 0 deletions tests/functional/ubuntu/16.04/cluster/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ monitor_interface: eth1
radosgw_interface: eth1
journal_size: 100
devices:
- '/dev/sda'
- '/dev/sdb'
dedicated_devices:
- '/dev/sdc'
- '/dev/sdc'
osd_scenario: non-collocated
os_tuning_params:
- { name: kernel.pid_max, value: 4194303 }
Expand Down

0 comments on commit f67b47d

Please sign in to comment.