Create iscsi volume from image fails when use_multipath_for_image_xfer=True
Bug #1749254 reported by
Lucio Seki
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_
- try to create an iSCSI volume from an image.
Expected result: an iSCSI volume to be created successfully.
Actual result: TargetPortalNot
To post a comment you must log in.
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 -> ProcessExecutio nError: Unexpected error while running command.
Where ProcessExecutio nError says:
ProcessExecutio nError: 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 ProcessExecutio nError:
Command: iscsiadm -m discoverydb -o show -P 1 nFIRMWARE: \nNo targets found.\n'
Exit code: 21
Stdout: u'SENDTARGETS:\nNo targets found.\niSNS:\nNo targets found.\nSTATIC:\nNo targets found.\
Stderr: u''
This exception is catched by _get_ips_iqns_luns, who raises as exception. TargetPortalNot Found.
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.