Create iscsi volume from image fails when use_multipath_for_image_xfer=True

Bug #1749254 reported by Lucio Seki on 2018-02-13
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Cinder fails to create an iSCSI volume from image when multipath is enabled for image transfer, and no targets were discovered yet.

Steps to reproduce:
- prepare a host with no iSCSI targets discovered yet;
- in cinder.conf, set use_multipath_for_image_xfer=True;
- try to create an iSCSI volume from an image.

Expected result: an iSCSI volume to be created successfully.

Actual result: TargetPortalNotFound exception is raised by os_brick/initiator/connectors/

Lucio Seki (lseki) wrote :

Analyzing the logs, I observed that the execution sequence is as follows:

connect_volume -> _connect_multipath_volume -> _get_ips_iqns_luns -> _discover_iscsi_portals -> _get_node_startup_values -> _run_iscsiadm_bare -> ProcessExecutionError: Unexpected error while running command.

Where ProcessExecutionError says:

ProcessExecutionError: Unexpected error while running command.
Command: iscsiadm -m node --op show -p
Exit code: 21
Stdout: u''
Stderr: u'iscsiadm: No records found\n'

and is followed by another ProcessExecutionError:

Command: iscsiadm -m discoverydb -o show -P 1
Exit code: 21
Stdout: u'SENDTARGETS:\nNo targets found.\niSNS:\nNo targets found.\nSTATIC:\nNo targets found.\nFIRMWARE:\nNo targets found.\n'
Stderr: u''

This exception is catched by _get_ips_iqns_luns, who raises as exception.TargetPortalNotFound.

This error occurs because _discover_iscsi_portals attempts to discover targtes, but first it tries to get a list of already discovered "old_node_startups", and fails if no targets were discovered yet.

The bug can be solved by making _get_node_startup_values accept exit_code=21 from _run_iscsiadm_bare, indicating that there are no old node startup values at all.

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

Other bug subscribers