Commit 4e76bd2f authored by Nick's avatar Nick

Some fixes for the ceph disk activate part

The "unless" condition for the ceph disk activate part did not work when using block devices as puppet always tried to activate a running OSD again and again. So I introduced an additional check with "ceph-disk list" which checks if the OSD is already active. The test to check if a whole block device gets used was not working for me as well. Udev should activate a whole block device when running ceph (since Infernalis), but for me the module tried to activate a OSD.

Change-Id: I708e2c62f351c4588ef1f69797f631c161388949
parent a564389a
......@@ -170,7 +170,7 @@ if ! test -b \$disk ; then
fi
fi
# activate happens via udev when using the entire device
if ! test -b \$disk || ! test -b \${disk}1 || ! test -b \${disk}p1 ; then
if ! test -b \$disk && ! ( test -b \${disk}1 || test -b \${disk}p1 ); then
ceph-disk activate \$disk || true
fi
if test -f ${udev_rules_file}.disabled && ( test -b \${disk}1 || test -b \${disk}p1 ); then
......@@ -179,6 +179,7 @@ fi
",
unless => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, active\" ||
ls -ld /var/lib/ceph/osd/${cluster_name}-* | grep \" $(readlink -f ${data})\$\"
",
logoutput => true,
......
......@@ -76,7 +76,7 @@ if ! test -b $disk ; then
fi
fi
# activate happens via udev when using the entire device
if ! test -b $disk || ! test -b ${disk}1 || ! test -b ${disk}p1 ; then
if ! test -b \$disk && ! ( test -b \${disk}1 || test -b \${disk}p1 ); then
ceph-disk activate $disk || true
fi
if test -f /usr/lib/udev/rules.d/95-ceph-osd.rules.disabled && ( test -b ${disk}1 || test -b ${disk}p1 ); then
......@@ -85,6 +85,7 @@ fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, active\" ||
ls -ld /var/lib/ceph/osd/ceph-* | grep \" $(readlink -f /srv)\$\"
",
'logoutput' => true
......@@ -163,7 +164,7 @@ if ! test -b $disk ; then
fi
fi
# activate happens via udev when using the entire device
if ! test -b $disk || ! test -b ${disk}1 || ! test -b ${disk}p1 ; then
if ! test -b \$disk && ! ( test -b \${disk}1 || test -b \${disk}p1 ); then
ceph-disk activate $disk || true
fi
if test -f /usr/lib/udev/rules.d/95-ceph-osd.rules.disabled && ( test -b ${disk}1 || test -b ${disk}p1 ); then
......@@ -172,6 +173,7 @@ fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, active\" ||
ls -ld /var/lib/ceph/osd/testcluster-* | grep \" $(readlink -f /srv/data)\$\"
",
'logoutput' => true
......@@ -231,7 +233,7 @@ if ! test -b $disk ; then
fi
fi
# activate happens via udev when using the entire device
if ! test -b $disk || ! test -b ${disk}1 || ! test -b ${disk}p1 ; then
if ! test -b \$disk && ! ( test -b \${disk}1 || test -b \${disk}p1 ); then
ceph-disk activate $disk || true
fi
if test -f /usr/lib/udev/rules.d/95-ceph-osd.rules.disabled && ( test -b ${disk}1 || test -b ${disk}p1 ); then
......@@ -240,6 +242,7 @@ fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, active\" ||
ls -ld /var/lib/ceph/osd/ceph-* | grep \" $(readlink -f /dev/nvme0n1)\$\"
",
'logoutput' => true
......@@ -299,7 +302,7 @@ if ! test -b $disk ; then
fi
fi
# activate happens via udev when using the entire device
if ! test -b $disk || ! test -b ${disk}1 || ! test -b ${disk}p1 ; then
if ! test -b \$disk && ! ( test -b \${disk}1 || test -b \${disk}p1 ); then
ceph-disk activate $disk || true
fi
if test -f /usr/lib/udev/rules.d/95-ceph-osd.rules.disabled && ( test -b ${disk}1 || test -b ${disk}p1 ); then
......@@ -308,6 +311,7 @@ fi
",
'unless' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex
ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, active\" ||
ls -ld /var/lib/ceph/osd/ceph-* | grep \" $(readlink -f /dev/cciss/c0d0)\$\"
",
'logoutput' => true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment