Skip to content

fix: use auth_client_required instead of removed auth_supported for RBD - #13991

Merged
weizhouapache merged 2 commits into
apache:4.22from
waterWang:fix-kvm-rbd-auth-client-required
Sep 10, 2026
Merged

weizhouapache merged 2 commits into
apache:4.22from
waterWang:fix-kvm-rbd-auth-client-required

Conversation

@waterWang

Copy link
Copy Markdown

Fixes #13989

Problem

CloudStack builds its RBD connection strings with the legacy Ceph option auth_supported=cephx (or auth_supported=none when no auth user is configured). This option was removed in Ceph Tentacle 20.2.4. As a result, every RBD operation performed by the KVM agent through librados fails:

agent.err: libvirt: Storage Driver error : internal error: failed to set RADOS option: auth_supported
agent.log: Failed to create RBD storage pool: org.libvirt.LibvirtException

Root cause

KVMPhysicalDisk.RBDStringBuilder emits auth_supported in the RBD URI string passed to qemu/librados. Modern librados no longer accepts this option name.

Fix

Replace auth_supported with auth_client_required (values cephx/none) — the modern option used by the qemu rbd driver (block/rbd.c calls rados_conf_set(cluster, "auth_client_required", ...)) and accepted by current Ceph releases. The qemu RbdAuthMode enum only supports cephx and none, matching the existing branches.

Changes

  • plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java: emit auth_client_required=cephx / auth_client_required=none
  • plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDiskTest.java: update 3 assertions to expect auth_client_required=cephx

@weizhouapache

Copy link
Copy Markdown
Member

@waterWang
thanks

have you verified the changes ?

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.86%. Comparing base (a9b2f33) to head (1cd9f50).

Files with missing lines Patch % Lines
.../cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #13991   +/-   ##
=========================================
  Coverage     17.86%   17.86%           
  Complexity    16037    16037           
=========================================
  Files          5928     5928           
  Lines        534479   534479           
  Branches      65410    65410           
=========================================
+ Hits          95468    95469    +1     
+ Misses       428173   428172    -1     
  Partials      10838    10838           
Flag Coverage Δ
uitests 4.02% <ø> (ø)
unittests 18.92% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland DaanHoogland moved this from Backlog to conflict/waiting in CloudStack Testing Sep 1, 2026
@weizhouapache weizhouapache self-assigned this Sep 7, 2026
cloudabceu pushed a commit to cloudabceu/cloudabceu.github.io that referenced this pull request Sep 8, 2026
The rados_auth_shim.so LD_PRELOAD needed for libvirtd's own RBD
storage-pool code turns out to crash any QEMU process that inherits
it as a spawned child -- corrects the post's earlier claim that the
systemd Environment= drop-in wouldn't affect qemu. Adds the fix
(wrap qemu-kvm to strip LD_PRELOAD before exec) and clarifies why
apache/cloudstack#13991 is still needed independently of the wrapper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm
tested with ceph 20.

cc @DaanHoogland
but I think we need this in 4.22 (and maybe 4.20) too

@DaanHoogland

Copy link
Copy Markdown
Contributor

code lgtm tested with ceph 20.

cc @DaanHoogland but I think we need this in 4.22 (and maybe 4.20) too

Yes I agree, @waterWang is not responding so I think we must scavange the changes and re-submit.

Ceph Tentacle 20.2.4 removed the legacy `auth_supported` librados option.
CloudStack builds RBD connection strings with `auth_supported=cephx`/`none`,
so every RBD operation through the KVM agent fails with
"failed to set RADOS option: auth_supported".

Switch the RBD string builder to `auth_client_required`, the modern option
used by the qemu rbd driver and accepted by current Ceph releases.
@weizhouapache

Copy link
Copy Markdown
Member

code lgtm tested with ceph 20.
cc @DaanHoogland but I think we need this in 4.22 (and maybe 4.20) too

Yes I agree, @waterWang is not responding so I think we must scavange the changes and re-submit.

@DaanHoogland
I have rebased with 4.22 and force-pushed to the branch

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19165

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian Build Failed (tid-16944)

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

blueorangutan commented Sep 10, 2026

Copy link
Copy Markdown

[SF] Trillian test result (tid-16946)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59730 seconds
Marvin logs: [archive removed]
Smoke tests completed. 147 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
test_list_system_vms_metrics_history Failure 0.29 test_metrics_api.py

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@sureshanaparti sureshanaparti added this to the 4.22.2 milestone Sep 10, 2026
@weizhouapache
weizhouapache merged commit b9a5977 into apache:4.22 Sep 10, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from conflict/waiting to Done in CloudStack Testing Sep 10, 2026
@boring-cyborg

boring-cyborg Bot commented Sep 10, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request!

@weizhouapache

Copy link
Copy Markdown
Member

merging based on approvals and manual validation against ceph 20 (tentacle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment