]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
python-common/drive_selection: fix limit with existing devices
authorAdam King <adking@redhat.com>
Mon, 27 Nov 2023 20:04:42 +0000 (15:04 -0500)
committerAdam King <adking@redhat.com>
Wed, 29 Nov 2023 18:57:00 +0000 (13:57 -0500)
commitd3f1a0e1c0b98b9f1251837ecc8edc367e590dad
tree6b94ea8bf27e51401804e894440e968f1eb09c07
parent94e40c80f3d1f6fca1ee42982dcd2e5419f49551
python-common/drive_selection: fix limit with existing devices

When devices have already been used for OSDs, they are still
allowed to pass filtering as they are still needed for the
resulting ceph-volume lvm batch command. This was causing an
issue with limit however. Limit adds the devices we've found
that match the filter and existing OSD daemons tied to the spec.
This allows double counting of devices that hae been used for
OSDs, as they're counted in terms of being an existing device
and that they match the filter. To avoid this issue, devices
should only be counted towards the limit if they are not already
part of an OSD.

An additional note: The limit feature is only applied for
data devices, so there is no need to worry about the effect
of this change on selection of db, wal, or journal devices.
Also, we would still want to not count these devices if they
did end up passing the data device filter but had been used
for a db/wal/journal device previously.

Fixes: https://tracker.ceph.com/issues/63525
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/services/osd.py
src/pybind/mgr/cephadm/tests/test_cephadm.py
src/python-common/ceph/deployment/drive_selection/selector.py
src/python-common/ceph/tests/test_disk_selector.py