From c5da7b21f74cebc457cb2a546d7db9a3d9ee2bee Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 1 May 2014 14:36:08 -0700 Subject: [PATCH] rgw: option to create a cache pool 64mb for now! Signed-off-by: Sage Weil Reviewed-by: Josh Durgin --- teuthology/task/rgw.py | 10 +++++++++- teuthology/task_util/rados.py | 9 +++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/teuthology/task/rgw.py b/teuthology/task/rgw.py index 6f6064cdd..3cea9e50f 100644 --- a/teuthology/task/rgw.py +++ b/teuthology/task/rgw.py @@ -14,7 +14,8 @@ from teuthology import misc as teuthology from teuthology import contextutil from teuthology.task_util.rgw import rgwadmin from teuthology.task_util.rados import (rados, create_ec_pool, - create_replicated_pool) + create_replicated_pool, + create_cache_pool) log = logging.getLogger(__name__) @@ -508,6 +509,9 @@ def create_nonregion_pools(ctx, config, regions): create_ec_pool(remote, data_pool, client, 64) else: create_replicated_pool(remote, data_pool, 64) + if ctx.rgw.cache_pools: + create_cache_pool(remote, data_pool, data_pool + '.cache', 64, + 64*1024*1024) yield @@ -757,6 +761,10 @@ def task(ctx, config): if 'ec-data-pool' in config: ctx.rgw.ec_data_pool = bool(config['ec-data-pool']) del config['ec-data-pool'] + ctx.rgw.cache_pools = False + if 'cache-pools' in config: + ctx.rgw.cache_pools = bool(config['cache-pools']) + del config['cache-pools'] ctx.rgw.frontend = 'apache' if 'frontend' in config: diff --git a/teuthology/task_util/rados.py b/teuthology/task_util/rados.py index 12aa667a6..f6a806c95 100644 --- a/teuthology/task_util/rados.py +++ b/teuthology/task_util/rados.py @@ -39,3 +39,12 @@ def create_replicated_pool(remote, name, pgnum): remote.run(args=[ 'ceph', 'osd', 'pool', 'create', name, str(pgnum), str(pgnum), ]) + +def create_cache_pool(remote, base_name, cache_name, pgnum, size): + remote.run(args=[ + 'ceph', 'osd', 'pool', 'create', cache_name, str(pgnum) + ]) + remote.run(args=[ + 'ceph', 'osd', 'tier', 'add-cache', base_name, cache_name, + str(size), + ]) -- 2.47.3