diff --git a/README.md b/README.md index ab1562a..ebff8a2 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Run this action to create an iscsi target. $ juju run-action ceph-iscsi/0 create-target \ image-size=2G \ image-name=bob \ + pool-name=superssd \ client-initiatorname=iqn.1993-08.org.debian:01:aaa2299be916 \ client-username=usera \ client-password=testpass @@ -136,3 +137,9 @@ Alternatively, configuration can be provided as part of a bundle: cluster: cluster-space ``` + + +[cg]: https://docs.openstack.org/charm-guide +[cdg]: https://docs.openstack.org/project-deploy-guide/charm-deployment-guide +[juju-docs-spaces]: https://jaas.ai/docs/spaces +[juju-docs-actions]: https://jaas.ai/docs/actions diff --git a/actions.yaml b/actions.yaml index 1759867..3f8091a 100644 --- a/actions.yaml +++ b/actions.yaml @@ -34,6 +34,10 @@ create-target: type: string default: disk_1 description: "Image name " + pool-name: + type: string + default: iscsi + description: "Name of ceph pool to use to back target " client-initiatorname: type: string description: "The initiator name of the client that will mount the target" @@ -44,6 +48,7 @@ create-target: type: string description: "The CHAPs password to be created for the client" required: + - pool-name - image-size - image-name - client-initiatorname diff --git a/config.yaml b/config.yaml index 291d5d1..e2416e7 100644 --- a/config.yaml +++ b/config.yaml @@ -35,11 +35,11 @@ options: 192.168.0.0/24). If multiple networks are to be used, a space-delimited list of a.b.c.d/x can be provided. - rbd-pool: + rbd-metadata-pool: type: string default: iscsi description: | - RBD pool to use for iscsi backend. + RBD pool to use to store gateway configuration. prefer-ipv6: type: boolean default: False diff --git a/src/charm.py b/src/charm.py index 34e6745..2c3897e 100755 --- a/src/charm.py +++ b/src/charm.py @@ -160,7 +160,7 @@ class CephISCSIGatewayCharmBase(ops_openstack.OSBaseCharm): gw_client.add_disk_to_client( target, event.params['client-initiatorname'], - self.model.config['rbd-pool'], + self.model.config['pool-name'], event.params['image-name']) event.set_results({'iqn': target}) @@ -203,7 +203,7 @@ class CephISCSIGatewayCharmBase(ops_openstack.OSBaseCharm): def on_ceph_client_relation_joined(self, event): logging.info("Requesting replicated pool") self.ceph_client.create_replicated_pool( - self.model.config['rbd-pool']) + self.model.config['rbd-metadata-pool']) logging.info("Requesting permissions") self.ceph_client.request_ceph_permissions( 'ceph-iscsi', diff --git a/templates/iscsi-gateway.cfg b/templates/iscsi-gateway.cfg index f439fa8..3c06842 100644 --- a/templates/iscsi-gateway.cfg +++ b/templates/iscsi-gateway.cfg @@ -5,7 +5,7 @@ logger_level = DEBUG cluster_name = ceph cluster_client_name = client.ceph-iscsi -pool = {{ options.rbd_pool }} +pool = {{ options.rbd_metadata_pool }} # # # Place a copy of the ceph cluster's admin keyring in the gateway's /etc/ceph # # drectory and reference the filename here diff --git a/tests/bundles/focal.yaml b/tests/bundles/focal.yaml index 5390b86..19b7281 100644 --- a/tests/bundles/focal.yaml +++ b/tests/bundles/focal.yaml @@ -8,7 +8,7 @@ applications: series: focal num_units: 2 options: - rbd-pool: tmbtil + rbd-metadata-pool: tmbtil ceph-osd: charm: cs:~gnuoy/ceph-osd-5 num_units: 3