Bad args to iscsiadm for iSCSI multipath target

Bug #1838820 reported by Chris M
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned
os-brick
Fix Released
Undecided
Unassigned

Bug Description

Cinder 3rd party CI tests fail for multipath iSCSI targets due to an incorrect invocation of iscsiadm:

Called from connect_volume() in a multipath, multiattach configuration, ISCSIConnector._recover_node_startup_values() passes an iqn wrapped in a list to _iscsiadm_update() via the connection properties 'target_iqn' field, but _iscsiadm_update() expects a plain string which will be used as a command line argument to iscsiadm's -T option. This results in an unexpected iscsiadm failure which aborts the connection attempt.

The system is running Ubuntu 16.04 with open-iscsi 2.0.873+git0.3b4b4500-14ubuntu3.7.

Patching _recover_node_startup_values() to pass a scalar instead of a list appears to solve the problem:

diff --git a/os_brick/initiator/connectors/iscsi.py b/os_brick/initiator/connectors/iscsi.py
index a875b76..c428772 100644
--- a/os_brick/initiator/connectors/iscsi.py
+++ b/os_brick/initiator/connectors/iscsi.py
@@ -1178,7 +1178,7 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector):
                 # as discovering target.
                 # So target_iqn is updated, and other values aren't updated.
                 recover_connection = copy.deepcopy(connection_properties)
- recover_connection['target_iqn'] = [iqn]
+ recover_connection['target_iqn'] = iqn
                 self._iscsiadm_update(recover_connection,
                                       "node.startup",
                                       old_node_startup)

Attached is a stack trace showing the symptom. In this scenario a volume from the target has been attached to one instance and the test case is attempting to attach the same volume to a second instance.

Revision history for this message
Chris M (pots) wrote :
Revision history for this message
Chris M (pots) wrote :
description: updated
Chris M (pots)
affects: cinder → os-brick
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-brick (master)

Reviewed: https://review.opendev.org/674669
Committed: https://git.openstack.org/cgit/openstack/os-brick/commit/?id=81f26f822d66c71c29ea25fd4158ac41fc162964
Submitter: Zuul
Branch: master

commit 81f26f822d66c71c29ea25fd4158ac41fc162964
Author: Chris M <email address hidden>
Date: Mon Aug 5 18:13:33 2019 +0000

    Fix bad argument to iscsiadm in iSCSI discovery

    Fix a call to _iscsiadm_update() in which a list was being passed as
    the target_iqn connection property. This property is used directly as
    an argument to the iscsiadm -T option, so it must be a plain string.

    Change-Id: I9c2ff1de1f89fb49dd6c5a90679d5c4238d5476a
    Closes-bug: 1838820

Changed in os-brick:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-brick 2.10.0

This issue was fixed in the openstack/os-brick 2.10.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.