]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: support for storage classes
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 10 Jan 2019 01:16:15 +0000 (17:16 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 11 Jan 2019 16:43:41 +0000 (08:43 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
qa/suites/rgw/multifs/overrides.yaml
qa/suites/rgw/verify/overrides.yaml
qa/tasks/rgw.py

index 161e1e378da7475aea013479ef4f7f734620c28f..339784d3ce5cd56fc72d621aaa9b8216e2accb32 100644 (file)
@@ -6,3 +6,5 @@ overrides:
         debug rgw: 20
         rgw crypt s3 kms encryption keys: testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo=
         rgw crypt require ssl: false
+  rgw:
+    storage classes: LUKEWARM, FROZEN
index ed3dec8e2dfb0879842890d53b8dee11d1abd49b..8b0b5cff0a35918dbfb9acbc2fb8e4225f5d6990 100644 (file)
@@ -7,3 +7,4 @@ overrides:
         rgw crypt require ssl: false
   rgw:
     compression type: random
+    storage classes: LUKEWARM, FROZEN
index 42941512f79229044aaaa633d84355a84cbbaf3f..babfa5d5bc97432080a63d750086f3322e7e6a2e 100644 (file)
@@ -228,6 +228,34 @@ def configure_compression(ctx, clients, compression):
                 check_status=True)
     yield
 
+@contextlib.contextmanager
+def configure_storage_classes(ctx, clients, storage_classes):
+    """ set a compression type in the default zone placement """
+
+    sc = [s.strip() for s in storage_classes.split(',')]
+
+    for client in clients:
+        # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
+        # issue a 'radosgw-admin user list' command to trigger this
+        rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
+
+        for storage_class in sc:
+            log.info('Configuring storage class type = %s', storage_class)
+            rgwadmin(ctx, client,
+                    cmd=['zonegroup', 'placement', 'add',
+                        '--rgw-zone', 'default',
+                        '--placement-id', 'default-placement',
+                        '--storage-class', storage_class],
+                    check_status=True)
+            rgwadmin(ctx, client,
+                    cmd=['zone', 'placement', 'add',
+                        '--rgw-zone', 'default',
+                        '--placement-id', 'default-placement',
+                        '--storage-class', storage_class,
+                        '--data-pool', 'default.rgw.buckets.data.' + storage_class.lower()],
+                    check_status=True)
+    yield
+
 @contextlib.contextmanager
 def task(ctx, config):
     """
@@ -287,6 +315,7 @@ def task(ctx, config):
     ctx.rgw.cache_pools = bool(config.pop('cache-pools', False))
     ctx.rgw.frontend = config.pop('frontend', 'civetweb')
     ctx.rgw.compression_type = config.pop('compression type', None)
+    ctx.rgw.storage_classes = config.pop('storage classes', None)
     default_cert = config.pop('ssl certificate', None)
     ctx.rgw.data_pool_pg_size = config.pop('data_pool_pg_size', 64)
     ctx.rgw.index_pool_pg_size = config.pop('index_pool_pg_size', 64)
@@ -305,6 +334,11 @@ def task(ctx, config):
             lambda: configure_compression(ctx=ctx, clients=clients,
                                           compression=ctx.rgw.compression_type),
         ])
+    if ctx.rgw.storage_classes:
+        subtasks.extend([
+            lambda: configure_storage_classes(ctx=ctx, clients=clients,
+                                              storage_classes=ctx.rgw.storage_classes),
+        ])
     subtasks.extend([
         lambda: start_rgw(ctx=ctx, config=config, clients=clients),
     ])