From accb287302fb7097549870a7390be78569ad88a6 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 10 Nov 2015 08:50:54 -0500 Subject: [PATCH] rbd_fio: removed deprecated command-line option to rbd CLI Fixes: #13745 Signed-off-by: Jason Dillaman --- suites/krbd/rbd/tasks/rbd_fio.yaml | 2 +- suites/krbd/thrash/workloads/rbd_fio.yaml | 2 +- suites/rbd/librbd/workloads/rbd_fio.yaml | 2 +- tasks/rbd_fio.py | 49 ++++++++++++----------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/suites/krbd/rbd/tasks/rbd_fio.yaml b/suites/krbd/rbd/tasks/rbd_fio.yaml index fe5d97f8aa1..75aeecb3963 100644 --- a/suites/krbd/rbd/tasks/rbd_fio.yaml +++ b/suites/krbd/rbd/tasks/rbd_fio.yaml @@ -6,7 +6,7 @@ tasks: fio-version: 2.2.9 fio-io-size: 90% formats: [2] - features: [1, 2] + features: [[layering],[striping]] io-engine: sync rw: randrw runtime: 900 diff --git a/suites/krbd/thrash/workloads/rbd_fio.yaml b/suites/krbd/thrash/workloads/rbd_fio.yaml index dbd5bd10c5e..353e2c448e1 100644 --- a/suites/krbd/thrash/workloads/rbd_fio.yaml +++ b/suites/krbd/thrash/workloads/rbd_fio.yaml @@ -4,7 +4,7 @@ tasks: fio-version: 2.2.9 fio-io-size: 90% formats: [2] - features: [1, 2] + features: [[layering],[striping]] io-engine: sync rw: randrw runtime: 1200 diff --git a/suites/rbd/librbd/workloads/rbd_fio.yaml b/suites/rbd/librbd/workloads/rbd_fio.yaml index b10bab277a2..2f9c06fada1 100644 --- a/suites/rbd/librbd/workloads/rbd_fio.yaml +++ b/suites/rbd/librbd/workloads/rbd_fio.yaml @@ -4,7 +4,7 @@ tasks: fio-version: 2.2.9 fio-io-size: 80% formats: [2] - features: [1,13] + features: [[layering],[layering,exclusive-lock,object-map]] io-engine: rbd test-clone-io: 1 rw: randrw diff --git a/tasks/rbd_fio.py b/tasks/rbd_fio.py index 75a32c98d26..90bfe05f06b 100644 --- a/tasks/rbd_fio.py +++ b/tasks/rbd_fio.py @@ -3,7 +3,7 @@ Many fio parameters can be configured so that this task can be used along with thrash/power-cut tests and exercise IO on full disk for all format/features - This test should not be run on VM due to heavy use of resource - + """ import contextlib import logging @@ -24,7 +24,7 @@ def task(ctx, config): fio-io-size: 100g or 80% or 100m fio-version: 2.2.9 formats: [2] - features: [1, 2, 13] + features: [[layering],[striping],[layering,exclusive-lock,object-map]] test-clone-io: 1 #remove this option to not run create rbd clone and not run io on clone io-engine: "sync or rbd or any io-engine" rw: randrw @@ -32,37 +32,37 @@ def task(ctx, config): fio-io-size: 100g fio-version: 2.2.9 rw: read - image-size:20480 + image-size:20480 or all: fio-io-size: 400g rw: randrw formats: [2] - features: [1,2] + features: [[layering],[striping]] io-engine: libaio - + Create rbd image + device and exercise IO for format/features provided in config file Config can be per client or one config can be used for all clients, fio jobs are run in parallel for client provided - + """ if config.get('all'): - client_config = config['all'] + client_config = config['all'] clients = ctx.cluster.only(teuthology.is_type('client')) rbd_test_dir = teuthology.get_testdir(ctx) + "/rbd_fio_test" for remote,role in clients.remotes.iteritems(): if 'client_config' in locals(): - with parallel() as p: + with parallel() as p: p.spawn(run_fio, remote, client_config, rbd_test_dir) - else: + else: for client_config in config: if client_config in role: with parallel() as p: p.spawn(run_fio, remote, config[client_config], rbd_test_dir) - + yield - - + + def run_fio(remote, config, rbd_test_dir): """ create fio config file with options based on above config @@ -87,20 +87,20 @@ def run_fio(remote, config, rbd_test_dir): fio_config.write('size={size}\n'.format(size=size)) else: fio_config.write('size=100m\n') - + fio_config.write('time_based\n') if config.get('runtime'): runtime=config['runtime'] fio_config.write('runtime={runtime}\n'.format(runtime=runtime)) else: fio_config.write('runtime=1800\n') - fio_config.write('allow_file_create=0\n') - image_size=10240 + fio_config.write('allow_file_create=0\n') + image_size=10240 if config.get('image_size'): image_size=config['image_size'] - + formats=[1,2] - features=[1,2,4] + features=[['layering'],['striping'],['exclusive-lock','object-map']] fio_version='2.2.9' if config.get('formats'): formats=config['formats'] @@ -108,7 +108,7 @@ def run_fio(remote, config, rbd_test_dir): features=config['features'] if config.get('fio-version'): fio_version=config['fio-version'] - + fio_config.write('norandommap\n') if ioengine == 'rbd': fio_config.write('invalidate=0\n') @@ -130,11 +130,12 @@ def run_fio(remote, config, rbd_test_dir): rbd_name = 'i{i}f{f}{sn}'.format(i=frmt,f=feature,sn=sn) rbd_snap_name = 'i{i}f{f}{sn}@i{i}f{f}{sn}Snap'.format(i=frmt,f=feature,sn=sn) rbd_clone_name = 'i{i}f{f}{sn}Clone'.format(i=frmt,f=feature,sn=sn) - remote.run(args=['sudo', 'rbd', 'create', - '--image', rbd_name, - '--image-format', '{f}'.format(f=frmt), - '--image-features', '{f}'.format(f=feature), - '--size', '{size}'.format(size=image_size)]) + create_args=['sudo', 'rbd', 'create', + '--size', '{size}'.format(size=image_size), + '--image', rbd_name, + '--image-format', '{f}'.format(f=frmt)] + map(lambda x: create_args.extend(['--image-feature', x]), feature) + remote.run(args=create_args) remote.run(args=['sudo', 'rbd', 'info', rbd_name]) if ioengine != 'rbd': out=StringIO.StringIO() @@ -178,7 +179,7 @@ def run_fio(remote, config, rbd_test_dir): fio_config.write('rw={rw}\n'.format(rw=rw)) fio_config.write('rbdname={clone_img_name}\n'.format(clone_img_name=rbd_clone_name)) - + fio_config.close() remote.put_file(fio_config.name,fio_config.name) try: