aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2016-03-09 04:15:15 +0000
committerSam Yaple <sam@yaple.net>2016-03-09 11:55:39 +0000
commit3b65e4993076d7000c57b55aaa26cc11173c2238 (patch)
tree6d2be452d95dd8431adaad461fad55e7976f9fcd /docker
parent1f3e75feb1f1b7740e0812d8b2169d5ed2e2542b (diff)
downloadkolla-3b65e4993076d7000c57b55aaa26cc11173c2238.tar.gz
kolla-3b65e4993076d7000c57b55aaa26cc11173c2238.zip
Add ceph wait before bootstrap
This will make sure ceph has a quorum and the cluster is functional before attempting to use it. We also make sure udev has time to create its links by looping a few times. This resolves the races found in the bootstrap process TrivialFix Change-Id: Ia4624916feb5c80b2a067e5a62c176c1a5dea460
Diffstat (limited to 'docker')
-rw-r--r--docker/ceph/ceph-osd/extend_start.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/docker/ceph/ceph-osd/extend_start.sh b/docker/ceph/ceph-osd/extend_start.sh
index 94736c8a8..202aad186 100644
--- a/docker/ceph/ceph-osd/extend_start.sh
+++ b/docker/ceph/ceph-osd/extend_start.sh
@@ -3,6 +3,9 @@
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ # Wait for ceph quorum before proceeding
+ ceph quorum_status
+
# Formatting disk for ceph
sgdisk --zap-all -- "${OSD_DEV}"
sgdisk --new=2:1M:5G --change-name=2:KOLLA_CEPH_JOURNAL --typecode=2:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 --mbrtogpt -- "${OSD_DEV}"
@@ -10,8 +13,17 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# This command may throw errors that we can safely ignore
partprobe || true
- # We look up the appropriate device path with partition.
- OSD_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?1")
+ count=0
+ while [[ "${OSD_PARTITION}x" == "x" ]]; do
+ if [[ "${count}" -gt 5 ]]; then
+ echo "Could not find OSD Partition"
+ exit 1
+ fi
+ sleep 1
+ # We look up the appropriate device path with partition.
+ OSD_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?1")
+ count=$(( count + 1 ))
+ done
JOURNAL_PARTITION="${OSD_PARTITION%?}2"
OSD_ID=$(ceph osd create)