]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
python-common/drive_selection: fix limit with existing devices 56096/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 20:10:42 +0000 (16:10 -0400)
commit5965433f11da88359de8cce6ed6deb91d418b27a
treec4646d1aba660a092fbfa31c76d146df48b8af35
parentc2ea977b6956d1f694ccf66acc692fdd979e3baa
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