aboutsummaryrefslogtreecommitdiff
path: root/docker/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ceph')
-rw-r--r--docker/ceph/ceph-osd/extend_start.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/docker/ceph/ceph-osd/extend_start.sh b/docker/ceph/ceph-osd/extend_start.sh
index 733e45ff9..ee745d0af 100644
--- a/docker/ceph/ceph-osd/extend_start.sh
+++ b/docker/ceph/ceph-osd/extend_start.sh
@@ -50,6 +50,10 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
CEPH_ROOT_NAME=cache
fi
+ if [[ "${OSD_INITIAL_WEIGHT}" == "auto" ]]; then
+ OSD_INITIAL_WEIGHT=$(parted --script ${OSD_PARTITION} unit TB print | awk 'match($0, /^Disk.* (.*)TB/, a){printf("%.2f", a[1])}')
+ fi
+
# These commands only need to be run once per host but are safe to run
# repeatedly. This can be improved later or if any problems arise.
ceph osd crush add-bucket "${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" host