Skip to content

cephadm: pass OSD spec config during OSD creation - #70851

Merged
adk3798 merged 1 commit into
ceph:mainfrom
Kushal-deb:creation-time-config-update
Aug 12, 2026
Merged

adk3798 merged 1 commit into
ceph:mainfrom
Kushal-deb:creation-time-config-update

Conversation

@Kushal-deb

@Kushal-deb Kushal-deb commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

OSD spec config is stored under the service name, but creation-time options are not available to ceph-volume while preparing new OSDs.

Options such as bluestore_min_alloc_size must be available during
OSD formatting and cannot be applied only after the daemon is created.

Approach:

  • Validate OSD spec config using config metadata.
  • Pass valid config options through the temporary ceph-volume config.
  • Apply runtime-updatable options to the concrete osd.N before daemon startup.
  • Preserve the OSD spec affinity check.

Testing logs:

2026-08-05T14:26:56.799200+0000 mgr.ceph-node-0.sjqrxv (mgr.14152) 504 : cephadm [INF] Applying OSD spec config bdev_async_discard_threads=2 to osd.3
2026-08-05T14:26:56.821524+0000 mgr.ceph-node-0.sjqrxv (mgr.14152) 505 : cephadm [INF] Deploying daemon osd.3 on ceph-node-0

[ceph: root@ceph-node-0 ~]# ceph orch ls
NAME                       PORTS  RUNNING  REFRESHED  AGE  PLACEMENT    
crash                                 3/3  5m ago     15m  *            
mgr                                   2/2  5m ago     15m  count:2      
mon                                   3/5  5m ago     15m  count:5      
osd.all-available-devices               3  5m ago     14m  *            
osd.config_test                         1  15s ago    44s  ceph-node-0  

[ceph: root@ceph-node-0 ~]# ceph osd metadata -f json | jq '
  .[] |
  select(.hostname == "ceph-node-0") |
  {
    id: .id,
    hostname: .hostname,
    osdspec_affinity: .osdspec_affinity,
    bluestore_min_alloc_size: .bluestore_min_alloc_size
  }
'
{
  "id": 0,
  "hostname": "ceph-node-0",
  "osdspec_affinity": "all-available-devices",
  "bluestore_min_alloc_size": "4096"
}
{
  "id": 3,
  "hostname": "ceph-node-0",
  "osdspec_affinity": "config_test",
  "bluestore_min_alloc_size": "16384"
}

[ceph: root@ceph-node-0 ~]# ceph config get osd.3 bdev_async_discard_threads
2

[ceph: root@ceph-node-0 ~]# ceph config dump | grep bdev_async_discard_threads
osd.3                              advanced  bdev_async_discard_threads             2                                                                                            
osd.config_test                    advanced  bdev_async_discard_threads             2               
                                                                             
[ceph: root@ceph-node-0 ~]# ceph tell osd.3 config get bdev_async_discard_threads
{
    "bdev_async_discard_threads": "2"
}

[ceph: root@ceph-node-0 ~]# ceph config get osd.3 bluestore_min_alloc_size
0
[ceph: root@ceph-node-0 ~]# ceph osd metadata 3 -f json-pretty | \
grep -i bluestore_min_alloc_size
    "bluestore_min_alloc_size": "16384",


[ceph: root@ceph-node-0 ~]# ceph config dump
WHO              MASK              LEVEL     OPTION                                 VALUE                                                                                      RO
global                             basic     container_image                        quay.io/kdeb/ceph@sha256:9cee697f30165df259418b49db7c31f4ef39fd48fc4f051c6c2d081c4695cf8a  * 
global                             advanced  public_network                         192.168.100.0/24                                                                           * 
mon                                advanced  auth_allow_insecure_global_id_reclaim  false                                                                                        
mgr                                advanced  mgr/cephadm/container_init             True                                                                                       * 
mgr                                advanced  mgr/cephadm/migration_current          8                                                                                          * 
mgr                                advanced  mgr/dashboard/ssl_server_port          8443                                                                                       * 
mgr                                advanced  mgr/orchestrator/orchestrator          cephadm                                                                                      
osd              host:ceph-node-2  basic     osd_memory_target                      3138340044                                                                                   
osd                                advanced  osd_memory_target_autotune             true                                                                                         
osd.3                              advanced  bdev_async_discard_threads             2                                                                                            
osd.config_test                    advanced  bdev_async_discard_threads             2                                                                                            
osd.config_test                    advanced  bluestore_min_alloc_size               16384                                                                                      * 

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@Kushal-deb
Kushal-deb requested a review from a team as a code owner August 5, 2026 14:54
@Kushal-deb
Kushal-deb force-pushed the creation-time-config-update branch from 688f981 to 2c7ab7f Compare August 5, 2026 15:17
OSD spec config is stored under the service name, but concrete OSD
daemons do not inherit it.

Validate OSD spec config using config metadata and pass valid options
through the temporary ceph-volume config so creation-time settings are
available during OSD formatting.

Apply runtime-updatable options to the concrete osd.N before starting
the daemon.

Signed-off-by: Kushal Deb <[email protected]>
@Kushal-deb
Kushal-deb force-pushed the creation-time-config-update branch from 2c7ab7f to 03873dd Compare August 5, 2026 15:57
@adk3798

adk3798 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@adk3798

adk3798 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants