]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Show warning when user provides --fsid option 45534/head
authorRedouane Kachach <rkachach@redhat.com>
Fri, 11 Mar 2022 11:41:18 +0000 (12:41 +0100)
committerRedouane Kachach <rkachach@redhat.com>
Wed, 23 Mar 2022 12:10:18 +0000 (13:10 +0100)
Fixes: https://tracker.ceph.com/issues/50804
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/cephadm/cephadm

index 51b1f986bec0521b6575187ff2c83243358ed84f..97ba747a0541c275e97e8b29d2a4b57ec9a1d91a 100755 (executable)
@@ -5015,6 +5015,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]: