]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: make placement truly optional (default to count=1)
authorSage Weil <sage@redhat.com>
Sun, 8 Mar 2020 17:05:47 +0000 (12:05 -0500)
committerSage Weil <sage@redhat.com>
Sun, 8 Mar 2020 17:05:47 +0000 (12:05 -0500)
If no placement information is provided at all, assume 1 daemon over any
host.

This could perhaps be improved with a default placement that varies by
daemon type...

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 362dbeb8db1f93698dcd6d9d70245f7218beafc8..945f0c3a6668e13746fee3377d8b5da945899660 100644 (file)
@@ -2998,7 +2998,6 @@ class HostAssignment(object):
             logger.debug('All hosts: {}'.format(candidates))
             return candidates
 
-
         count = 0
         if self.spec.placement.hosts and \
            self.spec.placement.count and \
@@ -3028,9 +3027,11 @@ class HostAssignment(object):
             else:
                 # this should be a totally empty spec given all of the
                 # alternative paths above.
-                raise OrchestratorValidationError(
-                    "Cannot place service %s without any placement information" % (
-                        self.service_name))
+                assert self.spec.placement.count is None
+                assert not self.spec.placement.hosts
+                assert not self.spec.placement.label
+                assert not self.spec.placement.all_hosts
+                count = 1
             logger.debug('place %d over all hosts: %s' % (count, hosts))
 
         # we need to select a subset of the candidates