Skip to main content
RunBook Academy

CephLXXXVIII · Kubernetes Storage Failure ScenariosKubernetes Storage Failure Scenarios

Diagnosing a volume that will not mount

Advanced⏱ ~18 minkubectlcephrbd

What you'll learn

  • Read the mount failure from Kubernetes events
  • Follow the failure to the responsible component
  • Diagnose the common mount failure causes
  • Restore the pod

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

A pod stuck ContainerCreating with a volume error has a small set of possible causes, and the event message narrows it immediately.

Reading the event

NAME=acme
kubectl describe pod ${NAME} | sed -n '/Events:/,$p'
Event messageCause
MountVolume.MountDevice failed ... rbd: map failedimage features, or the node cannot reach Ceph
MountVolume.SetUp failed ... permission deniedsecret or capability problem
rpc error: code = Internal ... image not foundthe image was deleted outside Kubernetes
timed out waiting for the conditionnode plugin unresponsive, or Ceph slow
volume is already exclusively attachedstill attached to another node
driver name rbd.csi.ceph.com not foundnode plugin not registered on this node
failed to get connectionmonitor addresses wrong or unreachable

The message names the phase and usually the component.

Following the failure

# Substitute your own value before running:
POD=web-5f9c7d8b6c-2xk9p

# which node?
kubectl get pod "$POD" -o jsonpath='{.spec.nodeName}'

# the node plugin on that node
NODE=$(kubectl get pod "$POD" -o jsonpath='{.spec.nodeName}')
kubectl -n ceph-csi get pods -o wide --field-selector spec.nodeName="$NODE"

# its logs -- PLUGIN_POD is the csi-rbdplugin pod from the listing above
PLUGIN_POD=csi-rbdplugin-4xk7z
kubectl -n ceph-csi logs "$PLUGIN_POD" -c csi-rbdplugin --tail=100
# and on the node itself
dmesg -T | grep -i rbd | tail -20

The kernel log on the node carries the krbd errors, which the CSI logs do not always surface clearly.

The common causes

# 1. can the node reach Ceph?
PLUGIN_POD=plugin_pod
IMAGE=vm-disk-01
PV=pv
USERID=userid
kubectl -n ceph-csi exec ${PLUGIN_POD} -- ceph -s --connect-timeout 5

# 2. does the image exist?
rbd -p k8s-rbd ls | grep ${IMAGE}

# 3. are the features supported?
rbd info k8s-rbd/${IMAGE} | grep features
uname -r

# 4. is it attached elsewhere?
rbd status k8s-rbd/${IMAGE}
kubectl get volumeattachment | grep ${PV}

# 5. is the secret correct?
kubectl -n ceph-csi get secret csi-rbd-secret -o jsonpath='{.data.userID}' | base64 -d
ceph auth get client.${USERID}

Five checks covering the substantial majority of mount failures.

The stale attachment case

IMAGE=vm-disk-01
rbd status k8s-rbd/${IMAGE}
# Watchers:
#   watcher=10.0.1.42:0/1234567 client.4567 cookie=1

A node that failed without cleanly unmapping leaves a watcher, and another node cannot acquire the exclusive lock:

# after confirming the old node is genuinely gone
IMAGE=vm-disk-01
OLD_NODE_ADDR=10.20.0.11
NAME=acme
rbd status k8s-rbd/${IMAGE}
ceph osd blocklist add ${OLD_NODE_ADDR}
kubectl delete volumeattachment ${NAME}

Blocklisting the stale client is what releases the lock, and it must only be done after confirming the node is not still writing.

Restoring the pod

# after fixing the cause
NAME=acme
kubectl delete pod ${NAME}
# Substitute your own value before running:
POD=web-5f9c7d8b6c-2xk9p

# verify
kubectl get pod "$POD" -w
kubectl exec "$POD" -- df -h /data

Quiz

Knowledge check · 4 questions

  1. Q1. A pod cannot mount an RBD volume because it is still attached to a failed node. What releases the lock?

  2. Q2. The CSI node plugin logs contain all the information needed to diagnose a mapping failure.

  3. Q3. Diagnose a pod stuck ContainerCreating.

    A pod is stuck in ContainerCreating with a MountVolume error. Other pods using the same StorageClass are running normally on other nodes.

  4. Q4. What five checks cover most RBD mount failures?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Read the node’s dmesg alongside the CSI plugin logs — krbd errors land in the kernel log and are often the only place the actual reason appears. Confirm a node is genuinely down before blocklisting its client to release a lock; doing so to a live node severs it mid-write.

Cross-course references

  • Kubernetes: stale volume attachments after node failure are a general CSI problem
  • Linux: a lock held by a crashed process needs the same careful release