mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #1882 from ceph/multi-journal
osd: drop support for device partitionpull/1891/head
commit
f67b47d056
|
@ -3,29 +3,23 @@
|
||||||
# partition.
|
# partition.
|
||||||
|
|
||||||
- name: activate osd(s) when device is a disk
|
- 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
|
command: ceph-disk activate {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices|unique }}"
|
- "{{ devices|unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
register: activate_osd_disk
|
register: activate_osd_disk
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
|
||||||
- item.0.get("rc", 0) != "0"
|
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
|
|
||||||
- name: activate osd(s) when device is a disk (dmcrypt)
|
- 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
|
command: ceph-disk activate --dmcrypt {{ item | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices|unique }}"
|
- "{{ devices|unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
register: activate_osd_disk_dmcrypt
|
register: activate_osd_disk_dmcrypt
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
|
||||||
- item.0.get("rc", 0) != "0"
|
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
- dmcrypt
|
- dmcrypt
|
||||||
|
|
||||||
|
@ -44,13 +38,10 @@
|
||||||
|
|
||||||
# NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
|
# NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
|
||||||
- name: activate osd(s) when device is a partition
|
- name: activate osd(s) when device is a partition
|
||||||
command: "ceph-disk activate {{ item.1 }}"
|
command: "ceph-disk activate {{ item }}"
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices|unique }}"
|
- "{{ devices|unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
|
||||||
- item.0.get("rc", 0) == "0"
|
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
|
|
|
@ -14,25 +14,15 @@
|
||||||
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
|
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
|
||||||
static: False
|
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
|
- name: check the partition status of the journal devices
|
||||||
shell: "parted --script {{ item.1 }} print > /dev/null 2>&1"
|
command: "parted --script {{ item }} print"
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ journal_ispartition_results.results }}"
|
|
||||||
- "{{ dedicated_devices|unique }}"
|
- "{{ dedicated_devices|unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
always_run: true
|
always_run: true
|
||||||
register: journal_partition_status
|
register: journal_partition_status
|
||||||
when:
|
when:
|
||||||
- item.0.rc != 0
|
|
||||||
- osd_scenario == 'non-collocated'
|
- osd_scenario == 'non-collocated'
|
||||||
|
|
||||||
- name: fix partitions gpt header or labels of the journal device(s)
|
- name: fix partitions gpt header or labels of the journal device(s)
|
||||||
|
@ -50,7 +40,7 @@
|
||||||
- name: create gpt disk label of the journal device(s)
|
- name: create gpt disk label of the journal device(s)
|
||||||
command: parted --script {{ item.1 }} mklabel gpt
|
command: parted --script {{ item.1 }} mklabel gpt
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ osd_partition_status_results.results }}"
|
- "{{ journal_partition_status.results }}"
|
||||||
- "{{ dedicated_devices|unique }}"
|
- "{{ dedicated_devices|unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
|
|
|
@ -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
|
- name: check the partition status of the osd disks
|
||||||
shell: "parted --script {{ item.1 }} print > /dev/null 2>&1"
|
command: "parted --script {{ item }} print"
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
always_run: true
|
always_run: true
|
||||||
register: osd_partition_status_results
|
register: osd_partition_status_results
|
||||||
when: item.0.rc != 0
|
|
||||||
|
|
||||||
# NOTE: The following calls to sgdisk are retried because sgdisk is known to
|
# 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
|
# fully wipe a device the first time around. There is no need to halt execution
|
||||||
|
@ -46,12 +36,10 @@
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
|
|
||||||
- name: check if a partition named 'ceph' exists
|
- name: check if a partition named 'ceph' exists
|
||||||
shell: "parted --script {{ item.1 }} print | egrep -sq '^ 1.*ceph'"
|
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
|
||||||
with_together:
|
with_items:
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
always_run: true
|
always_run: true
|
||||||
register: parted_results
|
register: parted_results
|
||||||
when: item.0.rc != 0
|
|
||||||
|
|
|
@ -7,26 +7,23 @@
|
||||||
docker run --net=host \
|
docker run --net=host \
|
||||||
--pid=host \
|
--pid=host \
|
||||||
--privileged=true \
|
--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 /etc/ceph:/etc/ceph \
|
||||||
-v /var/lib/ceph/:/var/lib/ceph/ \
|
-v /var/lib/ceph/:/var/lib/ceph/ \
|
||||||
-v /dev:/dev \
|
-v /dev:/dev \
|
||||||
-v /etc/localtime:/etc/localtime:ro \
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
-e CLUSTER={{ cluster }} \
|
-e CLUSTER={{ cluster }} \
|
||||||
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
|
-e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \
|
||||||
-e OSD_DEVICE={{ item.2 }} \
|
-e OSD_DEVICE={{ item.1 }} \
|
||||||
{{ docker_env_args }} \
|
{{ docker_env_args }} \
|
||||||
{{ ceph_osd_docker_prepare_env }} \
|
{{ ceph_osd_docker_prepare_env }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ parted_results.results | default([]) }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ ispartition_results.results | default([]) }}"
|
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
- not item.0.get("skipped")
|
||||||
- not item.1.get("skipped")
|
|
||||||
- item.0.get("rc", 0) != 0
|
- item.0.get("rc", 0) != 0
|
||||||
- item.1.get("rc", 0) != 0
|
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
|
|
||||||
|
@ -56,14 +53,11 @@
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
|
|
||||||
- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with collocated osd data and journal
|
- 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:
|
with_together:
|
||||||
- "{{ parted_results.results | default([]) }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ ispartition_results.results | default([]) }}"
|
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
- not item.0.get("skipped")
|
||||||
- not item.1.get("skipped")
|
|
||||||
- item.0.get("rc", 0) != 0
|
- item.0.get("rc", 0) != 0
|
||||||
- item.1.get("rc", 0) != 0
|
|
||||||
- not containerized_deployment
|
- not containerized_deployment
|
||||||
|
|
|
@ -20,11 +20,12 @@
|
||||||
{{ ceph_osd_docker_prepare_env }} \
|
{{ ceph_osd_docker_prepare_env }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ parted_results.results }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
- "{{ dedicated_devices }}"
|
- "{{ dedicated_devices }}"
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
- not item.0.get("skipped")
|
||||||
|
- item.0.get("rc", 0) != 0
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
- osd_objectstore == 'filestore'
|
- osd_objectstore == 'filestore'
|
||||||
|
@ -48,35 +49,34 @@
|
||||||
{{ ceph_osd_docker_prepare_env }} \
|
{{ ceph_osd_docker_prepare_env }} \
|
||||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ parted_results.results }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
- "{{ dedicated_devices }}"
|
- "{{ dedicated_devices }}"
|
||||||
- "{{ bluestore_wal_devices }}"
|
- "{{ bluestore_wal_devices }}"
|
||||||
when:
|
when:
|
||||||
- not item.0.get("skipped")
|
- not item.0.get("skipped")
|
||||||
|
- item.0.get("rc", 0) != 0
|
||||||
- not osd_auto_discovery
|
- not osd_auto_discovery
|
||||||
- containerized_deployment
|
- containerized_deployment
|
||||||
- osd_objectstore == 'bluestore'
|
- osd_objectstore == 'bluestore'
|
||||||
|
|
||||||
- name: prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) non-collocated
|
- 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:
|
with_together:
|
||||||
- "{{ parted_results.results }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ ispartition_results.results }}"
|
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
- "{{ dedicated_devices }}"
|
- "{{ dedicated_devices }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- item.0.get("skipped") or item.0.get("rc", 0) != 0
|
- not item.0.get("skipped")
|
||||||
- not item.1.get("skipped")
|
- item.0.get("rc", 0) != 0
|
||||||
- item.1.get("rc", 0) != 0
|
|
||||||
- osd_objectstore == 'filestore'
|
- osd_objectstore == 'filestore'
|
||||||
- not containerized_deployment
|
- not containerized_deployment
|
||||||
|
|
||||||
- name: manually prepare ceph "{{ osd_objectstore }}" non-containerized osd disk(s) with a dedicated device for db and wal
|
- 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 }}"
|
command: "ceph-disk prepare {{ ceph_disk_cli_options }} --block.db {{ item.1 }} --block.wal {{ item.2 }} {{ item.3 }}"
|
||||||
with_together:
|
with_together:
|
||||||
- "{{ parted_results.results }}"
|
- "{{ parted_results.results | default([]) }}"
|
||||||
- "{{ dedicated_devices }}"
|
- "{{ dedicated_devices }}"
|
||||||
- "{{ bluestore_wal_devices }}"
|
- "{{ bluestore_wal_devices }}"
|
||||||
- "{{ devices }}"
|
- "{{ devices }}"
|
||||||
|
|
|
@ -11,8 +11,10 @@ journal_size: 100
|
||||||
osd_objectstore: "bluestore"
|
osd_objectstore: "bluestore"
|
||||||
devices:
|
devices:
|
||||||
- '/dev/sda'
|
- '/dev/sda'
|
||||||
dedicated_devices:
|
|
||||||
- '/dev/sdb'
|
- '/dev/sdb'
|
||||||
|
dedicated_devices:
|
||||||
|
- '/dev/sdc'
|
||||||
|
- '/dev/sdc'
|
||||||
osd_scenario: non-collocated
|
osd_scenario: non-collocated
|
||||||
os_tuning_params:
|
os_tuning_params:
|
||||||
- { name: kernel.pid_max, value: 4194303 }
|
- { name: kernel.pid_max, value: 4194303 }
|
||||||
|
|
|
@ -12,8 +12,10 @@ dmcrypt: true
|
||||||
osd_objectstore: "bluestore"
|
osd_objectstore: "bluestore"
|
||||||
devices:
|
devices:
|
||||||
- '/dev/sda'
|
- '/dev/sda'
|
||||||
dedicated_devices:
|
|
||||||
- '/dev/sdb'
|
- '/dev/sdb'
|
||||||
|
dedicated_devices:
|
||||||
|
- '/dev/sdc'
|
||||||
|
- '/dev/sdc'
|
||||||
os_tuning_params:
|
os_tuning_params:
|
||||||
- { name: kernel.pid_max, value: 4194303 }
|
- { name: kernel.pid_max, value: 4194303 }
|
||||||
- { name: fs.file-max, value: 26234859 }
|
- { name: fs.file-max, value: 26234859 }
|
||||||
|
|
|
@ -17,7 +17,9 @@ osd_scenario: non-collocated
|
||||||
osd_objectstore: bluestore
|
osd_objectstore: bluestore
|
||||||
devices:
|
devices:
|
||||||
- /dev/sda
|
- /dev/sda
|
||||||
dedicated_devices:
|
|
||||||
- /dev/sdb
|
- /dev/sdb
|
||||||
|
dedicated_devices:
|
||||||
|
- /dev/sdc
|
||||||
|
- /dev/sdc
|
||||||
ceph_osd_docker_prepare_env: -e OSD_FORCE_ZAP=1
|
ceph_osd_docker_prepare_env: -e OSD_FORCE_ZAP=1
|
||||||
ceph_osd_docker_run_script_path: /var/tmp
|
ceph_osd_docker_run_script_path: /var/tmp
|
||||||
|
|
|
@ -10,8 +10,10 @@ radosgw_interface: eth1
|
||||||
osd_objectstore: filestore
|
osd_objectstore: filestore
|
||||||
devices:
|
devices:
|
||||||
- '/dev/sda'
|
- '/dev/sda'
|
||||||
dedicated_devices:
|
|
||||||
- '/dev/sdb'
|
- '/dev/sdb'
|
||||||
|
dedicated_devices:
|
||||||
|
- '/dev/sdc'
|
||||||
|
- '/dev/sdc'
|
||||||
osd_scenario: non-collocated
|
osd_scenario: non-collocated
|
||||||
os_tuning_params:
|
os_tuning_params:
|
||||||
- { name: kernel.pid_max, value: 4194303 }
|
- { name: kernel.pid_max, value: 4194303 }
|
||||||
|
|
|
@ -12,8 +12,10 @@ dmcrypt: true
|
||||||
osd_objectstore: filestore
|
osd_objectstore: filestore
|
||||||
devices:
|
devices:
|
||||||
- '/dev/sda'
|
- '/dev/sda'
|
||||||
dedicated_devices:
|
|
||||||
- '/dev/sdb'
|
- '/dev/sdb'
|
||||||
|
dedicated_devices:
|
||||||
|
- '/dev/sdc'
|
||||||
|
- '/dev/sdc'
|
||||||
os_tuning_params:
|
os_tuning_params:
|
||||||
- { name: kernel.pid_max, value: 4194303 }
|
- { name: kernel.pid_max, value: 4194303 }
|
||||||
- { name: fs.file-max, value: 26234859 }
|
- { name: fs.file-max, value: 26234859 }
|
||||||
|
|
|
@ -17,7 +17,9 @@ osd_objectstore: filestore
|
||||||
osd_scenario: non-collocated
|
osd_scenario: non-collocated
|
||||||
devices:
|
devices:
|
||||||
- /dev/sda
|
- /dev/sda
|
||||||
dedicated_devices:
|
|
||||||
- /dev/sdb
|
- /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_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
|
||||||
ceph_osd_docker_run_script_path: /var/tmp
|
ceph_osd_docker_run_script_path: /var/tmp
|
||||||
|
|
|
@ -9,9 +9,11 @@ monitor_interface: eth1
|
||||||
radosgw_interface: eth1
|
radosgw_interface: eth1
|
||||||
journal_size: 100
|
journal_size: 100
|
||||||
devices:
|
devices:
|
||||||
|
- '/dev/sda'
|
||||||
- '/dev/sdb'
|
- '/dev/sdb'
|
||||||
dedicated_devices:
|
dedicated_devices:
|
||||||
- '/dev/sdc'
|
- '/dev/sdc'
|
||||||
|
- '/dev/sdc'
|
||||||
osd_scenario: non-collocated
|
osd_scenario: non-collocated
|
||||||
os_tuning_params:
|
os_tuning_params:
|
||||||
- { name: kernel.pid_max, value: 4194303 }
|
- { name: kernel.pid_max, value: 4194303 }
|
||||||
|
|
Loading…
Reference in New Issue