Skip to content

rbd: add mounter type validation for ControllerModifyVolume#6229

Merged
mergify[bot] merged 3 commits into
ceph:develfrom
nixpanic:issue/6186
Apr 16, 2026
Merged

rbd: add mounter type validation for ControllerModifyVolume#6229
mergify[bot] merged 3 commits into
ceph:develfrom
nixpanic:issue/6186

Conversation

@nixpanic

Copy link
Copy Markdown
Member

RBD QoS parameters are only supported with the rbd-nbd mounter, but
ControllerModifyVolume previously had no way to enforce this.

This adds infrastructure to track the mounter type of RBD volumes via image
metadata (mounterKey), stored at volume creation and cleaned up on deletion. A
new UsesNBDMounter() method fetches and caches this value lazily.

ControllerModifyVolume now validates the mounter type before applying QoS
changes:

  • Volumes with unknown mounter (created before mounter tracking) log a warning
    and proceed
  • Metadata fetch failures return an Internal error
  • Volumes using a non-rbd-nbd mounter return InvalidArgument

Fixes: #6186

@mergify mergify Bot added the component/rbd Issues related to RBD label Apr 10, 2026
@nixpanic

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/rbd

1 similar comment
@nixpanic

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.35/rbd

@nixpanic nixpanic requested a review from a team April 10, 2026 10:55
@nixpanic nixpanic requested a review from a team April 16, 2026 08:03
@nixpanic

Copy link
Copy Markdown
Member Author

/test ci/centos/mini-e2e/k8s-1.34/rbd

@nixpanic

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

Add infrastructure to track and check the mounter type of RBD volumes:

- Add mounterKey constant to store mounter type in image metadata
- Save mounter type in setAllMetadata() when creating volumes
- Remove mounter type in unsetAllMetadata() for cleanup
- Add ErrMounterUnknown error for volumes without mounter metadata
- Add UsesNBDMounter() method that lazily fetches the mounter type
  from metadata when needed and caches it

The UsesNBDMounter() method returns ErrMounterUnknown when no mounter
metadata exists, allowing detection of volumes created before mounter
tracking was added.

This is needed for issue ceph#6186 where QoS modifications should only
be allowed on volumes using the rbd-nbd mounter.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
QoS parameters only work with the rbd-nbd mounter. Validate that
volumes being modified via ControllerModifyVolume use rbd-nbd by
calling UsesNBDMounter().

Handle different cases with a switch statement:
- ErrMounterUnknown: Log warning and continue (volumes created before
  mounter tracking - QoS may or may not work)
- Other errors: Return Internal error (metadata fetch failed)
- Known non-rbd-nbd mounter: Return InvalidArgument (QoS won't work)

This allows modification of existing volumes while still protecting
against attempting QoS modifications on volumes that are known to
use incompatible mounters.

Fixes: ceph#6186
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Deprecation notice: This pull request comes from a fork and was rebased using bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the rebase action will no longer be able to rebase fork pull requests with this configuration. Please switch to the update action/command to ensure compatibility going forward.

@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

@nixpanic nixpanic added the ok-to-test Label to trigger E2E tests label Apr 16, 2026
@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.33

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.33

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.33

@ceph-csi-bot ceph-csi-bot added ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. and removed ok-to-test Label to trigger E2E tests labels Apr 16, 2026
@mergify mergify Bot removed the ci/in-progress/e2e This label acts like a guard and prevents Mergify from adding the `ok-to-test` label again. label Apr 16, 2026
@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Deprecation notice: This pull request comes from a fork and was queued with update_method=rebase and update_bot_account impersonation. This capability will be removed on July 1, 2026. After this date, the merge queue will no longer be able to rebase fork pull requests with this configuration. To avoid disruption, switch to update_method=merge in your queue rule.

@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-04-16 13:32 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-16 13:32 UTC · at 08c898fd36cc631ff2b72a4ddacc45ba50d1901e

This pull request spent 9 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify Bot merged commit 77f667b into ceph:devel Apr 16, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup component/rbd Issues related to RBD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rbd: ControllerModifyVolume should report an error when setting QoS on non rbd-nbd volumes

5 participants