From 42dd4dd442b68f281d04c603d95e7255bc11d02b Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Thu, 16 Apr 2020 15:32:02 +1000 Subject: [PATCH] cephadm: add --force-start option to adopt 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 (cherry picked from commit 225b25512916ec4a9577ca7f2ab39faaf122827f) --- src/cephadm/cephadm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 678059a444f7d..c16a0c9258021 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3281,7 +3281,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) @@ -4180,6 +4180,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') -- 2.39.5