GrepBoard/Manuals
605 manuals ·

Fix rbd map possible ms_mode mismatch on Ceph Tentacle (msgr2)

·Tested on Ceph Tentacle 20.2.4 · Squid 19.2.3 official docs and source · 2026-10·Test scope ↓·6 steps

Ceph Tentacle rbd device map defaults to msgr2 and fails with possible ms_mode mismatch if no v2 mon address is known. Use -o ms_mode=legacy, then fix mon_host.

output
rbd: failed to get mon address (possible ms_mode mismatch)

Starting with Ceph Tentacle (20.2), rbd device map connects with msgr2 unless told otherwise, and it picks only v2 mon addresses from the client configuration. If every mon address the client knows is v1 (port 6789), it stops with the message above. Use -o ms_mode=legacy to get the old behavior right now; the real fix is to make the client's mon_host include v2 addresses (port 3300). The block above is not captured output; it is the string from [krbd.cc L230-L233, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/krbd.cc#L230-L233).

[1] Confirm what changed. The 20.2.0 RBD entry in the Tentacle release notes reads "rbd device map command now defaults to msgr2 for all device types" and says to pass -o ms_mode=legacy to keep using msgr1. The source shows the difference directly.

VersionDefault messengerSource
Squid 19.2.3msgr2 = false: without ms_mode, v1 addresses are used[krbd.cc L193, v19.2.3](https://github.com/ceph/ceph/blob/v19.2.3/src/krbd.cc#L193)
Tentacle 20.2.4msgr2 = true: only v2 addresses, and ms_mode=prefer-crc is appended[krbd.cc L195 · L279-L282, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/krbd.cc#L192-L292)

In v20.2.4, build_map_buf() collects only the mon map addresses where is_msgr2() is true and, if none remain, prints the message and returns -ENOENT. What matters is the rbd package version on the client, so check the client before the cluster.

console
$ rbd --version

[2] Check which mon addresses the client knows. Before connecting, rbd builds its initial mon map from the client's mon_host (or -m). When an address has no v1: or v2: prefix, the port decides the type ([MonMap.cc L606-L631, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/mon/MonMap.cc#L606-L631)).

Written in mon_hostResulting addresses
192.0.2.10:6789v1 only, so the Tentacle default map fails
192.0.2.10:3300v2 only
192.0.2.10 (no port)both v2 (3300) and v1 (6789)
[v2:192.0.2.10:3300/0,v1:192.0.2.10:6789/0]both, as written
console
$ grep mon_host /etc/ceph/ceph.conf$ ceph mon dump

If the mon lines in ceph mon dump look like the example in the msgr2 docs, [v2:…:3300/0,v1:…:6789/0], the mons already listen on v2 and the problem is the :6789 in the client config.

[3] Map with the legacy protocol if you need the device now. This is the method from the release notes.

console
$ rbd device map -o ms_mode=legacy mypool/myimage

Nothing needs undoing: the option applies only to this mapping, and dropping it returns the next mapping to the msgr2 default. It does mean msgr1, so msgr2 secure mode (on-the-wire encryption) is not available. In the source, options given with -o are passed to the kernel as is, and the rbd man page lists every ms_mode value as available since kernel 5.11.

[4] Fix it properly by putting v2 addresses in the client config. The msgr2 docs say that with default ports (3300 and 6789) the simplest form is no ports at all, as in mon_host = 192.0.2.10,192.0.2.11,192.0.2.12, and warn that the bracketed form is understood only by Nautilus and later packages. You can also generate a fresh minimal config from the cluster and compare.

console
$ ceph config generate-minimal-conf

Copy the client's /etc/ceph/ceph.conf before editing it, and restore that copy if anything breaks.

[5] If the mons do not listen on v2 at all, look at the cluster. That is the case when ceph mon dump shows only v1: addresses. The msgr2 docs say that with mons on the default port 6789 the line below enables v2, and each daemon starts advertising a v2 address the next time it restarts. This changes the whole cluster and the docs give no command to turn it back off, so first make sure port 3300 is open in your firewall.

console
$ ceph mon enable-msgr2$ ceph mon dump

[6] If the mon address step passes but you get rbd: sysfs write failed, the kernel refused the mapping. rbd prints this after writing the map request to the kernel (/sys/bus/rbd) fails ([krbd.cc L504-L511, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/krbd.cc#L504-L511)), followed by a try "dmesg | tail" hint ([Kernel.cc L374, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/tools/rbd/action/Kernel.cc#L374)). The actual reason is in the kernel log.

console
$ uname -r$ dmesg | tail$ ceph osd dump | grep '^osd\.'
  • On kernels older than 5.11, the man page says the ms_mode option does not exist. Whether such a kernel accepts ms_mode=legacy could not be confirmed.
  • If an OSD line has no v2: address, there are two possible causes. The OSD may not have restarted since the mons enabled v2 (the msgr2 docs say daemons advertise a v2 address when next restarted), or ms_bind_msgr2 (on by default), which controls whether the daemon binds a v2 port, may be turned off (bind configuration options). Check the running value with ceph config show osd.<id> ms_bind_msgr2 first, and consider a restart only when it is true. The kernel's message for this case could not be confirmed.
  • On a newly created Tentacle cluster, the key type can also be the cause. See AUTH_INSECURE_CLIENT_KEY_TYPE and aes256k.

To check clients before an upgrade, see Ceph Squid to Tentacle upgrade pre-check.

#ceph#rbd#krbd#msgr2#tentacle