diff options
author | Adam King <adking@redhat.com> | 2023-12-06 16:58:03 +0100 |
---|---|---|
committer | Adam King <adking@redhat.com> | 2023-12-06 16:58:03 +0100 |
commit | 993ce910f41c69a84b5b3058da534ed0e8841a03 (patch) | |
tree | 17123f9bb98d8fd60338cd90199d9a45080c9140 /src/pybind/mgr/orchestrator | |
parent | Merge pull request #54799 from cbodley/wip-osd-scrub-signed-warning (diff) | |
download | ceph-993ce910f41c69a84b5b3058da534ed0e8841a03.tar.xz ceph-993ce910f41c69a84b5b3058da534ed0e8841a03.zip |
mgr/orchestrator: block OSD specs with no service id
This is a copy of a code comment from this commit, but
it explains the change, so putting it here as well
There is a general "osd" service with no service id, but we use
that to dump osds created individually with "ceph orch daemon add osd"
and those made with "ceph orch apply osd --all-available-devices"
For actual user created OSD specs, we should promote users having a
service id so it doesn't get mixed in with those other OSDs. This
check is being done in this spot in particular as this is the only
place we can 100% differentiate between an actual user created OSD
spec and a spec we made ourselves to cover the all-available-devices case
Relates to: https://tracker.ceph.com/issues/63729
Signed-off-by: Adam King <adking@redhat.com>
Diffstat (limited to 'src/pybind/mgr/orchestrator')
-rw-r--r-- | src/pybind/mgr/orchestrator/module.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index d6f36e81b71..5f36005b0b1 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -1351,6 +1351,21 @@ Usage: except KeyError: raise SpecValidationError(f'Invalid config option {k} in spec') + # There is a general "osd" service with no service id, but we use + # that to dump osds created individually with "ceph orch daemon add osd" + # and those made with "ceph orch apply osd --all-available-devices" + # For actual user created OSD specs, we should promote users having a + # service id so it doesn't get mixed in with those other OSDs. This + # check is being done in this spot in particular as this is the only + # place we can 100% differentiate between an actual user created OSD + # spec and a spec we made ourselves to cover the all-available-devices case + if ( + isinstance(spec, DriveGroupSpec) + and spec.service_type == 'osd' + and not spec.service_id + ): + raise SpecValidationError('Please provide the service_id field in your OSD spec') + if dry_run and not isinstance(spec, HostSpec): spec.preview_only = dry_run |