From 0930f149154151e19dfc85917b1d8acf19234d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 8 Nov 2017 11:33:10 +1100 Subject: [PATCH 1/2] osd: do not use dm when osd_auto_discovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current code will also return lvm devices such as /dev/dm-2, this kind of device type is not supported by ceph-disk at the moment. Now we just ignore them. Signed-off-by: Sébastien Han --- roles/ceph-osd/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index 3025999cd..773ced7ea 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -28,6 +28,7 @@ - item.value.removable == "0" - item.value.partitions|count == 0 - item.value.holders|count == 0 + - "'dm-' not in item.key" - name: include check_devices.yml include: check_devices.yml From d5dfc63c89268c51253f3465a6e39be7cdfe12e4 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 8 Nov 2017 08:47:39 +0100 Subject: [PATCH 2/2] osd: fix automatic prepare when auto_discover Use `devices` variable instead of `ansible_devices`, otherwise it means we are not using the devices which have been 'auto discovered' Signed-off-by: Guillaume Abrioux --- roles/ceph-osd/tasks/scenarios/collocated.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/roles/ceph-osd/tasks/scenarios/collocated.yml b/roles/ceph-osd/tasks/scenarios/collocated.yml index 9c6621aff..9ec407eb8 100644 --- a/roles/ceph-osd/tasks/scenarios/collocated.yml +++ b/roles/ceph-osd/tasks/scenarios/collocated.yml @@ -33,7 +33,7 @@ docker run --net=host \ --pid=host \ --privileged=true \ - --name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.key }} \ + --name=ceph-osd-prepare-{{ ansible_hostname }}-{{ item.split('/')[-1] }} \ -v /etc/ceph:/etc/ceph \ -v /var/lib/ceph/:/var/lib/ceph/ \ -v /dev:/dev \ @@ -41,18 +41,15 @@ -e DEBUG=verbose \ -e CLUSTER={{ cluster }} \ -e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \ - -e OSD_DEVICE=/dev/{{ item.key }} \ + -e OSD_DEVICE={{ item }} \ {{ docker_env_args }} \ {{ ceph_osd_docker_prepare_env }} \ {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} - with_dict: "{{ ansible_devices }}" + with_items: "{{ devices }}" when: - osd_auto_discovery - containerized_deployment - - ansible_devices is defined - - item.value.removable == "0" - - item.value.partitions|count == 0 - - item.value.holders|count == 0 + - devices is defined - 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.1 }}"