Bug #73031
closedImplement a new ok-to-upgrade command
100%
Description
The ok-to-stop command doesn't know which OSDs have already been upgraded. So when Cephadm or Rook asks if it's okay to stop OSD X, it may return a list that includes already upgraded OSDs—wasting upgrade slots and slowing down the process.
The topological filtering is ineffective, Even if you filter by rack (e.g., rack=A), ok-to-stop may return OSDs outside that rack. This breaks rack-by-rack upgrade logic and forces manual filtering or retries.
Cephadm and Rook often have to loop through OSDs, retrying ok-to-stop calls until a valid set is found. This leads to delays and unnecessary complexity.
There's no built-in way to ask “Give me up to N OSDs in rack A, running version X, that are safe to upgrade together.” Both orchestrators face the same limitations. A shared ok-to-upgrade API would simplify logic, reduce retries, and improve consistency across tools.
What to expect from ok-to-upgrade command :
- Accept rack or CRUSH bucket filters
- Accept version filters (e.g., only return OSDs that still need upgrading)
- Return a safe-to-upgrade batch of OSDs that meet the criteria
SS Updated by Sridhar Seshasayee about 1 year ago
- Status changed from New to In Progress
- Assignee set to Sridhar Seshasayee
Taking ownership since I am working on it.
SS Updated by Sridhar Seshasayee about 1 year ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 66108
RZ Updated by Radoslaw Zarzynski 12 months ago · Edited
Bump up! We want to have a look on this during scrubs.
SS Updated by Sridhar Seshasayee 12 months ago
The first set of review comments are addressed and the PR is close to complete.
I am providing sample outputs from testing to help outline how the command output looks like:
Usage: ceph osd ok-to-upgrade <crush_bucket_name> <new_ceph_version_short> [--max <num>]
The output shown below is for a cluster running on a single node with 10 OSDs
and with replicated pool configuration:
Replicated pool (3x) with min_size=1
$ ceph osd ok-to-upgrade incerta06 01.00.00-gversion-test --format=json
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,1,2,3,4,5,6,7,8,9],"osds_ok_to_upgrade":[0,1,2],"osds_upgraded":[],"bad_no_version":[]}
Replicated pool (3x), min_size = 1, specify -max = 3 and crush bucket name set to a single OSD ID:
$ ceph osd ok-to-upgrade osd.0 01.00.00-gversion-test 3 --format=json
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0],"osds_ok_to_upgrade":[0,1,2],"osds_upgraded":[],"bad_no_version":[]}
Replicated pool (3x) with min_size = 2
$ ceph osd ok-to-upgrade incerta06 01.00.00-gversion-test --format=json
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,1,2,3,4,5,6,7,8,9],"osds_ok_to_upgrade":[0],"osds_upgraded":[],"bad_no_version":[]}
Replicated pool (3x) with min_size = 3
$ ceph osd ok-to-upgrade incerta06 01.00.00-gversion-test --format=json
{"ok_to_upgrade":false,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,1,2,3,4,5,6,7,8,9],"osds_ok_to_upgrade":[],"osds_upgraded":[],"bad_no_version":[]}
The following report is shown if all OSDs are running the desired Ceph version:
$ ceph osd ok-to-upgrade --crush_bucket localrack --ceph_version 20.3.0-3803-g63ca1ffb5a2
{"ok_to_upgrade":false,"all_osds_upgraded":true, "osds_in_crush_bucket":[0,1,2,3,4,5,6,7,8,9],"osds_ok_to_upgrade":[],"osds_upgraded":[0,1,2,3,4,5,6,7,8,9],"bad_no_version":[]}'
The following report is shown if an incompatible CRUSH bucket type is specified:
$ ceph osd ok-to-upgrade --crush_bucket default --ceph_version 20.3.0-3868-ga6644e3ae94 Error EINVAL: crush bucket "default" of type "root" is incompatible for upgradability check; valid types are: 'rack', 'chassis', 'host' and 'osd'
The following report is shown if one or more OSDs' current Ceph version from metadata cannot be determined:
$ ceph osd ok-to-upgrade --crush_bucket default --ceph_version 20.3.0-3868-ga6644e3ae94
{"ok_to_upgrade":false,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,1,2],"osds_ok_to_upgrade":[],"osds_upgraded":[],"bad_no_version":[0,1,2]}
SS Updated by Sridhar Seshasayee 11 months ago
- Backport set to tentacle
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74767 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74505 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74610 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74764 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74640 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74612 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74696 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74923 added
SS Updated by Sridhar Seshasayee 10 months ago
- Subtask #74924 added
SS Updated by Sridhar Seshasayee 9 months ago
- Subtask #75081 added
UB Updated by Upkeep Bot 9 months ago
- Merge Commit set to 0fac0045d13ef23fc2cfb8f1fca90f2500d589a6
- Fixed In set to v20.3.0-5503-g0fac0045d1
- Upkeep Timestamp set to 2026-02-23T12:54:10+00:00
SS Updated by Sridhar Seshasayee 9 months ago
- Status changed from Fix Under Review to Pending Backport
UB Updated by Upkeep Bot 9 months ago
- Copied to Backport #75106: tentacle: Implement a new ok-to-upgrade command added
UB Updated by Upkeep Bot 9 months ago
- Tags (freeform) set to backport_processed
DV Updated by Dan van der Ster 8 months ago
@Sridhar Seshasayee awesome!
I'm was wondering if you confirmed that this new code works for multi-step crush rules, device classes, or other complex crush scenarios?
SS Updated by Sridhar Seshasayee 8 months ago
Dan van der Ster wrote in #note-20:
@Sridhar Seshasayee awesome!
I'm was wondering if you confirmed that this new code works for multi-step crush rules, device classes, or other complex crush scenarios?
@Dan van der Ster Yes, from preliminary testing by QE using MSR, the
code works as it relies on crush bucket names to extract
OSDs within it and perform upgradeability check on them. As
per the requirement (Please see: https://tracker.ceph.com/issues/75681)
from the Orchestrator, the code restricts itself to
extracting OSDs only from the provided crush bucket.
Therefore, as long as the user/Orchestrator provides the
accurate crush bucket names to the command, the output
will either contain a set of upgradeable OSDs if feasible
or an error that outlines the reason why a safe set
cannot be determined.
SS Updated by Sridhar Seshasayee 7 months ago
- Subtask #72659 added
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-02-23T12:54:10+00:00 to 2026-08-27T18:26:26+00:00
UB Updated by Upkeep Bot 3 months ago
- Upkeep Timestamp changed from 2026-08-27T18:26:26+00:00 to 2026-08-27T18:40:06+00:00
PD Updated by Patrick Donnelly 3 months ago
- Subtask deleted (
#75081)
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Resolved
- Upkeep Timestamp changed from 2026-08-27T18:40:06+00:00 to 2026-08-27T18:47:15+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~1208
- Upkeep Timestamp changed from 2026-08-27T18:47:15+00:00 to 2026-10-24T01:55:22+00:00