diff --git a/tools/deployment/multinode/030-ceph.sh b/tools/deployment/multinode/030-ceph.sh index 07bbf6938..c340c20f6 100755 --- a/tools/deployment/multinode/030-ceph.sh +++ b/tools/deployment/multinode/030-ceph.sh @@ -15,8 +15,10 @@ set -xe # setup loopback devices for ceph -./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data \ -${CEPH_OSD_DATA_DEVICE:=/dev/loop0} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=/dev/loop1} +free_loop_devices=( $(ls -1 /dev/loop[0-7] | while read loopdev; do losetup | grep -q $loopdev || echo $loopdev; done) ) +./tools/deployment/common/setup-ceph-loopback-device.sh \ + --ceph-osd-data ${CEPH_OSD_DATA_DEVICE:=${free_loop_devices[0]}} \ + --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=${free_loop_devices[1]}} #NOTE: Lint and package chart make ceph-mon diff --git a/tools/deployment/osh-infra-logging-tls/020-ceph.sh b/tools/deployment/osh-infra-logging-tls/020-ceph.sh index 6d782a166..7044191ff 100755 --- a/tools/deployment/osh-infra-logging-tls/020-ceph.sh +++ b/tools/deployment/osh-infra-logging-tls/020-ceph.sh @@ -15,8 +15,10 @@ set -xe # setup loopback devices for ceph -./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data \ -${CEPH_OSD_DATA_DEVICE:=/dev/loop0} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=/dev/loop1} +free_loop_devices=( $(ls -1 /dev/loop[0-7] | while read loopdev; do losetup | grep -q $loopdev || echo $loopdev; done) ) +./tools/deployment/common/setup-ceph-loopback-device.sh \ + --ceph-osd-data ${CEPH_OSD_DATA_DEVICE:=${free_loop_devices[0]}} \ + --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=${free_loop_devices[1]}} #NOTE: Lint and package chart for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do diff --git a/tools/deployment/osh-infra-logging/020-ceph.sh b/tools/deployment/osh-infra-logging/020-ceph.sh index 54caca757..4f22ccf70 100755 --- a/tools/deployment/osh-infra-logging/020-ceph.sh +++ b/tools/deployment/osh-infra-logging/020-ceph.sh @@ -15,8 +15,10 @@ set -xe # setup loopback devices for ceph -./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data \ -${CEPH_OSD_DATA_DEVICE:=/dev/loop0} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=/dev/loop1} +free_loop_devices=( $(ls -1 /dev/loop[0-7] | while read loopdev; do losetup | grep -q $loopdev || echo $loopdev; done) ) +./tools/deployment/common/setup-ceph-loopback-device.sh \ + --ceph-osd-data ${CEPH_OSD_DATA_DEVICE:=${free_loop_devices[0]}} \ + --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=${free_loop_devices[1]}} #NOTE: Lint and package chart for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do diff --git a/tools/deployment/tenant-ceph/030-ceph.sh b/tools/deployment/tenant-ceph/030-ceph.sh index ccdced69a..8b5f9cb9c 100755 --- a/tools/deployment/tenant-ceph/030-ceph.sh +++ b/tools/deployment/tenant-ceph/030-ceph.sh @@ -15,8 +15,10 @@ set -xe # setup loopback devices for ceph -./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data \ -${CEPH_OSD_DATA_DEVICE:=/dev/loop0} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=/dev/loop1} +free_loop_devices=( $(ls -1 /dev/loop[0-7] | while read loopdev; do losetup | grep -q $loopdev || echo $loopdev; done) ) +./tools/deployment/common/setup-ceph-loopback-device.sh \ + --ceph-osd-data ${CEPH_OSD_DATA_DEVICE:=${free_loop_devices[0]}} \ + --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=${free_loop_devices[1]}} #NOTE: Deploy command [ -s /tmp/ceph-fs-uuid.txt ] || uuidgen > /tmp/ceph-fs-uuid.txt diff --git a/tools/deployment/tenant-ceph/040-tenant-ceph.sh b/tools/deployment/tenant-ceph/040-tenant-ceph.sh index 3ea85ef95..44bde6773 100755 --- a/tools/deployment/tenant-ceph/040-tenant-ceph.sh +++ b/tools/deployment/tenant-ceph/040-tenant-ceph.sh @@ -14,11 +14,12 @@ set -xe -: "${CEPH_OSD_DATA_DEVICE:=/dev/loop2}" -: "${CEPH_OSD_DB_WAL_DEVICE:=/dev/loop3}" # setup loopback devices for ceph +free_loop_devices=( $(ls -1 /dev/loop[0-7] | while read loopdev; do losetup | grep -q $loopdev || echo $loopdev; done) ) export CEPH_NAMESPACE="tenant-ceph" -./tools/deployment/common/setup-ceph-loopback-device.sh --ceph-osd-data ${CEPH_OSD_DATA_DEVICE} --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE} +./tools/deployment/common/setup-ceph-loopback-device.sh \ + --ceph-osd-data ${CEPH_OSD_DATA_DEVICE:=${free_loop_devices[0]}} \ + --ceph-osd-dbwal ${CEPH_OSD_DB_WAL_DEVICE:=${free_loop_devices[1]}} # setup loopback devices for ceph osds setup_loopback_devices $OSD_DATA_DEVICE $OSD_DB_WAL_DEVICE