Bug 2140535

Summary: [RFE] : osd spec : orchestrator could recognise errors on indentation and provide easier inputs to user
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vasishta <vashastr>
Component: CephadmAssignee: Adam King <adking>
Status: NEW --- QA Contact: Manasa <mgowri>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.3CC: cephqe-warriors, rkachach, saraut
Target Milestone: ---Keywords: FutureFeature
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasishta 2022-11-07 05:16:48 UTC
Description of problem:
In OSD spec, 
1) Had missed data_devices, orchestrator errored out saying data_devices missing
2) Had mentioned unrecognised key 'all', orchestrator helped by error'ing out saying 
Error EINVAL: Failed to validate OSD spec "osd": Feature `all` is not supported

But when data_devices was added outside without indentation, error message could have been more easier similar to above helps by orchestrator.

Version-Release number of selected component (if applicable):
16.2.10-69.el8cp

How reproducible:
Always (1/1)

Steps to Reproduce:
1. After cluster bootstrap, use below spec and try to add OSDs
service_type: osd
service_id: osd_all
service_name: osd.osd_all
placement:
  host_pattern: '*'
spec:
  osds_per_device: 2
data_devices:
  all: true

Actual results:
[ceph: root@f12-h10-000-1029u /]# ceph orch apply -i spec.yaml --dry-run
Error EINVAL: ServiceSpec: 'dict' object has no attribute 'validate'

Expected results:
ceph orchestrator to help user with easier error message to immediately know the error
something like

>> Error EINVAL: Failed to validate data_devices