scripts/ceph: Make sure osd_class_dir is an absolute path

Some Ceph builds, as seen under fedora37, have their default
osd_class_dir parameter set improperly to a relative path. As a
result, Ceph is not able to open and load .so libs that are part
of rados-classes. Example of an error seen in the ceph logs:

could not stat class lib64/rados-classes/libcls_rbd.so: (2) No such file or directory

To workaround it, always slap "/" at the beginning of the path.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I08c2c94f7469748489ef4a9f0e65f3faccbecfb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16064
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Michal Berger 2022-12-22 18:04:09 +01:00 committed by Tomasz Zawadzki
parent c8a36b04cb
commit 633e832cec

View File

@ -136,6 +136,10 @@ ceph-osd -c ${ceph_conf} -i $i --mkfs --mkkey --osd-uuid ${uuid} ${ceph_osd_extr
ceph -c ${ceph_conf} osd crush add osd.${i} 1.0 host=$(hostname) root=default
ceph -c ${ceph_conf} -i ${mnt_dir}/osd-device-${i}-data/keyring auth add osd.${i} osd "allow *" mon "allow profile osd" mgr "allow *"
class_dir=/$(ceph -c "$ceph_conf" config get osd osd_class_dir)
[[ -e $class_dir ]]
ceph -c "$ceph_conf" config set osd osd_class_dir "$class_dir"
# start osd
pkill -9 ceph-osd || true
sleep 2