]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add --force-start option to adopt
authorTim Serong <tserong@suse.com>
Thu, 16 Apr 2020 05:32:02 +0000 (15:32 +1000)
committerTim Serong <tserong@suse.com>
Thu, 16 Apr 2020 05:32:06 +0000 (15:32 +1000)
Current behaviour is to only start a newly adopted ceph daemon if it was
already running before the adopt.  Adding a --force-start option allows
the adopt command to start newly adopted daemons that weren't originally
running, to save the user having to manually invoke `systemctl start
ceph-$FSID@$DAEMMON.$ID`.

Signed-off-by: Tim Serong <tserong@suse.com>
src/cephadm/cephadm

index 4ba1c5d4daa011d1af19891fe4233194974518cc..b43c3b2d2384cd23d5544232a01969858268ef68 100755 (executable)
@@ -3277,7 +3277,7 @@ def command_adopt_ceph(daemon_type, daemon_id, fsid):
     c = get_container(fsid, daemon_type, daemon_id)
     deploy_daemon_units(fsid, uid, gid, daemon_type, daemon_id, c,
                         enable=True,  # unconditionally enable the new unit
-                        start=(state == 'running'),
+                        start=(state == 'running' or args.force_start),
                         osd_fsid=osd_fsid)
     update_firewalld(daemon_type)
 
@@ -4174,6 +4174,10 @@ def _get_parser():
         '--skip-pull',
         action='store_true',
         help='do not pull the latest image before adopting')
+    parser_adopt.add_argument(
+        '--force-start',
+        action='store_true',
+        help="start newly adoped daemon, even if it wasn't running previously")
 
     parser_rm_daemon = subparsers.add_parser(
         'rm-daemon', help='remove daemon instance')