Merge "[CEPH] Fix race conditions with OSD POD initialization"
This commit is contained in:
commit
5cca3e74d4
@ -50,6 +50,13 @@ else
|
|||||||
export OSD_JOURNAL=$(readlink -f ${JOURNAL_LOCATION})
|
export OSD_JOURNAL=$(readlink -f ${JOURNAL_LOCATION})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
function udev_settle {
|
||||||
|
partprobe "${OSD_DEVICE}"
|
||||||
|
# watch the udev event queue, and exit if all current events are handled
|
||||||
|
udevadm settle --timeout=600
|
||||||
|
}
|
||||||
|
|
||||||
# Calculate proper device names, given a device and partition number
|
# Calculate proper device names, given a device and partition number
|
||||||
function dev_part {
|
function dev_part {
|
||||||
local OSD_DEVICE=${1}
|
local OSD_DEVICE=${1}
|
||||||
@ -121,12 +128,12 @@ function osd_disk_prepare {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
udev_settle
|
||||||
|
|
||||||
# then search for some ceph metadata on the disk
|
# then search for some ceph metadata on the disk
|
||||||
if [[ "$(parted --script ${OSD_DEVICE} print | egrep '^ 1.*ceph data')" ]]; then
|
if [[ "$(parted --script ${OSD_DEVICE} print | egrep '^ 1.*ceph data')" ]]; then
|
||||||
if [[ ${OSD_FORCE_ZAP} -eq 1 ]]; then
|
if [[ ${OSD_FORCE_ZAP} -eq 1 ]]; then
|
||||||
if [ -b "${OSD_DEVICE}1" ]; then
|
if [ -b "${OSD_DEVICE}1" ]; then
|
||||||
local fs=`lsblk -fn ${OSD_DEVICE}1`
|
|
||||||
if [ ! -z "${fs}" ]; then
|
|
||||||
local cephFSID=`ceph-conf --lookup fsid`
|
local cephFSID=`ceph-conf --lookup fsid`
|
||||||
if [ ! -z "${cephFSID}" ]; then
|
if [ ! -z "${cephFSID}" ]; then
|
||||||
local tmpmnt=`mktemp -d`
|
local tmpmnt=`mktemp -d`
|
||||||
@ -157,11 +164,6 @@ function osd_disk_prepare {
|
|||||||
echo "Moving on, trying to activate the OSD now."
|
echo "Moving on, trying to activate the OSD now."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "It looks like ${OSD_DEVICE} has a ceph data partition but no filesystem."
|
|
||||||
echo "Because OSD_FORCE_ZAP was set, we will zap this device."
|
|
||||||
ceph-disk -v zap ${OSD_DEVICE}
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "parted says ${OSD_DEVICE}1 should exist, but we do not see it."
|
echo "parted says ${OSD_DEVICE}1 should exist, but we do not see it."
|
||||||
echo "We will ignore OSD_FORCE_ZAP and try to use the device as-is"
|
echo "We will ignore OSD_FORCE_ZAP and try to use the device as-is"
|
||||||
@ -225,8 +227,7 @@ function osd_disk_prepare {
|
|||||||
|
|
||||||
ceph-disk -v prepare ${CLI_OPTS} --journal-uuid ${OSD_JOURNAL_UUID} ${OSD_DEVICE} ${OSD_JOURNAL}
|
ceph-disk -v prepare ${CLI_OPTS} --journal-uuid ${OSD_JOURNAL_UUID} ${OSD_DEVICE} ${OSD_JOURNAL}
|
||||||
|
|
||||||
# watch the udev event queue, and exit if all current events are handled
|
udev_settle
|
||||||
udevadm settle --timeout=600
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! [ "x${STORAGE_TYPE%-*}" == "xdirectory" ]; then
|
if ! [ "x${STORAGE_TYPE%-*}" == "xdirectory" ]; then
|
||||||
|
@ -79,6 +79,9 @@ spec:
|
|||||||
- name: pod-var-lib-ceph
|
- name: pod-var-lib-ceph
|
||||||
mountPath: /var/lib/ceph
|
mountPath: /var/lib/ceph
|
||||||
readOnly: false
|
readOnly: false
|
||||||
|
- name: pod-var-lib-ceph-tmp
|
||||||
|
mountPath: /var/lib/ceph/tmp
|
||||||
|
readOnly: false
|
||||||
- name: pod-run
|
- name: pod-run
|
||||||
mountPath: /run
|
mountPath: /run
|
||||||
readOnly: false
|
readOnly: false
|
||||||
@ -160,6 +163,9 @@ spec:
|
|||||||
- name: pod-var-lib-ceph
|
- name: pod-var-lib-ceph
|
||||||
mountPath: /var/lib/ceph
|
mountPath: /var/lib/ceph
|
||||||
readOnly: false
|
readOnly: false
|
||||||
|
- name: pod-var-lib-ceph-tmp
|
||||||
|
mountPath: /var/lib/ceph/tmp
|
||||||
|
ReadOnly: false
|
||||||
- name: pod-run
|
- name: pod-run
|
||||||
mountPath: /run
|
mountPath: /run
|
||||||
readOnly: false
|
readOnly: false
|
||||||
@ -288,6 +294,10 @@ spec:
|
|||||||
path: /run/lvm
|
path: /run/lvm
|
||||||
- name: pod-var-lib-ceph
|
- name: pod-var-lib-ceph
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: pod-var-lib-ceph-tmp
|
||||||
|
hostPath:
|
||||||
|
path: /var/lib/openstack-helm/ceph/var-tmp
|
||||||
|
type: DirectoryOrCreate
|
||||||
- name: pod-var-log
|
- name: pod-var-log
|
||||||
hostPath:
|
hostPath:
|
||||||
path: {{ print "/var/log/ceph/" $envAll.Release.Name }}
|
path: {{ print "/var/log/ceph/" $envAll.Release.Name }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user