From 35bcae8caf185d9ce814a338604443cda5a6c25b Mon Sep 17 00:00:00 2001 From: Redouane Kachach Date: Fri, 11 Mar 2022 12:41:18 +0100 Subject: [PATCH] mgr/cephadm: Show warning when user provides --fsid option Fixes: https://tracker.ceph.com/issues/50804 Signed-off-by: Redouane Kachach (cherry picked from commit 8780aa04651fa2cddeec1d9d2dfcf4e08412d4ce) --- src/cephadm/cephadm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 161750bf98165..b52dfc588332d 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -4977,6 +4977,13 @@ def command_bootstrap(ctx): if not ctx.output_pub_ssh_key: ctx.output_pub_ssh_key = os.path.join(ctx.output_dir, 'ceph.pub') + if ctx.fsid: + data_dir_base = os.path.join(ctx.data_dir, ctx.fsid) + if os.path.exists(data_dir_base): + raise Error(f"A cluster with the same fsid '{ctx.fsid}' already exists.") + else: + logger.warning('Specifying an fsid for your cluster offers no advantages and may increase the likelihood of fsid conflicts.') + # verify output files for f in [ctx.output_config, ctx.output_keyring, ctx.output_pub_ssh_key]: -- 2.39.5