From 079512f4e37e365a5d415105a944eddc518eaa4d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 5 Mar 2023 14:56:07 -0600 Subject: [PATCH] cluster/ceph: Add support for transparent pools. Signed-off-by: Mark Nelson --- cluster/ceph.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cluster/ceph.py b/cluster/ceph.py index 46bdbc35..dabb2ca2 100644 --- a/cluster/ceph.py +++ b/cluster/ceph.py @@ -754,6 +754,7 @@ def mkpool(self, name, profile_name, application, base_name=None): replication = str(profile.get('replication', None)) ec_overwrites = profile.get('ec_overwrites', False) cache_profile = profile.get('cache_profile', None) + transparent = profile.get('transparent', False) # Options for cache tiering crush_profile = profile.get('crush_profile', None) @@ -778,13 +779,17 @@ def mkpool(self, name, profile_name, application, base_name=None): if self.prefill_recov_objects > 0: self.recov_pool_name = name + transparent_str = '' + if (transparent): + transparent_str = 'transparent' + 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, transparent_str), 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, transparent_str), 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()