From a1ffe15f8734a1720793a92cb673de9e8e5c80d4 Mon Sep 17 00:00:00 2001 From: Ben England Date: Wed, 13 Jan 2016 13:20:20 -0500 Subject: [PATCH] set pool replication size before checking health Closes #77 --- cluster/ceph.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cluster/ceph.py b/cluster/ceph.py index 81343a4b..527015b5 100644 --- a/cluster/ceph.py +++ b/cluster/ceph.py @@ -491,9 +491,12 @@ def mkpool(self, name, profile_name, base_name=None): common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool create %s %d %d' % (self.ceph_cmd, self.tmp_conf, name, pg_size, pgp_size)).communicate() if replication and replication.isdigit(): + pool_repl_size = int(replication) common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool set %s size %s' % (self.ceph_cmd, self.tmp_conf, name, replication)).communicate() - logger.info('Checking Health after setting pool replication level.') - self.check_health() + common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool set %s min_size %d' % (self.ceph_cmd, self.tmp_conf, name, pool_repl_size-1)).communicate() + + logger.info('Checking Healh after pool creation.') + self.check_health() if prefill_objects > 0 or prefill_time > 0: logger.info('prefilling %s %sbyte objects into pool %s' % (prefill_objects, prefill_object_size, name))