]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
python-common/drive_selection: fix limit with existing devices 56085/head
authorAdam King <adking@redhat.com>
Mon, 27 Nov 2023 20:04:42 +0000 (15:04 -0500)
committerAdam King <adking@redhat.com>
Sun, 10 Mar 2024 19:12:45 +0000 (15:12 -0400)
commit0e65ab583fec17e0511ce8f714a42f93e56e0288
tree656f1faa0aba8c15f91aaa501a0228f9207e548d
parent5bee1087985ebe9d721cdeeb2ee8183e5cf42d59
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>
(cherry picked from commit d3f1a0e1c0b98b9f1251837ecc8edc367e590dad)
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