]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: drop support for device partition 1882/head
authorSébastien Han <seb@redhat.com>
Tue, 12 Sep 2017 21:31:19 +0000 (15:31 -0600)
committerSébastien Han <seb@redhat.com>
Tue, 12 Sep 2017 23:42:07 +0000 (17:42 -0600)
We have been struggling with this, it's still broken and breaking other
things too now.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1490283
Signed-off-by: Sébastien Han <seb@redhat.com>
12 files changed:
roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-osd/tasks/check_devices.yml
roles/ceph-osd/tasks/check_devices_static.yml
roles/ceph-osd/tasks/scenarios/collocated.yml
roles/ceph-osd/tasks/scenarios/non-collocated.yml
tests/functional/centos/7/bluestore/group_vars/all
tests/functional/centos/7/bs-crypt-ded-jrn/group_vars/all
tests/functional/centos/7/bs-dock-ded-jrn/group_vars/all
tests/functional/centos/7/cluster/group_vars/all
tests/functional/centos/7/crypt-ded-jrn/group_vars/all
tests/functional/centos/7/docker-ded-jrn/group_vars/all
tests/functional/ubuntu/16.04/cluster/group_vars/all

index 13a53e0fd8d7985a019e4905db9935927c794584..381048a2c73e5617a85d3df60c5097d452ddc27e 100644 (file)
@@ -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
 
 
 # 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
index c6833e1fbb2266dd0f42450e6267c64128aac97a..ea2455fce238226744459c5f8ca9899206fbf0c3 100644 (file)
   # 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:
index 9d82ce335db7dd167aac9961890bbbf237f7dd5f..eb1d12ff3beeaee2a43ea947820ac0da7e09f07a 100644 (file)
@@ -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
     - 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
index f62f83ac8d56c59acf6a41a39394f46ec069fa21..6398515072a60334cf25fbda7db4f2d8e597ab98 100644 (file)
@@ -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
 
     - 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
 
 - include: ../activate_osds.yml
index 9a744300c357a41cc781f83ed7f430ec5c910b50..49b76002b84aa85af33fe042760e944a2e3d9396 100644 (file)
     {{ 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'
     {{ 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 }}"
index 24be5a99c47625973a55edc5ff5337a427fc1a74..f500d0bbe67b1e0014ff6aca73f57bc1c28de23e 100644 (file)
@@ -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 }
index d533b666cd5444345e3d02472be499a96c45d522..0b1b2dad43acf502f286c3ac518c2f75aa18047e 100644 (file)
@@ -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 }
index e5a7a962c5c73f845bef217ce08c0ea0e3af8b08..9cd8f003098888823bcb6a45ff6fb997c563df29 100644 (file)
@@ -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
index 1d581d847bb2b6a5025fdc074ae828b1fc0a8919..a581e80422357330b484253cf0b0a9f769d24cd2 100644 (file)
@@ -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 }
index 964f3004b2795ec284eb68f331ef7e6e34805606..1d56e1341ed8b45785892b93ca03832a6ba3c99c 100644 (file)
@@ -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 }
index d37dc6fc8720c4fbac0291664205ce35fb54b810..1c1ebc553713f3bf6db55fa3ccebaf2baa609230 100644 (file)
@@ -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
index b4326d2fe7792088b7edd39d1b5e3d075484b59b..593e6c987e36734d843e7f6e8cc3ba29554cbce8 100644 (file)
@@ -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 }