]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/cephadm: make HostAssignment make sense
authorSage Weil <sage@redhat.com>
Tue, 25 Feb 2020 00:29:12 +0000 (18:29 -0600)
committerSage Weil <sage@redhat.com>
Sun, 1 Mar 2020 20:19:35 +0000 (14:19 -0600)
commitf6e289ec79ddb423582cb06d3d1abeaa7749ebe5
tree88dfffc81c5847a6876f759344acf915acec1353
parent71d8d06f820ea1447718bf76909a56bff5d990f7
mgr/cephadm: make HostAssignment make sense

- if hosts are passed, use those.
- if all_hosts=true, use all hosts.

Otherwise, build a set of hosts based on the labels--either explicit or
implied.  If there's no label, use all hosts.

If there is a count, use a subset of candidate hosts.  If there was no
label and there is no count, fail.

If count and hosts are both provided, then we either (1) use the hosts
as the candidate list and place among them (if len(hosts) >= count), or
(2) ensure that any result includes *at least* the provided hosts.

Add tests that (I'm pretty sure) cover cases!

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/tests/test_scheduling.py [new file with mode: 0644]