Bug 1316185 - targetcli: Failed to map LUN to Initiator WWN
targetcli: Failed to map LUN to Initiator WWN
Status: NEW
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: fcoe-target-utils (Show other bugs)
6.8
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Andy Grover
Bruno Goncalves
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-09 10:35 EST by Bruno Goncalves
Modified: 2017-03-01 06:22 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bruno Goncalves 2016-03-09 10:35:30 EST
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.

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