Project

General

Profile

Actions

Bug #73031

closed
PD SS

Implement a new ok-to-upgrade command

Bug #73031: Implement a new ok-to-upgrade command

Added by Prashant D about 1 year ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
-
Due date:
% Done:

100%

Source:
Backport:
tentacle
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v20.3.0-5503-g0fac0045d1
Released In:
v21.2.0~1208
Upkeep Timestamp:
2026-10-24T01:55:22+00:00

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


Subtasks 10 (0 open — 10 closed)

Bug #72659: 'ceph osd ok-to-stop' command to return OSDs which are safe to stop from a given listDuplicateShweta Bhosale

Actions
RADOS - Bug #74505: [ok-to-upgrade] ceph osd ok-to-upgrade limits upgradeable OSDs when the command is invoked at rack level with host-level failure domainResolvedSridhar Seshasayee

Actions
RADOS - Bug #74610: [ok-to-upgrade] ceph osd ok-to-upgrade command accepts empty strings and random strings for ceph version parameterResolvedSridhar Seshasayee

Actions
RADOS - Bug #74612: [ok-to-upgrade] Incorrect number of PGs are being reported as "would become offline" when "ceph osd ok-to-upgrade" command is executed. ResolvedSridhar Seshasayee

Actions
RADOS - Bug #74640: [ok-to-upgrade] Inconsistent result of ceph osd ok-to-upgrade command when some of the OSDs are stopped across different racksClosedSridhar Seshasayee

Actions
RADOS - Bug #74696: [ok-to-upgrade] ok-to-upgrade returns empty osds_ok_to_upgrade for OSDs with no PGs while ok-to-stop correctly identifies them as safe when osds of host are down.ResolvedSridhar Seshasayee

Actions
RADOS - Bug #74764: [ok-to-upgrade] ceph osd ok-to-upgrade command accepts invalid max valueResolvedSridhar Seshasayee

Actions
RADOS - Bug #74767: [ok-to-upgrade] Incorrect error message displayed when max value is greater than number of OSDs within a crush bucket when crush bucket contains 1 hostResolvedSridhar Seshasayee

Actions
RADOS - Bug #74923: [ok-to-upgrade] When multiple crush buckets are used , Max flag does not properly scan the crush hierarchyResolvedSridhar Seshasayee

Actions
RADOS - Bug #74924: [ok-to-upgrade] When crush hierarchy with multiple buckets are used ( rack, chassis, host, osd) . Using ok to upgrade command shows 0 OSDs.ResolvedSridhar Seshasayee

Actions

Related issues 1 (0 open — 1 closed)

Copied to mgr - Backport #75106: tentacle: Implement a new ok-to-upgrade commandResolvedSridhar Seshasayee

Actions

SS Updated by Sridhar Seshasayee about 1 year ago Actions #1

  • 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 Actions #2

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 66108

RZ Updated by Radoslaw Zarzynski 12 months ago · Edited Actions #3

Bump up! We want to have a look on this during scrubs.

SS Updated by Sridhar Seshasayee 12 months ago Actions #4

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 Actions #5

  • Backport set to tentacle

SS Updated by Sridhar Seshasayee 10 months ago Actions #6

  • Subtask #74767 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #7

  • Subtask #74505 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #8

  • Subtask #74610 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #9

  • Subtask #74764 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #10

  • Subtask #74640 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #11

  • Subtask #74612 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #12

  • Subtask #74696 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #13

  • Subtask #74923 added

SS Updated by Sridhar Seshasayee 10 months ago Actions #14

  • Subtask #74924 added

SS Updated by Sridhar Seshasayee 9 months ago Actions #15

  • Subtask #75081 added

UB Updated by Upkeep Bot 9 months ago Actions #16

  • 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 Actions #17

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot 9 months ago Actions #18

  • Copied to Backport #75106: tentacle: Implement a new ok-to-upgrade command added

UB Updated by Upkeep Bot 9 months ago Actions #19

  • Tags (freeform) set to backport_processed

DV Updated by Dan van der Ster 8 months ago Actions #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?

SS Updated by Sridhar Seshasayee 8 months ago Actions #21

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 Actions #22

  • Subtask #72659 added

UB Updated by Upkeep Bot 3 months ago Actions #23

  • 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 Actions #24

  • 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 Actions #25

  • Subtask deleted (#75081)

UB Updated by Upkeep Bot 3 months ago Actions #26

  • 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 Actions #27

  • 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
Actions

Also available in: PDF Atom