From cc1506233260d52b4f559c405e913e23f396c1e4 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 5 Mar 2023 14:00:47 -0600 Subject: [PATCH] cluster/ceph: Fix built-in pool creation for Reef. Signed-off-by: Mark Nelson --- cluster/ceph.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cluster/ceph.py b/cluster/ceph.py index fde4b5bb..0003d1b0 100644 --- a/cluster/ceph.py +++ b/cluster/ceph.py @@ -790,13 +790,19 @@ def mkpool(self, name, profile_name, application, base_name=None): if self.prefill_recov_objects > 0: self.recov_pool_name = name + # Add mandatory UI option to create a pool that starts with "." in releases after quincy (Sigh again). + yes_flag = "" + if self.version_compat not in ['argonaut', 'bobcat', 'cuttlefish', 'dumpling', 'emperor', 'firefly', 'giant', 'hammer', 'infernalis', 'jewel', 'kraken', 'luminous', 'mimic', 'nautilus', 'octopus', 'pacific', 'quincy']: + if name.startswith("."): + yes_flag = "--yes-i-really-mean-it" + if replication and replication == 'erasure': - common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool create %s %d %d erasure %s' % (self.ceph_cmd, self.tmp_conf, name, pg_size, pgp_size, erasure_profile), + common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool create %s %d %d erasure %s %s' % (self.ceph_cmd, self.tmp_conf, name, pg_size, pgp_size, erasure_profile, yes_flag), continue_if_error=False).communicate() if ec_overwrites is True: common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool set %s allow_ec_overwrites true' % (self.ceph_cmd, self.tmp_conf, name), continue_if_error=False).communicate() else: - 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), + common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool create %s %d %d %s' % (self.ceph_cmd, self.tmp_conf, name, pg_size, pgp_size, yes_flag), continue_if_error=False).communicate() if self.version_compat not in ['argonaut', 'bobcat', 'cuttlefish', 'dumpling', 'emperor', 'firefly', 'giant', 'hammer', 'infernalis', 'jewel']: common.pdsh(settings.getnodes('head'), 'sudo %s -c %s osd pool application enable %s %s' % (self.ceph_cmd, self.tmp_conf, name, application), continue_if_error=False).communicate()