Access to targetcli utility is completely forbidden upon creation of invalid wwn

Solution Verified - Updated -

Issue

  • Can not delete invalid WWN created in targetcli.
  • targetcli does not allow to modify targetcli configuration after creation of invalid wwn
  • Targetcli adds system host name in the automatically generated iSCSI wwn names. If the system hostname has _ or Blank space then it is treated as invalid iqn/wwn name.
/> iscsi/ create 
Created target iqn.2003-01.org.linux-iscsi.rhel_storage2.x8664:sn.ef7eb28bb6ee.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.

/>ls
o- / ............................................................................ [...]
[...]
  o- iscsi ...................................................................... [Targets: 2]
  | o- iqn.2003-01.org.linux-iscsi.rhel_storage2.x8664:sn.ef7eb28bb6ee .......... [INVALID WWN]  <<<< Invalid wwn/iqn with "_"
  | | o- tpg1 ................................................................... [no-gen-acls, no-auth]
[...]
  • After this targetcli won't allow to modify any of the current configuration not even deletion of invalid wwn.
/> iscsi/ delete iqn.2003-01.org.linux-iscsi.rhel_storage2.x8664:sn.ef7eb28bb6ee 
WWN not valid as: iqn, naa, eui
  • While exiting from the targetcli system throws below call traces.
/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Traceback (most recent call last):
  File "/usr/bin/targetcli", line 121, in <module>
    main()
  File "/usr/bin/targetcli", line 117, in main
    root_node.ui_command_saveconfig()
  File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 90, in ui_command_saveconfig
    self.rtsroot.save_to_file(savefile)
  File "/usr/lib/python2.7/site-packages/rtslib_fb/root.py", line 270, in save_to_file
    f.write(json.dumps(self.dump(), sort_keys=True, indent=2))
  File "/usr/lib/python2.7/site-packages/rtslib_fb/root.py", line 161, in dump
    d['targets'] = [t.dump() for t in self.targets]
  File "/usr/lib/python2.7/site-packages/rtslib_fb/root.py", line 81, in _list_targets
    for target in fabric_module.targets:
  File "/usr/lib/python2.7/site-packages/rtslib_fb/fabric.py", line 173, in _list_targets
    yield Target(self, self.from_fabric_wwn(wwn), 'lookup')
  File "/usr/lib/python2.7/site-packages/rtslib_fb/target.py", line 75, in __init__
    self.wwn, self.wwn_type = fabric_module.to_normalized_wwn(wwn)
  File "/usr/lib/python2.7/site-packages/rtslib_fb/fabric.py", line 193, in to_normalized_wwn
    return normalize_wwn(self.wwn_types, wwn)
  File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 397, in normalize_wwn
    raise RTSLibError("WWN not valid as: %s" % ", ".join(wwn_types))
rtslib_fb.utils.RTSLibError: WWN not valid as: iqn, naa, eui
  • The further access to targetcli will be completely forbidden with below error.
# targetcli 
WWN not valid as: iqn, naa, eui

Environment

Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content