]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
rgw: option to create a cache pool
authorSage Weil <sage@inktank.com>
Thu, 1 May 2014 21:36:08 +0000 (14:36 -0700)
committerSage Weil <sage@inktank.com>
Thu, 1 May 2014 21:36:26 +0000 (14:36 -0700)
64mb for now!

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
teuthology/task/rgw.py
teuthology/task_util/rados.py

index 6f6064cdd90baacf227f5eabfbd9a829226936c4..3cea9e50f78d8993ab3f7c12b17d18bcbcc08e57 100644 (file)
@@ -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:
index 12aa667a62b2081b2546f592848fd7463e8b633d..f6a806c95db2cf74f74026b2984b6ebbb989a09b 100644 (file)
@@ -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),
+            ])