]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-osd: handle loop devices with containers
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 25 Sep 2019 13:40:34 +0000 (09:40 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 25 Sep 2019 14:11:29 +0000 (16:11 +0200)
Since we change the way to run the OSD containers with the ID instead
of the device name, we lost the ability to use loop devices.
Loop devices are like nvme or cciss devices because the partitions are
referenced with an extra 'p' before the partition number.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749097

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-osd/templates/ceph-osd-run.sh.j2

index b2d57d3c2681a17d45df46b6a42307edb8446714..cf4c25fb19fe986c6adaf622564c18c2035c46fc 100644 (file)
@@ -17,7 +17,7 @@ function id_to_device () {
   docker run --rm --net=host --ulimit nofile=1024:4096 --ipc=host --pid=host --privileged=true -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /dev:/dev -v /etc/localtime:/etc/localtime:ro -e DEBUG=verbose -e CLUSTER={{ cluster }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} osd_ceph_disk_dmcrypt_data_map
 {% endif %}
   DATA_PART=$(docker run --rm --ulimit nofile=1024:4096 --privileged=true -v /dev/:/dev/ -v /etc/ceph:/etc/ceph:z --entrypoint ceph-disk {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} list | grep ", osd\.${1}," | awk '{ print $1 }')
-  if [[ "${DATA_PART}" =~ ^/dev/(cciss|nvme) ]]; then
+  if [[ "${DATA_PART}" =~ ^/dev/(cciss|nvme|loop) ]]; then
     OSD_DEVICE=${DATA_PART:0:-2}
   else
     OSD_DEVICE=${DATA_PART:0:-1}