From: Sage Weil Date: Thu, 12 Mar 2020 03:39:32 +0000 (-0500) Subject: Merge PR #33817 into octopus X-Git-Tag: v15.1.1~33 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ed7682fb45b16a4d79454505cf360d512036b9f3;p=ceph-ci.git Merge PR #33817 into octopus * refs/pull/33817/head: mgr/dashboard: Adapt tests to new DriveGroupSpec fixup mgr/test_orchestrator: validate drive group matches anything. mgr/orch: CLI: No Tracebacks for ServiceSpecValidationError mgr/test_orchestrator: validate drive group matches anything. python-common: don't run flake8 on tests. python-common: Add support for legacy serialization format for Drive Groups doc: Move Move ServiceSpec to python-common python-common: Add `host_pattern` to `PlacementSpec.from_string()` cephadm: add host_pattern to supported scheduling python-common: Joined ServiceSpec and DriveGroupSpec from_json() python-common: Make DriveGroupSpec a sub type of ServiceSpec pybind/mgr: Move ServiceSpec to python-common: Fix imports python-common, orch: Move ServiceSpec to python-common: Fix imports python-common, orch: Move ServiceSpec tests to python-common python-common: Move ServiceSpec to python-common: fix linting python-common, orch: Move ServiceSpec (+deps) to python-common Reviewed-by: Joshua Schmid --- ed7682fb45b16a4d79454505cf360d512036b9f3 diff --cc src/pybind/mgr/cephadm/module.py index 6f3851ee7d7,5746089e5d3..2b0b37edb03 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@@ -2433,23 -2424,18 +2434,23 @@@ class CephadmOrchestrator(orchestrator. if spec.placement.is_empty(): # fill in default placement defaults = { - 'mon': orchestrator.PlacementSpec(count=5), - 'mgr': orchestrator.PlacementSpec(count=2), - 'mds': orchestrator.PlacementSpec(count=2), - 'rgw': orchestrator.PlacementSpec(count=2), - 'rbd-mirror': orchestrator.PlacementSpec(count=2), - 'grafana': orchestrator.PlacementSpec(count=1), - 'alertmanager': orchestrator.PlacementSpec(count=1), - 'prometheus': orchestrator.PlacementSpec(count=1), - 'node-exporter': orchestrator.PlacementSpec(all_hosts=True), - 'crash': orchestrator.PlacementSpec(all_hosts=True), + 'mon': PlacementSpec(count=5), + 'mgr': PlacementSpec(count=2), + 'mds': PlacementSpec(count=2), + 'rgw': PlacementSpec(count=2), + 'rbd-mirror': PlacementSpec(count=2), + 'grafana': PlacementSpec(count=1), + 'alertmanager': PlacementSpec(count=1), + 'prometheus': PlacementSpec(count=1), + 'node-exporter': PlacementSpec(all_hosts=True), + 'crash': PlacementSpec(all_hosts=True), } spec.placement = defaults[spec.service_type] + elif spec.service_type in ['mon', 'mgr'] and \ + spec.placement.count is not None and \ + spec.placement.count < 1: + raise OrchestratorError('cannot scale %s service below 1' % ( + spec.service_type)) self.log.info('Saving service %s spec with placement %s' % ( spec.service_name(), spec.placement.pretty_str())) self.spec_store.save(spec)