From b105a07ac66cb9e00d2be4b2e4d3262ae4f3f36c Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 6 May 2014 08:45:22 +0400 Subject: [PATCH] rbd_fsx: expose krbd and related fsx options Expose -K (enable krbd mode) through 'krbd', -Z (use direct IO) through 'direct_io', -U (disable randomized striping) through 'randomized_striping', -H (disable discard ops) through 'punch_holes', -r readbdy (read alignment) through 'readbdy', -w writebdy (write alignment) through 'writebdy', -h holebdy (discard alignment) through 'holebdy'. Signed-off-by: Ilya Dryomov --- teuthology/task/rbd_fsx.py | 54 +++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/teuthology/task/rbd_fsx.py b/teuthology/task/rbd_fsx.py index 6d55b5cf45..d848a88c56 100644 --- a/teuthology/task/rbd_fsx.py +++ b/teuthology/task/rbd_fsx.py @@ -42,23 +42,41 @@ def task(ctx, config): def _run_one_client(ctx, config, role): """Spawned task that runs the client""" + krbd = config.get('krbd', False) testdir = teuthology.get_testdir(ctx) (remote,) = ctx.cluster.only(role).remotes.iterkeys() - remote.run( - args=[ - 'adjust-ulimits', - 'ceph-coverage', - '{tdir}/archive/coverage'.format(tdir=testdir), - 'ceph_test_librbd_fsx', - '-d', - '-W', '-R', # mmap doesn't work with rbd - '-p', str(config.get('progress_interval', 100)), # show progress - '-P', '{tdir}/archive'.format(tdir=testdir), - '-t', str(config.get('truncbdy',1)), - '-l', str(config.get('size', 250000000)), - '-S', str(config.get('seed', 0)), - '-N', str(config.get('ops', 1000)), - 'pool_{pool}'.format(pool=role), - 'image_{image}'.format(image=role), - ], - ) + + args = [] + if krbd: + args.append('sudo') # rbd map/unmap need privileges + args.extend([ + 'adjust-ulimits', + 'ceph-coverage', + '{tdir}/archive/coverage'.format(tdir=testdir), + 'ceph_test_librbd_fsx', + '-d', # debug output for all operations + '-W', '-R', # mmap doesn't work with rbd + '-p', str(config.get('progress_interval', 100)), # show progress + '-P', '{tdir}/archive'.format(tdir=testdir), + '-r', str(config.get('readbdy',1)), + '-w', str(config.get('writebdy',1)), + '-t', str(config.get('truncbdy',1)), + '-h', str(config.get('holebdy',1)), + '-l', str(config.get('size', 250000000)), + '-S', str(config.get('seed', 0)), + '-N', str(config.get('ops', 1000)), + ]) + if krbd: + args.append('-K') # -K enables krbd mode + if config.get('direct_io', False): + args.append('-Z') # -Z use direct IO + if not config.get('randomized_striping', True): + args.append('-U') # -U disables randomized striping + if not config.get('punch_holes', True): + args.append('-H') # -H disables discard ops + args.extend([ + 'pool_{pool}'.format(pool=role), + 'image_{image}'.format(image=role), + ]) + + remote.run(args=args) -- 2.39.5