aboutsummaryrefslogtreecommitdiff
path: root/docker/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ceph')
-rw-r--r--docker/ceph/ceph-osd/extend_start.sh37
1 files changed, 17 insertions, 20 deletions
diff --git a/docker/ceph/ceph-osd/extend_start.sh b/docker/ceph/ceph-osd/extend_start.sh
index 5db6f61c9..97119578a 100644
--- a/docker/ceph/ceph-osd/extend_start.sh
+++ b/docker/ceph/ceph-osd/extend_start.sh
@@ -3,28 +3,22 @@
# 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
+ # NOTE(SamYaple): Static gpt partcodes
+ CEPH_JOURNAL_TYPE_CODE="45B0969E-9B03-4F30-B4C6-B4B80CEFF106"
+ CEPH_OSD_TYPE_CODE="4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D"
+
# 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}"
- sgdisk --largest-new=1 --change-name=1:KOLLA_CEPH_DATA --typecode=1:4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D -- "${OSD_DEV}"
- # This command may throw errors that we can safely ignore
- partprobe || true
+ if [[ "${USE_EXTERNAL_JOURNAL}" == "False" ]]; then
+ # Formatting disk for ceph
+ sgdisk --zap-all -- "${OSD_DEV}"
+ sgdisk --new=2:1M:5G -- "${JOURNAL_DEV}"
+ sgdisk --largest-new=1 -- "${OSD_DEV}"
+ # NOTE(SamYaple): This command may throw errors that we can safely ignore
+ partprobe || true
- 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"
+ fi
OSD_ID=$(ceph osd create)
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
@@ -56,10 +50,13 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# Adding osd to crush map
ceph osd crush add "${OSD_ID}" "${OSD_INITIAL_WEIGHT}" host="${HOSTNAME}${CEPH_ROOT_NAME:+-${CEPH_ROOT_NAME}}"
+
+ # Setting partition name based on ${OSD_ID}
+ sgdisk "--change-name=${OSD_PARTITION_NUM}:KOLLA_CEPH_DATA_${OSD_ID}" "--typecode=${OSD_PARTITION_NUM}:${CEPH_OSD_TYPE_CODE}" -- "${OSD_DEV}"
+ sgdisk "--change-name=${JOURNAL_PARTITION_NUM}:KOLLA_CEPH_DATA_${OSD_ID}_J" "--typecode=${JOURNAL_PARTITION_NUM}:${CEPH_JOURNAL_TYPE_CODE}" -- "${JOURNAL_DEV}"
+
exit 0
fi
-# We look up the appropriate journal since we cannot rely on symlinks
-JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2")
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
ARGS="-i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"