]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: properly remove `osd-activate` container
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 28 Aug 2020 09:58:12 +0000 (11:58 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 10 Sep 2020 09:00:52 +0000 (11:00 +0200)
Othwerise we end up with being unable to create
new containers, due to the name being already used

Fixes: https://tracker.ceph.com/issues/47170
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit bff74b01803bddd082cd9b4641a2d7fcbf080ef2)

src/cephadm/cephadm

index 3f67f09cf407cb4dd2513a171a4379e5954572a4..4fc48d072f54b26f748c5f126e5a8bb7a33b49a8 100755 (executable)
@@ -1986,7 +1986,6 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c,
                     p = os.path.join(data_dir, n)
                     f.write('[ ! -L {p} ] || chown {uid}:{gid} {p}\n'.format(p=p, uid=uid, gid=gid))
             else:
-                f.write('# LVM OSDs use ceph-volume lvm activate:\n')
                 prestart = CephContainer(
                     image=args.image,
                     entrypoint='/usr/sbin/ceph-volume',
@@ -2000,12 +1999,12 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c,
                     bind_mounts=get_container_binds(fsid, daemon_type, daemon_id),
                     cname='ceph-%s-%s.%s-activate' % (fsid, daemon_type, daemon_id),
                 )
-                f.write(' '.join(prestart.run_cmd()) + '\n')
+                _write_container_cmd_to_bash(f, prestart, 'LVM OSDs use ceph-volume lvm activate')
         elif daemon_type == NFSGanesha.daemon_type:
             # add nfs to the rados grace db
             nfs_ganesha = NFSGanesha.init(fsid, daemon_id)
             prestart = nfs_ganesha.get_rados_grace_container('add')
-            f.write(' '.join(prestart.run_cmd()) + '\n')
+            _write_container_cmd_to_bash(f, prestart)
         elif daemon_type == CephIscsi.daemon_type:
             f.write(' '.join(CephIscsi.configfs_mount_umount(data_dir, mount=True)) + '\n')
             ceph_iscsi = CephIscsi.init(fsid, daemon_id)
@@ -2038,12 +2037,12 @@ def deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c,
                 cname='ceph-%s-%s.%s-deactivate' % (fsid, daemon_type,
                                                     daemon_id),
             )
-            f.write(' '.join(poststop.run_cmd()) + '\n')
+            _write_container_cmd_to_bash(f, poststop)
         elif daemon_type == NFSGanesha.daemon_type:
             # remove nfs from the rados grace db
             nfs_ganesha = NFSGanesha.init(fsid, daemon_id)
             poststop = nfs_ganesha.get_rados_grace_container('remove')
-            f.write(' '.join(poststop.run_cmd()) + '\n')
+            _write_container_cmd_to_bash(f, poststop)
         elif daemon_type == CephIscsi.daemon_type:
             # make sure we also stop the tcmu container
             ceph_iscsi = CephIscsi.init(fsid, daemon_id)