iscsi connector #1

Supports: bionic focal


The ISCSI Connector charm is an open-source charm that can be installed as a subordinate to any VM or baremetal machine. It configures the node to connect to a specific ISCSI target.

iSCSI Connector Charm

Deprecation Notice

This charm has been replaced by the cs:storage-connector charm which supports both iSCSI and FibreChannel connections. This charm is no longer maintained.


This charm configures a unit to connect to an iscsi endpoint. It acts as a subordinate charm, which can be deployed on any baremetal or virtual machine, alongside a main charm. It is not supported in containers.

This charm will: - Generate an iscsi initiator name and put it in /etc/iscsi/initiatorname.iscsi - Install the package multipath-tools - Configure /etc/multipath.conf for the correct array - Restart the services iscsid, open-iscsi - Perform an iscsi discovery against a target - Login to the target - Restart the service multipathd

The user can input a initiator name dictionary in config.yaml if he wishes to use a specific iqn for a specific unit. Also, the target IP and port are needed to perform the discovery and login with iscsiadm.


To build the charm, use the Make actions. These actions use the charmcraft tool, so make sure to install it beforehand:

snap install charmcraft
make build

This will create the iscsi-connector.charm file and place it in the .build directory.

To deploy this subordinate charm on a ubuntu unit, deploy cs:ubuntu first.

juju add-model my-test-model
juju deploy cs:ubuntu --series bionic
juju deploy cs:iscsi-connector
juju relate ubuntu iscsi-connector

To edit the config of the target or the port:

juju config iscsi-connector target=<TARGET_IP> 
juju config iscsi-connector port=<PORT>

To restart services manually, two actions exist:

juju run-action --unit ubuntu/0 restart-iscsi-services
juju run-action --unit ubuntu/0 reload-multipathd-service


This charm will scale with the units it is related to. For example, if you scale the ubuntu application, and that the iscsi-connector is related to it, it will be deployed on each ubuntu units.

juju add-unit ubuntu
juju remove-unit ubuntu/1


If the iscsi discovery or login fails, compare the exit status number with the iscsiadm documentation at to understand the cause of the error.



(boolean) If set to True (default), the charm will configure the iscsid.conf and multipathd.conf configuration files, and then run a iscsiadm discovery and login against the target. If set to False, the charm will simply configure the unit but not run the discovery and login against the target.
(string) Dictionary of hostnames (fqdn) and initiator names, surrounded by single quotes. The charm compares the machine hostname to the list, and provide the correct initiator associated to it. If not defined, the initiator name will be provided randomly. Format : '{"hostname1": "iqn.yyyy-mm.naming-authority:uniquename1", "hostname2": "iqn.yyyy-mm.naming-authority:uniquename2}'
(string) Authentication method (CHAP or None). Default is None.
(string) CHAP password for initiator authentication by the target
(string) CHAP password for target authentication by the initiator
(string) CHAP username for initiator authentication by the target
(string) CHAP username for target authentication by the initiator
(string) Some targets like IET prefer after an initiator has sent a task management function like an ABORT TASK or LOGICAL UNIT RESET, that it does not respond to PDUs like R2Ts. To enable this behavior, set this config option to 'Yes'. To disable it, set it to 'No'.
(string) Automatic scans are performed on startup, on login, and on AEN/AER reception on devices supporting it. To prevent doing automatic scans that would add unwanted luns to the system, set to 'manual'. Default is 'auto'.
(string) Startup setting for sessions. Either 'automatic' or 'manual'
(string) In multipath.conf, add a device specific configuration. String should be of json dictionary format. Example: value : '{"vendor":"PURE","product": "FlashArray","fast_io_fail_tmo": "10", "path_grouping_policy":"group_by_prio"}' will produce this configuration: device { vendor "PURE" product "FlashArray" fast_io_fail_tmo 10 path_grouping_policy "group_by_prio" }
(string) ISCSI target port
(string) ISCSI target IP