public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager v2 0/3] migrations: cephx: catch daemons whose key on disk is stale
@ 2026-10-25  9:57 Kefu Chai
  2026-10-25  9:57 ` [PATCH manager v2 1/3] migrations: cephx: collect the run's cluster information in one place Kefu Chai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kefu Chai @ 2026-10-25  9:57 UTC (permalink / raw)
  To: pve-devel

Hi,

after upgrading to Ceph 20, a user rotated their MDS keys by hand with
'ceph auth rotate --key-type=aes256k' and then ran the migration
helper. It saw aes256k in the auth database and happily said PASS, but
the keyrings on disk still had the old keys. So the MDS daemons
couldn't authenticate at their next restart, and CephFS went down.
Since v1 we've also seen this with OSDs, and there fixing the keyring
isn't even enough, because ceph-volume rebuilds it from the bluestore
label at every boot.

With this series the helper also looks at the keys the daemons will
actually read next time, i.e. the keyrings and the OSD labels. Any
daemon with a stale copy gets planned for rotation, which rewrites all
its copies, and if a copy can't be checked, the helper won't call the
cluster migrated. The cost is one more SSH session per node per run.
Patch 1 is a cleanup that fixes a few older bugs on the way, so feel
free to pick it up on its own.

I gave it a spin on a three node cluster with Ceph 20.2.4, with a stale
OSD label: with the OSD running, with '--restart-daemons', and with it
down at its start limit. Each time the OSD came back fine after a
'ceph-volume lvm activate', which is what a reboot does.

One thing I'm unsure about: a dry run with a stale key still prints
"Preflight checks passed for the displayed plan". If that reads too
much like a PASS to you, I'm happy to change it.

Changes since v1:
- rebased; only daemons on cluster nodes are probed now, the rest are
  listed as not compared
- dropped the special case for a staged pending key on disk
- stale daemons are counted in needs_rotation()
- the start hint for a stopped daemon runs 'systemctl reset-failed'
  first
- the "already on the new cipher" message no longer credits an earlier
  run
- reworked the tests to match the existing ones

v1: https://lore.proxmox.com/pve-devel/20261012143802.1193012-1-k.chai@proxmox.com/

Thanks for having a look!

Kefu Chai (3):
  migrations: cephx: collect the run's cluster information in one place
  migrations: cephx: report daemons whose key on disk differs
  migrations: cephx: rotate daemons whose key on disk differs

 PVE/Ceph/KeyMigration.pm            |  60 +++++-
 bin/pve-cephx-rotate-service-keys   | 249 +++++++++++++++++++------
 test/CephKeyMigrationScript_test.pl | 278 ++++++++++++++++++++++++++++
 test/CephKeyMigration_test.pl       |  91 +++++++++
 4 files changed, 619 insertions(+), 59 deletions(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-25  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-25  9:57 [PATCH manager v2 0/3] migrations: cephx: catch daemons whose key on disk is stale Kefu Chai
2026-10-25  9:57 ` [PATCH manager v2 1/3] migrations: cephx: collect the run's cluster information in one place Kefu Chai
2026-10-25  9:57 ` [PATCH manager v2 2/3] migrations: cephx: report daemons whose key on disk differs Kefu Chai
2026-10-25  9:57 ` [PATCH manager v2 3/3] migrations: cephx: rotate " Kefu Chai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal