diff options
| author | Zuul <zuul@review.openstack.org> | 2019-04-07 16:45:54 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-04-07 16:45:54 +0000 |
| commit | c16eb31ee0e6e2f01d50794c90a19c85793515a2 (patch) | |
| tree | 44d4a58ffad328aae5f7a5ea05402906a5984975 /docker | |
| parent | 7514de1474cb281046a5b3106a8f413ec44d0272 (diff) | |
| parent | 3d4a7360a7c51a1f1c806a70026a7c8b20e20789 (diff) | |
| download | kolla-c16eb31ee0e6e2f01d50794c90a19c85793515a2.tar.gz kolla-c16eb31ee0e6e2f01d50794c90a19c85793515a2.zip | |
Merge "Fix the problem that the crush map is changed"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/ceph/ceph-osd/extend_start.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docker/ceph/ceph-osd/extend_start.sh b/docker/ceph/ceph-osd/extend_start.sh index eafd3d290..158ee74a3 100644 --- a/docker/ceph/ceph-osd/extend_start.sh +++ b/docker/ceph/ceph-osd/extend_start.sh @@ -148,8 +148,12 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then # 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 - ceph osd crush move "${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" root=${CEPH_ROOT_NAME:-default} + host_bucket_name="${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" + host_bucket_check=$(ceph osd tree | awk '/'"${host_bucket_name}"'/{print $0}' | wc -l) + if [[ "${host_bucket_check}" -eq 0 ]]; then + ceph osd crush add-bucket "${host_bucket_name}" host + ceph osd crush move "${host_bucket_name}" root=${CEPH_ROOT_NAME:-default} + fi # Adding osd to crush map ceph osd crush add "${OSD_ID}" "${OSD_INITIAL_WEIGHT}" host="${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}" |
