From 82779e5ff9a579610f2e1b4af557ee4ef2ede202 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 --- 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 747ee21..9ace9cc 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': @@ -566,7 +566,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 02e29ab..f4d6c3a 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',