Skip to content

tools/contrib: add upmap-remapped.py utility - #67886

Merged
ljflores merged 1 commit into
mainfrom
dvanders_upmap_remapped
Aug 5, 2026
Merged

ljflores merged 1 commit into
mainfrom
dvanders_upmap_remapped

Conversation

@dvanders

@dvanders dvanders commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

This script generates upmap entries for currently remapped PGs, allowing operators to execute large cluster changes (like massive PG splitting or adding capacity) without triggering immediate, disruptive I/O storms. It pins PGs to their current physical locations, deferring data migration to the background balancer.

Note: This tool is actively maintained over at
https://github.com/cernceph/ceph-scripts. We should strive to keep this in-tree copy in sync with that repository.

Fixes: https://tracker.ceph.com/issues/78996

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.

@dvanders
dvanders requested a review from ljflores March 18, 2026 21:19
@jmundack

jmundack commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

I’m trying to understand the value of adding a copy of this script to ceph/ceph.

A few high-level questions come to mind:

  • How will we keep the in-tree version in sync with cern's copy?
  • Since there are already several implementations , why is this the right one to bring in? For example, why this instead of digitalocean/pgremapper?
  • If we do merge it, what documentation should be added or updated so the community knows this is the Ceph maintained version, when to use it, and what guidance we want people to follow?

Without clear plans on maintenance, and documentation, I’m not yet sure what the long-term value is of carrying this in-tree.

on a side note - i think it would be fantastic to get this as an option within core code itself (and not something out of band)

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label May 18, 2026
@dvanders

Copy link
Copy Markdown
Contributor Author

I’m trying to understand the value of adding a copy of this script to ceph/ceph.

It was requested by the RADOS team.

i think it would be fantastic to get this as an option within core code itself

That's being tracked here: https://tracker.ceph.com/issues/67418

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jul 18, 2026
This script generates upmap entries for currently remapped PGs, allowing
operators to execute large cluster changes (like massive PG splitting or
adding capacity) without triggering immediate, disruptive I/O storms.
It pins PGs to their current physical locations, deferring data migration
to the background balancer.

Note: This tool is actively maintained over at
https://github.com/cernceph/ceph-scripts. We should strive to keep this
in-tree copy in sync with that repository.

Fixes: https://tracker.ceph.com/issues/78996
Signed-off-by: Dan van der Ster <[email protected]>
@ljflores ljflores added core skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology labels Aug 3, 2026
@ljflores
ljflores force-pushed the dvanders_upmap_remapped branch from 23f6da3 to a0abd36 Compare August 3, 2026 21:01
@ljflores

ljflores commented Aug 3, 2026

Copy link
Copy Markdown
Member

I added the relevant tracker to the commit.

We'd like to include the script in Umbrella GA (tracked in https://tracker.ceph.com/issues/78996).

Upstream tests and documentation to follow (tracked in https://tracker.ceph.com/issues/78997).

@ljflores ljflores added the needs-umbrella-backport This PR should be backported to Umbrella label Aug 3, 2026
import rados
cluster = rados.Rados(conffile='/etc/ceph/ceph.conf')
cluster.connect()
except:
if 'pool' in line:
x = line.split(' ')
pool_type[x[1]] = x[3]
except:
if pool_type[pool] == 'replicated':
try:
pairs = gen_upmap(up, acting, replicated=True)
except:
elif pool_type[pool] == 'erasure':
try:
pairs = gen_upmap(up, acting)
except:
rm_upmap_pg_items(pgid)
num += 1
continue
except KeyError:
@ljflores

ljflores commented Aug 3, 2026

Copy link
Copy Markdown
Member

Copiliot reviews are irrelevant since we are copying over the script exactly as it is in https://github.com/cernceph/ceph-scripts.

@github-actions github-actions Bot removed the stale label Aug 3, 2026
@ljflores

ljflores commented Aug 4, 2026

Copy link
Copy Markdown
Member

jenkins test make check

@ljflores
ljflores merged commit df247cd into main Aug 5, 2026
19 checks passed
@ljflores
ljflores deleted the dvanders_upmap_remapped branch August 5, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core needs-umbrella-backport This PR should be backported to Umbrella skip-teuthology For PRs whose changes do not have an effect on QA runs/changes are not being tested in Teuthology

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants