]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm/schedule: choose an IP from a subnet list
authorSage Weil <sage@newdream.net>
Thu, 11 Mar 2021 23:47:24 +0000 (18:47 -0500)
committerSage Weil <sage@newdream.net>
Fri, 19 Mar 2021 14:00:01 +0000 (09:00 -0500)
commit90fbd928d8e8af8ed3258f404883a0c0118f023d
treea1271e625905dc33a3dcc626c269e8a3c7a159ce
parent7bca183e14e467728320bb7e7e0828e2c6e05cb5
mgr/cephadm/schedule: choose an IP from a subnet list

Choose an IP from the subnet list provided by the ServiceSpec.

A few caveats:
- we ignore hosts that don't have IPs in the given subnet
- the subnet matching is STRICT.  That is, the CIDR name has to exactly
match what is configured on the host.  That means you can't just say 10/8
to match any 10.whatever addres--you need the exactly network on the host
(e.g, 10.1.2.0/24).
- If you modify a servicespec and change the networks when there are
already deployed daemons, we will try to deploy the new instances on
the same ports but bound to a specific IP instead of *.  Which will fail.
You need to remove the service first, or remove the old daemons manually
so that creating new ones will succeed.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 48d33f8a1b30a5d0b88c5e50f9a7d22c7e07a1d2)
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/schedule.py
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/cephadm/tests/test_scheduling.py