mirror of
https://github.com/ceph/ceph
synced 2024-12-26 13:33:57 +00:00
c5da7b21f7
64mb for now! Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
51 lines
1.4 KiB
Python
51 lines
1.4 KiB
Python
import logging
|
|
|
|
from teuthology import misc as teuthology
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
def rados(ctx, remote, cmd, wait=True, check_status=False):
|
|
testdir = teuthology.get_testdir(ctx)
|
|
log.info("rados %s" % ' '.join(cmd))
|
|
pre = [
|
|
'adjust-ulimits',
|
|
'ceph-coverage',
|
|
'{tdir}/archive/coverage'.format(tdir=testdir),
|
|
'rados',
|
|
];
|
|
pre.extend(cmd)
|
|
proc = remote.run(
|
|
args=pre,
|
|
check_status=check_status,
|
|
wait=wait,
|
|
)
|
|
if wait:
|
|
return proc.exitstatus
|
|
else:
|
|
return proc
|
|
|
|
def create_ec_pool(remote, name, profile_name, pgnum, m=1, k=2):
|
|
remote.run(args=[
|
|
'ceph', 'osd', 'erasure-code-profile', 'set',
|
|
profile_name, 'm=' + str(m), 'k=' + str(k),
|
|
'ruleset-failure-domain=osd',
|
|
])
|
|
remote.run(args=[
|
|
'ceph', 'osd', 'pool', 'create', name,
|
|
str(pgnum), str(pgnum), 'erasure', profile_name,
|
|
])
|
|
|
|
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),
|
|
])
|