]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: sensible default for block.db
authorLoic Dachary <ldachary@redhat.com>
Thu, 8 Jun 2017 13:52:52 +0000 (15:52 +0200)
committerLoic Dachary <ldachary@redhat.com>
Fri, 9 Jun 2017 18:50:54 +0000 (20:50 +0200)
If bluestore_block_db_size is unset or zero, fallback to a sensible
default which is block_size / 100. With a minimum of 1GB.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index 9f24655135b86f7ea67f57fc9a2f4dc81fbf6151..de036cd0320137438275923d760962ff874cb795 100755 (executable)
@@ -2407,15 +2407,22 @@ class PrepareBluestoreBlockDB(PrepareSpace):
         super(PrepareBluestoreBlockDB, self).__init__(args)
 
     def get_space_size(self):
-        block_size = get_conf(
+        block_db_size = get_conf(
             cluster=self.args.cluster,
             variable='bluestore_block_db_size',
         )
 
-        if block_size is None:
-            return 20480  # MB, default value
+        if block_db_size is None or int(block_db_size) == 0:
+            block_size = get_conf(
+                cluster=self.args.cluster,
+                variable='bluestore_block_size',
+            )
+            if block_size is None:
+                return 1024  # MB
+            size = int(block_size) / 100 / 1048576
+            return max(size, 1024)  # MB
         else:
-            return int(block_size) / 1048576  # MB
+            return int(block_db_size) / 1048576  # MB
 
     def desired_partition_number(self):
         if getattr(self.args, 'block.db') == self.args.data: