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__)
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
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:
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),
+ ])