From: Ramana Raja Date: Thu, 5 Nov 2020 16:50:58 +0000 (+0530) Subject: qa/tasks: allow per file system config setting X-Git-Tag: v16.1.0~404^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7016a2001d3ba780a075b01061639d08e0c88faa;p=ceph.git qa/tasks: allow per file system config setting Signed-off-by: Ramana Raja --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 50173b4bb8e0..423e4717f6b2 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -3,6 +3,7 @@ Ceph cluster task. Handle the setup, starting, and clean-up of a Ceph cluster. """ +from copy import deepcopy from io import BytesIO from io import StringIO @@ -391,10 +392,20 @@ def cephfs_setup(ctx, config): # If there are any MDSs, then create a filesystem for them to use # Do this last because requires mon cluster to be up and running if mdss.remotes: - log.info('Setting up CephFS filesystem...') - - Filesystem(ctx, fs_config=config.get('cephfs', None), name='cephfs', - create=True, ec_profile=config.get('cephfs_ec_profile', None)) + log.info('Setting up CephFS filesystem(s)...') + cephfs_config = config.get('cephfs', {}) + fs_configs = cephfs_config.pop('fs', [{'name': 'cephfs'}]) + set_allow_multifs = len(fs_configs) > 1 + + for fs_config in fs_configs: + assert isinstance(fs_config, dict) + name = fs_config.pop('name') + temp = deepcopy(cephfs_config) + teuthology.deep_merge(temp, fs_config) + fs = Filesystem(ctx, fs_config=temp, name=name, create=True) + if set_allow_multifs: + fs.set_allow_multifs() + set_allow_multifs = False yield @@ -1678,6 +1689,20 @@ def task(ctx, config): cephfs: max_mds: 2 + To change the max_mds of a specific filesystem, use:: + + tasks: + - ceph: + cephfs: + max_mds: 2 + fs: + - name: a + max_mds: 3 + - name: b + + In the above example, filesystem 'a' will have 'max_mds' 3, + and filesystme 'b' will have 'max_mds' 2. + To change the mdsmap's default session_timeout (60 seconds), use:: tasks: diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 4fbf5743e757..9705dbe3cf7d 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -452,18 +452,17 @@ class Filesystem(MDSCluster): This object is for driving a CephFS filesystem. The MDS daemons driven by MDSCluster may be shared with other Filesystems. """ - def __init__(self, ctx, fs_config=None, fscid=None, name=None, create=False, - ec_profile=None): + def __init__(self, ctx, fs_config={}, fscid=None, name=None, create=False): super(Filesystem, self).__init__(ctx) self.name = name - self.ec_profile = ec_profile self.id = None self.metadata_pool_name = None self.metadata_overlay = False self.data_pool_name = None self.data_pools = None self.fs_config = fs_config + self.ec_profile = fs_config.get('cephfs_ec_profile') client_list = list(misc.all_roles_of_type(self._ctx.cluster, 'client')) self.client_id = client_list[0] diff --git a/qa/tasks/mds_thrash.py b/qa/tasks/mds_thrash.py index ebd9e81a30ab..44dceae22879 100644 --- a/qa/tasks/mds_thrash.py +++ b/qa/tasks/mds_thrash.py @@ -416,7 +416,7 @@ def task(ctx, config): config['cluster'] = 'ceph' for fs in status.get_filesystems(): - thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fs['id']), fs['mdsmap']['max_mds']) + thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fscid=fs['id']), fs['mdsmap']['max_mds']) thrasher.start() ctx.ceph[config['cluster']].thrashers.append(thrasher) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 86a5a89f3f8b..7e8529879dc2 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -1165,18 +1165,18 @@ class LocalMgrCluster(LocalCephCluster, MgrCluster): class LocalFilesystem(Filesystem, LocalMDSCluster): - def __init__(self, ctx, fscid=None, name=None, create=False, ec_profile=None): + def __init__(self, ctx, fs_config={}, fscid=None, name=None, create=False): # Deliberately skip calling parent constructor self._ctx = ctx self.id = None self.name = name - self.ec_profile = ec_profile self.metadata_pool_name = None self.metadata_overlay = False self.data_pool_name = None self.data_pools = None - self.fs_config = None + self.fs_config = fs_config + self.ec_profile = fs_config.get('cephfs_ec_profile') # Hack: cheeky inspection of ceph.conf to see what MDSs exist self.mds_ids = set()