From 6afa31d1f9ec62535a8a605dcf9c37de73ccf40a Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Thu, 23 Apr 2020 16:27:46 +1000 Subject: [PATCH] cephadm: Add `chown` to unit.run for adoped simple OSDs We're not using `ceph-volume simple activate` anymore, so need to add `chown ceph:ceph` for each of block, block.db and block.wal to ensure old-style simple OSDs are able to start. Fixes: https://tracker.ceph.com/issues/45129 Signed-off-by: Tim Serong --- src/cephadm/cephadm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index dfce8eb26d2..33b05c584c1 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1786,6 +1786,11 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c, if daemon_type == 'osd': # osds have a pre-start step assert osd_fsid + f.write('# Simple OSDs need chown on startup:\n') + for n in ['block', 'block.db', 'block.wal']: + p = os.path.join(data_dir, n) + f.write('[ ! -L {p} ] || chown {uid}:{gid} {p}\n'.format(p=p, uid=uid, gid=gid)) + f.write('# LVM OSDs use ceph-volume lvm activate:\n') prestart = CephContainer( image=args.image, entrypoint='/usr/sbin/ceph-volume', -- 2.47.3