From: Sage Weil Date: Tue, 3 Dec 2019 16:38:28 +0000 (-0600) Subject: Merge PR #31890 into master X-Git-Tag: v15.1.0~685 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4f29870543f5deeab3862b377aa7a9c845728746;p=ceph.git Merge PR #31890 into master * refs/pull/31890/head: mgr/orchestrator: name rgw by client.rgw.$realm.$zone[.$id] Reviewed-by: Ali Maredia --- 4f29870543f5deeab3862b377aa7a9c845728746 diff --cc .githubmap index c2b6c776551b,21e4cd3144cf..0944c6e319f3 --- a/.githubmap +++ b/.githubmap @@@ -108,5 -108,3 +108,6 @@@ mgfritch Michael Fritch toabctl Thomas Bechtold dsavineau Dimitri Savineau +jschmid1 Joshua Schmid +bk201 Kiefer Chang ++alimaredia Ali Maredia diff --cc src/pybind/mgr/ssh/module.py index 7676eb1a6267,a86649d4f9e4..0c2048fabd52 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@@ -1268,30 -1169,34 +1268,36 @@@ class SSHOrchestrator(MgrModule, orches 'prefix': 'config set', 'who': 'client.rgw.' + spec.name, 'name': 'rgw_zone', - 'value': spec.name, + 'value': spec.rgw_zone, + }) + ret, out, err = self.mon_command({ + 'prefix': 'config set', + 'who': 'client.rgw.' + spec.rgw_realm, + 'name': 'rgw_realm', + 'value': spec.rgw_realm, }) - daemons = self._get_services('rgw') - results = [] - num_added = 0 - for host, _, name in spec.placement.nodes: - if num_added >= spec.count: - break - rgw_id = self.get_unique_name(daemons, spec.name, name) - self.log.debug('placing rgw.%s on host %s' % (rgw_id, host)) - results.append( - self._worker_pool.apply_async(self._create_rgw, (rgw_id, host)) - ) - # add to daemon list so next name(s) will also be unique - sd = orchestrator.ServiceDescription() - sd.service_instance = rgw_id - sd.service_type = 'rgw' - sd.nodename = host - daemons.append(sd) - num_added += 1 - return SSHWriteCompletion(results) + def _add_rgw(daemons): + args = [] + num_added = 0 + for host, _, name in spec.placement.nodes: + if num_added >= spec.count: + break + rgw_id = self.get_unique_name(daemons, spec.name, name) + self.log.debug('placing rgw.%s on host %s' % (rgw_id, host)) + args.append((rgw_id, host)) + # add to daemon list so next name(s) will also be unique + sd = orchestrator.ServiceDescription() + sd.service_instance = rgw_id + sd.service_type = 'rgw' + sd.nodename = host + daemons.append(sd) + num_added += 1 + return self._create_rgw(args) + + return self._get_services('rgw').then(_add_rgw) + + @async_map_completion def _create_rgw(self, rgw_id, host): ret, keyring, err = self.mon_command({ 'prefix': 'auth get-or-create',