Skip to content

mgr/cephadm: give nvmeof gateways a key they can use (squid aes256k) - #28

Open
dvanders wants to merge 1 commit into
cobaltcore-dev:squid-19.2.6-cobaltcore-storagefrom
dvanders:wip-dvanders-cobaltcore-nvmeof-legacy-key
Open

dvanders wants to merge 1 commit into
cobaltcore-dev:squid-19.2.6-cobaltcore-storagefrom
dvanders:wip-dvanders-cobaltcore-nvmeof-legacy-key

Conversation

@dvanders

@dvanders dvanders commented Oct 14, 2026 •

Copy link
Copy Markdown

Since 19.2.6, cephadm creates daemon keys as aes256k (ROTATION_CIPHER). The squid nvmeof gateway images carry their own librados, built before aes256k, and cannot connect with such a key. The gateway crash-loops and the nvmeof service never comes up.

Found in our teuthology run of this branch, orch:cephadm:smoke-roleless/{0-distro/centos_9.stream_runc 0-nvme-loop 1-start 2-services/nvmeof 3-final} (job 3763, 2026-10-10):

  • the mon log: auth get-or-create client.nvmeof.foo.vm06.qoywko ... "key_type": "aes256k"
  • the gateway log (quay.io/ceph/nvmeof:1.2.5), on each of 5 starts: rados.IOError: [errno 5] RADOS I/O error (error connecting to the cluster), then Unable to create OMAP, exiting!; no mon sees a connection attempt
  • tasks.cephadm: nvmeof.foo has 0/1, then MaxWhileTries: reached maximum tries (300) after waiting for 300 seconds

Reproduced outside teuthology: a fresh cephx user with an aes256k key, then rados.Rados(...).connect() with python3-rados inside each gateway image:

image librados2 in the image connect with an aes256k key
quay.io/ceph/nvmeof:1.2.1 (the cephadm binary's constant) 19.0.0-2511 [errno 5] RADOS I/O error
quay.io/ceph/nvmeof:1.2.5 (the mgr's default, DEFAULT_NVMEOF_IMAGE in cephadm/module.py, still in 19.2.7) 19.0.0-2513 [errno 5] RADOS I/O error
quay.io/ceph/nvmeof:1.4.28 (latest squid line) 19.2.3-612 [errno 5] RADOS I/O error
quay.io/ceph/nvmeof:1.7 (tentacle's default) 20.2.4 OK
quay.io/ceph/nvmeof:2.0.0 21.3.0 dev OK

No squid gateway image can use the key, so this changes cephadm instead of the default image:

  • utils.key_type_for(): nvmeof gets the previous key type, aes; every other daemon stays on aes256k.
  • The nvmeof service creates the gateway's key with it. A gateway already deployed with an aes256k key gets its key rotated to aes on its next deploy, so ceph orch redeploy nvmeof.<svc> heals a failed service.
  • key_rotate (ceph orch daemon rotate-key) uses it too. The post-upgrade key rotation only covers mon/mgr/osd/mds, so it is unchanged.

Tests: new cephadm/tests/test_nvmeof_key_type.py (5 tests); the full cephadm suite passes (1236). flake8 is clean, and mypy reports no new errors. Not yet run live: the smoke-roleless nvmeof job on a build with this commit is the test.

Upstream: https://tracker.ceph.com/issues/81778 (this bug, squid and tentacle; related: #79868, ceph/ceph-nvmeof#2203).

🤖 Generated with Claude Code

Since 19.2.6 cephadm creates daemon keys as aes256k (ROTATION_CIPHER).
The nvmeof gateway images for squid (quay.io/ceph/nvmeof 1.2.x, the
default 1.2.1, and the squid line 1.4.x up to 1.4.28) carry their own
librados, built before aes256k (19.0.0 dev, 19.2.3), and cannot connect
with such a key: the gateway crash-loops with "RADOS I/O error (error
connecting to the cluster)" and "Unable to create OMAP, exiting!", and
the service never comes up (orch:cephadm:smoke-roleless 2-services/nvmeof
times out on "nvmeof.foo has 0/1").

Create and rotate nvmeof keys with the previous key type (aes): a
per-daemon-type key type in utils (key_type_for), used by the nvmeof
service's keyring and by key_rotate (ceph orch daemon rotate-key). A
gateway already deployed with an aes256k key gets its key rotated to aes
on its next deploy, so `ceph orch redeploy nvmeof.<svc>` heals a failed
service.

Reproduced on a cephadm cluster: with an aes256k key, python3-rados in
quay.io/ceph/nvmeof:1.2.1, 1.2.5 and 1.4.28 fails to connect ([errno 5]);
in 1.7 (librados 20.2.4) and 2.0.0 it connects.

Fixes: https://tracker.ceph.com/issues/81778
Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Dan van der Ster <dan.vanderster@clyso.com>
@dvanders
dvanders force-pushed the wip-dvanders-cobaltcore-nvmeof-legacy-key branch from 772974d to 46a0393 Compare October 14, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant