Create iscsi volume from image fails when use_multipath_for_image_xfer=True

Bug #1749254 reported by Lucio Seki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-brick
Fix Released
Undecided
Unassigned

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/iscsi.py.

Revision history for this message
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 10.250.118.22:3260
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.

Revision history for this message
Gorka Eguileor (gorka) wrote :
Changed in os-brick:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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