Skip to content

Commit 0a861f0

Browse files
authored
Merge pull request ceph#56794 from adk3798/cephadm-raw-osd-teuthology-test
qa/cephadm: teuthology test for deploying raw OSDs
2 parents f34b87f + 8ed5ed4 commit 0a861f0

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
overrides:
2+
cephadm:
3+
raw-osds: True
4+
tasks:
5+
- cephadm.shell:
6+
host.a:
7+
- |
8+
set -e
9+
set -x
10+
ceph orch ps
11+
ceph orch device ls
12+
ceph osd tree
13+
ORCH_PS=$(ceph orch ps)
14+
if grep -q "No daemons" <<< "$ORCH_PS"; then
15+
echo "No OSDs were deployed"
16+
exit 1
17+
fi
18+
ceph orch ps | grep -q "running"
19+
if grep -q "failed" <<< "$ORCH_PS"; then
20+
echo "At least one raw OSD deployed is failed"
21+
exit 1
22+
fi
23+
if grep -q "stopped" <<< "$ORCH_PS"; then
24+
echo "At least one raw OSD deployed is stopped"
25+
exit 1
26+
fi
27+
if ceph-volume lvm list; then
28+
echo "ceph-volume lvm list was expected to give non-zero rc with all raw OSDs"
29+
exit 1
30+
fi

qa/tasks/cephadm.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,12 @@ def ceph_osds(ctx, config):
10601060
id_to_remote[int(id_)] = (osd, remote)
10611061

10621062
cur = 0
1063+
raw = config.get('raw-osds', False)
10631064
for osd_id in sorted(id_to_remote.keys()):
1065+
if raw:
1066+
raise ConfigError(
1067+
"raw-osds is only supported without OSD roles"
1068+
)
10641069
osd, remote = id_to_remote[osd_id]
10651070
_, _, id_ = teuthology.split_role(osd)
10661071
assert int(id_) == cur
@@ -1092,9 +1097,10 @@ def ceph_osds(ctx, config):
10921097
cur += 1
10931098

10941099
if cur == 0:
1095-
_shell(ctx, cluster_name, remote, [
1096-
'ceph', 'orch', 'apply', 'osd', '--all-available-devices',
1097-
])
1100+
osd_cmd = ['ceph', 'orch', 'apply', 'osd', '--all-available-devices']
1101+
if raw:
1102+
osd_cmd.extend(['--method', 'raw'])
1103+
_shell(ctx, cluster_name, remote, osd_cmd)
10981104
# expect the number of scratch devs
10991105
num_osds = sum(map(len, devs_by_remote.values()))
11001106
assert num_osds

0 commit comments

Comments
 (0)