]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: set crush tunables
authorSage Weil <sage@redhat.com>
Mon, 19 Jan 2015 15:58:39 +0000 (07:58 -0800)
committerSage Weil <sage@redhat.com>
Mon, 26 Jan 2015 21:42:56 +0000 (13:42 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
tasks/ceph.py

index 0a10822676b0ac615626028ebd26746cdf985a9e..5fd8e644563357d02f7e286e3f5acf368a283104 100644 (file)
@@ -145,6 +145,16 @@ def valgrind_post(ctx, config):
         if valgrind_exception is not None:
             raise valgrind_exception
 
+@contextlib.contextmanager
+def crush_setup(ctx, config):
+    first_mon = teuthology.get_first_mon(ctx, config)
+    (mon_remote,) = ctx.cluster.only(first_mon).remotes.iterkeys()
+
+    profile = config.get('crush_tunables', 'default')
+    log.info('Setting crush tunables to %s', profile)
+    mon_remote.run(
+        args=['sudo', 'ceph', 'osd', 'crush', 'tunables', profile])
+    yield
 
 @contextlib.contextmanager
 def cephfs_setup(ctx, config):
@@ -1231,6 +1241,7 @@ def task(ctx, config):
                 cpu_profile=set(config.get('cpu_profile', [])),
                 )),
         lambda: run_daemon(ctx=ctx, config=config, type_='mon'),
+        lambda: crush_setup(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='osd'),
         lambda: cephfs_setup(ctx=ctx, config=config),
         lambda: run_daemon(ctx=ctx, config=config, type_='mds'),