From 50bd805fb1b61c871b8c32f4ba2b90586624c636 Mon Sep 17 00:00:00 2001 From: Nobuto Murata Date: Wed, 1 Nov 2023 21:45:59 +0900 Subject: [PATCH] Don't set the default pool as "iscsi" "iscsi" is the name of the metadata pool by default in the charm and not to be used for tenant data. The charm can fill out the data pool name automatically with `def data_pool_name` or can accept a user specified value. After fixing the issue, the "iscsi" pool will be used only for hosting gateway.conf as a rados object so reflect the purpose into the application name for the pool too. Also, update the command syntax not to print the deprecation warning: "rbd: --user is deprecated, use --id" Closes-Bug: #2042419 Related-Bug: #2040274 Change-Id: Iec275190854edcc85915d93db233f444c92fbb17 (cherry picked from commit 82779e5ff9a579610f2e1b4af557ee4ef2ede202) --- actions.yaml | 2 -- src/charm.py | 4 ++-- unit_tests/test_ceph_iscsi_charm.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/actions.yaml b/actions.yaml index a474f3c..683e66e 100644 --- a/actions.yaml +++ b/actions.yaml @@ -42,11 +42,9 @@ create-target: description: "Image name " rbd-pool-name: type: string - default: iscsi description: "Name of ceph pool to use to back target " ec-rbd-metadata-pool: type: string - default: iscsi description: "Name of the metadata pool to use with rbd-pool-name if rbd-pool-name is erasure coded." client-initiatorname: type: string diff --git a/src/charm.py b/src/charm.py index 59b2595..b597b17 100755 --- a/src/charm.py +++ b/src/charm.py @@ -313,7 +313,7 @@ class CephISCSIGatewayCharmBase( return self.ceph_client.create_replicated_pool( self.config_get('gateway-metadata-pool'), - app_name='rbd') + app_name='rados') weight = self.config_get('ceph-pool-weight') replicas = self.config_get('ceph-osd-replication-count') if self.config_get('pool-type') == 'erasure-coded': @@ -539,7 +539,7 @@ class CephISCSIGatewayCharmBase( # as the gwcli does not currently handle the creation. cmd = [ 'rbd', - '--user', 'ceph-iscsi', + '--id', 'ceph-iscsi', '--conf', str(self.CEPH_CONF), 'create', '--size', event.params['image-size'], diff --git a/unit_tests/test_ceph_iscsi_charm.py b/unit_tests/test_ceph_iscsi_charm.py index b5d3083..dcf49f6 100644 --- a/unit_tests/test_ceph_iscsi_charm.py +++ b/unit_tests/test_ceph_iscsi_charm.py @@ -288,7 +288,7 @@ class TestCephISCSIGatewayCharmBase(CharmTestCase): self.subprocess.check_call.assert_called_once_with( [ 'rbd', - '--user', 'ceph-iscsi', + '--id', 'ceph-iscsi', '--conf', '/etc/ceph/iscsi/ceph.conf', 'create', '--size', '5G',