]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: Add `chown` to unit.run for adoped simple OSDs
authorTim Serong <tserong@suse.com>
Thu, 23 Apr 2020 06:27:46 +0000 (16:27 +1000)
committerTim Serong <tserong@suse.com>
Tue, 28 Apr 2020 03:36:08 +0000 (13:36 +1000)
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 <tserong@suse.com>
src/cephadm/cephadm

index dfce8eb26d24488ee8357ba056e79ccd41949433..33b05c584c1544a36dbf1b8059ad7c7e71adc0be 100755 (executable)
@@ -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',