]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: support crush_tunables config option
authorSage Weil <sage@redhat.com>
Wed, 25 Dec 2019 17:43:09 +0000 (17:43 +0000)
committerSage Weil <sage@redhat.com>
Tue, 14 Jan 2020 01:49:57 +0000 (19:49 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/cephadm.py

index a9ce7ef7e55f50542133b923e8f59d941e9d4a9d..4309a8a5450db04d842f906d97a598860b6a4178 100644 (file)
@@ -825,6 +825,18 @@ def distribute_config_and_admin_keyring(ctx, config):
             '/etc/ceph/{}.client.admin.keyring'.format(cluster_name),
         ])
 
+@contextlib.contextmanager
+def crush_setup(ctx, config):
+    cluster_name = config['cluster']
+    first_mon = teuthology.get_first_mon(ctx, config, cluster_name)
+    (mon_remote,) = ctx.cluster.only(first_mon).remotes.keys()
+
+    profile = config.get('crush_tunables', 'default')
+    log.info('Setting crush tunables to %s', profile)
+    _shell(ctx, cluster_name, ctx.ceph[cluster_name].bootstrap_remote,
+        args=['ceph', 'osd', 'crush', 'tunables', profile])
+    yield
+
 @contextlib.contextmanager
 def task(ctx, config):
     if config is None:
@@ -908,6 +920,7 @@ def task(ctx, config):
             lambda: ceph_log(ctx=ctx, config=config),
             lambda: ceph_crash(ctx=ctx, config=config),
             lambda: ceph_bootstrap(ctx=ctx, config=config),
+            lambda: crush_setup(ctx=ctx, config=config),
             lambda: ceph_mons(ctx=ctx, config=config),
             lambda: ceph_mgrs(ctx=ctx, config=config),
             lambda: ceph_osds(ctx=ctx, config=config),