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.
|
||||
|
||||
- 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
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
@ -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 }}"
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue