gateway_config = self.config.get('gateway_config', {})
self.cli_image = gateway_config.get('cli_image', 'quay.io/ceph/nvmeof-cli:latest')
+ self.groups_count = gateway_config.get('groups_count', 1)
+ self.groups_prefix = gateway_config.get('groups_prefix', 'mygroup')
self.nqn_prefix = gateway_config.get('subsystem_nqn_prefix', 'nqn.2016-06.io.spdk:cnode')
self.subsystems_count = gateway_config.get('subsystems_count', 1)
self.namespaces_count = gateway_config.get('namespaces_count', 1) # namepsaces per subsystem
'rbd', 'pool', 'init', poolname
])
- log.info(f'[nvmeof]: ceph orch apply nvmeof {poolname}')
- _shell(self.ctx, self.cluster_name, self.remote, [
- 'ceph', 'orch', 'apply', 'nvmeof', poolname,
- '--placement', str(len(nodes)) + ';' + ';'.join(nodes)
- ])
+ group_to_nodes = defaultdict(list)
+ for index, node in enumerate(nodes):
+ group_name = self.groups_prefix + str(index % int(self.groups_count))
+ group_to_nodes[group_name] += [node]
+ for group_name in group_to_nodes:
+ gp_nodes = group_to_nodes[group_name]
+ log.info(f'[nvmeof]: ceph orch apply nvmeof {poolname} {group_name}')
+ _shell(self.ctx, self.cluster_name, self.remote, [
+ 'ceph', 'orch', 'apply', 'nvmeof', poolname, group_name,
+ '--placement', ';'.join(gp_nodes)
+ ])
total_images = int(self.namespaces_count) * int(self.subsystems_count)
log.info(f'[nvmeof]: creating {total_images} images')