]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Show warning when user provides --fsid option
authorRedouane Kachach <rkachach@redhat.com>
Fri, 11 Mar 2022 11:41:18 +0000 (12:41 +0100)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:33 +0000 (20:48 -0400)
Fixes: https://tracker.ceph.com/issues/50804
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 8780aa04651fa2cddeec1d9d2dfcf4e08412d4ce)

src/cephadm/cephadm

index 161750bf98165e02af55fabf5bcc7472611f41da..b52dfc588332d82fe915066f9c3096ba4a9fa2af 100755 (executable)
@@ -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]: