Skip to content

Commit d698613

Browse files
committed
fix: use auth_client_required instead of removed auth_supported for RBD
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.
1 parent 6764ca5 commit d698613

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public static String RBDStringBuilder(KVMStoragePool storagePool, String image)
5454
rbdOpts += ":mon_host=" + composeOptionForMonHosts(monHost, monPort);
5555

5656
if (authUserName == null) {
57-
rbdOpts += ":auth_supported=none";
57+
rbdOpts += ":auth_client_required=none";
5858
} else {
59-
rbdOpts += ":auth_supported=cephx";
59+
rbdOpts += ":auth_client_required=cephx";
6060
rbdOpts += ":id=" + authUserName;
6161
rbdOpts += ":key=" + authSecret;
6262
}

plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDiskTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void testRBDStringBuilder() {
4444
Mockito.doReturn(authUserName).when(kvmStoragePoolMock).getAuthUserName();
4545
Mockito.doReturn(authSecret).when(kvmStoragePoolMock).getAuthSecret();
4646

47-
String expected = "rbd:volume1:mon_host=ceph-monitor\\:8000:auth_supported=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
47+
String expected = "rbd:volume1:mon_host=ceph-monitor\\:8000:auth_client_required=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
4848
String result = KVMPhysicalDisk.RBDStringBuilder(kvmStoragePoolMock, "volume1");
4949

5050
Assert.assertEquals(expected, result);
@@ -62,7 +62,7 @@ public void testRBDStringBuilder2() {
6262

6363
String expected = "rbd:volume1:" +
6464
"mon_host=ceph-monitor1\\:3300\\;ceph-monitor2\\:3300\\;ceph-monitor3\\:3300:" +
65-
"auth_supported=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
65+
"auth_client_required=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
6666
String actualResult = KVMPhysicalDisk.RBDStringBuilder(kvmStoragePoolMock, "volume1");
6767

6868
Assert.assertEquals(expected, actualResult);
@@ -80,7 +80,7 @@ public void testRBDStringBuilder3() {
8080

8181
String expected = "rbd:volume1:" +
8282
"mon_host=[fc00\\:1234\\:\\:1]\\:3300\\;[fc00\\:1234\\:\\:2]\\:3300\\;[fc00\\:1234\\:\\:3]\\:3300:" +
83-
"auth_supported=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
83+
"auth_client_required=cephx:id=admin:key=supersecret:rbd_default_format=2:client_mount_timeout=30";
8484
String actualResult = KVMPhysicalDisk.RBDStringBuilder(kvmStoragePoolMock, "volume1");
8585

8686
Assert.assertEquals(expected, actualResult);

0 commit comments

Comments
 (0)