iscsi connector #1

Supports: bionic focal

Description

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.

Overview

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.

Quickstart

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

Scaling

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

Troubleshooting

If the iscsi discovery or login fails, compare the exit status number with the iscsiadm documentation at https://linux.die.net/man/8/iscsiadm to understand the cause of the error.

Contact


Configuration

discovery-and-login
(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.
True
initiator-dictionary
(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}'
{}
iscsi-node-session-auth-authmethod
(string) Authentication method (CHAP or None). Default is None.
iscsi-node-session-auth-password
(string) CHAP password for initiator authentication by the target
iscsi-node-session-auth-password-in
(string) CHAP password for target authentication by the initiator
iscsi-node-session-auth-username
(string) CHAP username for initiator authentication by the target
iscsi-node-session-auth-username-in
(string) CHAP username for target authentication by the initiator
iscsi-node-session-iscsi-fastabort
(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'.
Yes
iscsi-node-session-scan
(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'.
auto
iscsi-node-startup
(string) Startup setting for sessions. Either 'automatic' or 'manual'
automatic
multipath-conf-devices
(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" }
port
(string) ISCSI target port
target
(string) ISCSI target IP