Bug 1316185 - targetcli: Failed to map LUN to Initiator WWN
Summary: targetcli: Failed to map LUN to Initiator WWN
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: fcoe-target-utils
Version: 6.8
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Maurizio Lombardi
QA Contact: Storage QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-09 15:35 UTC by Bruno Goncalves
Modified: 2018-03-19 11:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-06 10:25:26 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Bruno Goncalves 2016-03-09 15:35:30 UTC
Description of problem:
Trying to map a LUN manually to an specific initiator fails.

# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/acls/21:00:00:0e:1e:1a:60:61 create 0 lun0
Incorrect LUN value.


# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/acls/21:00:00:0e:1e:1a:60:61 create 0 0
Traceback (most recent call last):
  File "/usr/bin/targetcli", line 90, in <module>
    main()
  File "/usr/bin/targetcli", line 73, in main
    shell.run_cmdline(" ".join(sys.argv[1:]))
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 934, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 909, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_node.py", line 84, in execute_command
    pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/node.py", line 1405, in execute_command
    result = method(*pparams, **kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_target.py", line 781, in ui_command_create
    if tpg_lun_or_backstore.startswith("lun"):
UnboundLocalError: local variable 'tpg_lun_or_backstore' referenced before assignment


Version-Release number of selected component (if applicable):
fcoe-target-utils-2.0rc1.fb16-6

How reproducible:
100%

Steps to Reproduce:
1.Create a fileio backstore LUN
# targetcli /backstores/fileio create test test.img 1G
Using params size=1G write_back=True sparse=True
Created fileio test with size 1073741824

2.Add LUN to tcm_fc target
# targetcli /tcm_fc/ create 20:00:90:e2:ba:a3:97:ca
Created target 20:00:90:e2:ba:a3:97:ca.

3. Add LUN to target
# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/luns create /backstores/fileio/test
Created LUN 0.

4.Add Initiator WWN to target without mapping LUNs
# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/acls create 21:00:00:0e:1e:1a:60:61 add_mapped_luns=false
Created Node ACL for 21:00:00:0e:1e:1a:60:61

5. Add LUN to initiator
# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/acls/21:00:00:0e:1e:1a:60:61 create 0 0
(Call trace)

# targetcli /tcm_fc/20:00:90:e2:ba:a3:97:ca/acls/21:00:00:0e:1e:1a:60:61 create 0 lun0
Incorrect LUN value.

Comment 2 xhe@redhat.com 2017-11-08 04:25:53 UTC
I hit the same issue on latest release rhel6.10, will you fix it on 6.10?
fcoe-target-utils-2.0rc1.fb16-6.el6.noarch
2.6.32-696.13.2.el6.x86_64


[root@storageqe-53 ~]# targetcli
targetcli shell version 2.0rc1.fb16
Copyright 2011 by RisingTide Systems LLC and others.
For help on commands, type 'help'.
/> ls
/> /tcm_fc/20:01:00:0a:f7:27:e1:b1/acls/20:00:a0:36:9f:7c:1e:bd  create 0 0
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 990, in run_interactive
    self._cli_loop()
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 813, in _cli_loop
    self.run_cmdline(cmdline)
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 934, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/shell.py", line 909, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_node.py", line 84, in execute_command
    pparams, kparams)
  File "/usr/lib/python2.6/site-packages/configshell/node.py", line 1405, in execute_command
    result = method(*pparams, **kparams)
  File "/usr/lib/python2.6/site-packages/targetcli/ui_target.py", line 781, in ui_command_create
    if tpg_lun_or_backstore.startswith("lun"):
UnboundLocalError: local variable 'tpg_lun_or_backstore' referenced before assignment

Comment 3 Jan Kurik 2017-12-06 10:25:26 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/


Note You need to log in before you can comment on or make changes to this bug.