WARNING: proposed future configshell API breakage
by Andy Grover
Hi all,
Is targetcli-fb still the only user of configshell-fb? Other users would
hopefully be on this list, right? Well, I sure hope so...
One long-standing issue with targetcli is that when giving it single
commands from the command line, it doesn't return a nonzero error code
if there's an error of certain types -- it prints a message, but a
success error code. This makes it hard for targetcli to be scripted. Not
that I think scripting targetcli is a great way to do things, but people
seem to be doing it a lot.
The fix for this is to change the way configshell's command loop works,
so that critical ExecutionError exceptions aren't swallowed by
configshell, but propagate to the caller (in targetcli's case,
"scripts/targetcli"). The caller then has the option to print the error
and continue (likely what you want to do if in interactive mode) or exit
with an error (what we want to do for cmdline mode).
So, before I go ahead, any objections, or discussion? Speak up, or I'm
going ahead early next week :)
Regards -- Andy
10 years, 1 month
Problem creating acl in 2.1.fb30
by David Costa
Hi,
I am trying to create an acl for fcoe with targetcli 2.1.fb30 running
on Fedora 19 and see this:
/tcm_fc/naa.2000001b213fa52f> acls/ create 20:00:00:0e:1e:14:85:98
WWN not valid as: naa
On exit a traceback is generated, I have copied the commands entered and
the targetcli output listed below. Am I doing something wrong?
Thank you,
Dave Costa
targetcli
targetcli shell version 2.1.fb30
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/backstores/b...coe_backstore> ls
o- fcoe_backstore
...................................................................
[/dev/sdc1 (93.1GiB) write-thru deactivated]
/backstores/b...coe_backstore> cd /
/> ls
o- /
.......................................................................................................................
[...]
o- backstores
............................................................................................................
[...]
| o- block
................................................................................................
[Storage Objects: 1]
| | o- fcoe_backstore
............................................................. [/dev/sdc1
(93.1GiB) write-thru deactivated]
| o- fileio
...............................................................................................
[Storage Objects: 0]
| o- pscsi
................................................................................................
[Storage Objects: 0]
| o- ramdisk
..............................................................................................
[Storage Objects: 0]
o- iscsi
..........................................................................................................
[Targets: 0]
o- loopback
.......................................................................................................
[Targets: 0]
o- tcm_fc
.........................................................................................................
[Targets: 0]
o- vhost
..........................................................................................................
[Targets: 0]
/> /tcm_fc create 20:00:00:1b:21:3f:a5:2f
Created target naa.2000001b213fa52f.
/> ls
o- /
.......................................................................................................................
[...]
o- backstores
............................................................................................................
[...]
| o- block
................................................................................................
[Storage Objects: 1]
| | o- fcoe_backstore
............................................................. [/dev/sdc1
(93.1GiB) write-thru deactivated]
| o- fileio
...............................................................................................
[Storage Objects: 0]
| o- pscsi
................................................................................................
[Storage Objects: 0]
| o- ramdisk
..............................................................................................
[Storage Objects: 0]
o- iscsi
..........................................................................................................
[Targets: 0]
o- loopback
.......................................................................................................
[Targets: 0]
o- tcm_fc
.........................................................................................................
[Targets: 1]
| o- naa.2000001b213fa52f
........................................................................................
[no-gen-acls]
| o- acls
..........................................................................................................
[ACLs: 0]
| o- luns
..........................................................................................................
[LUNs: 0]
o- vhost
..........................................................................................................
[Targets: 0]
/> cd /tcm_fc/naa.2000001b213fa52f/
/tcm_fc/naa.2000001b213fa52f> luns/ create /backstores/block/fcoe_backstore
Created LUN 0.
/tcm_fc/naa.2000001b213fa52f> la
Command not found la
/tcm_fc/naa.2000001b213fa52f> ls
o- naa.2000001b213fa52f
............................................................................................
[no-gen-acls]
o- acls
..............................................................................................................
[ACLs: 0]
o- luns
..............................................................................................................
[LUNs: 1]
o- lun0
...................................................................................
[block/fcoe_backstore (/dev/sdc1)]
/tcm_fc/naa.2000001b213fa52f> acls/ create 20:00:00:0e:1e:14:85:98
WWN not valid as: naa
/tcm_fc/naa.2000001b213fa52f> acls/ create
Missing required parameter wwn
/tcm_fc/naa.2000001b213fa52f> acls/ create naa.2000000e1e148598
This NodeACL already exists in configFS.
/tcm_fc/naa.2000001b213fa52f> exit
Global pref auto_save_on_exit=true
Traceback (most recent call last):
File "/usr/bin/targetcli", line 89, in <module>
main()
File "/usr/bin/targetcli", line 85, in main
root_node.ui_command_saveconfig()
File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line
69, in ui_command_saveconfig
f.write(json.dumps(RTSRoot().dump(), sort_keys=True, indent=2))
File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 131, in dump
d['targets'] = [t.dump() for t in self.targets]
File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 75, in
_list_targets
for target in fabric_module.targets:
File "/usr/lib/python2.7/site-packages/rtslib/fabric.py", line 170,
in _list_targets
yield Target(self, self.from_fabric_wwn(wwn), 'lookup')
File "/usr/lib/python2.7/site-packages/rtslib/target.py", line 72, in
__init__
self.wwn, self.wwn_type = fabric_module.to_normalized_wwn(wwn)
File "/usr/lib/python2.7/site-packages/rtslib/fabric.py", line 190,
in to_normalized_wwn
return normalize_wwn(self.wwn_types, wwn, self.wwns)
File "/usr/lib/python2.7/site-packages/rtslib/utils.py", line 332, in
normalize_wwn
raise RTSLibError("WWN not valid as: %s" % ", ".join(wwn_types))
rtslib.utils.RTSLibError: WWN not valid as: naa
10 years, 1 month
How can I customize LIO device name?
by Irwin
Hi
I've not tried any other initiators, other than the native one in
Windows 7 as LIO will be booting these diskless. In Windows device
manager, the non-fb branch would show as "LIO-ORG SCSI Disk Device" if
I've not mistaken. Now that I've transitioned into targetcli-fb, the
device now shows as "LIO-ORG example_backend SCSI Disk Device". Because
I'll be having dynamic/generated backends, this becomes an issue in that
Windows tries to install drivers for the new device each time, prompting
a reboot. I need to change it back to a "static" device name. My
knowledge in coding is limited, particularly in python, I've been trying
to dig through the rtslib-fb code but am unable to work it out.
Can anyone help me out here?
Thanks
Irwin
10 years, 1 month