Skip to contentSkip to conversation

targetcli do not show iscsi

DISCUSSION Luigi Tarenga 3 participants 19 messages Sep 30, 2014 – Oct 1, 2014 1 message not in the archive SCSI

lore
Share & tools
lore
#0 lore raw

hi everybody,
I write to you for a problem that sound as my simple mistake but I can't really find a solution after googling and reading official doc.

I'm trying to configure a iscsi target on a centos 6.5 box with a custom kernel compiled from vanilla 3.16.3.

I have compile:
CONFIG_TARGET_CORE=m
CONFIG_ISCSI_TARGET=m
CONFIG_CONFIGFS_FS=m

I mount configfs:

# mount | grep config
configfs on /sys/kernel/config type configfs (rw)

manually load iscsi_target_mod (and this show nothing in dmesg)

and when I run targetcli ls command this is the output:

# targetcli ls
o- / ..................................................................... [...]
  o- backstores 
.......................................................... [...]
  | o- block ................................................ [0 
Storage Object]
  | o- fileio ............................................... [0 
Storage Object]
  | o- pscsi ................................................ [0 
Storage Object]
  o- loopback ...................................................... [0 
Targets]

I can't see "o- iscsi" so I can't create the iscsi target i need...

# targetcli version
targetcli version 2.0rc1.fb16
$ ls /sys/kernel/config/target/
core  version
# lsmod | grep scsi
iscsi_target_mod      205464  0
target_core_mod       229493  1 iscsi_target_mod
configfs               22151  3 iscsi_target_mod,target_core_mod
scsi_mod               93246  6 iscsi_target_mod,target_core_mod,sg,sd_mod,sr_mod,libata

any idea of what I can check?

many thanks in advance
Luigi

#1 lore raw

Hi Luigi,

I am not 100% sure of that, as you are using the -fb branch, but it seems to me you haven't got the /sys/kernel/config/target/iscsi/ directory. Normally this is created by the initscript.

Can you either try creating it manually, and/or starting the target service susing the initscript ?

Best,
--
Jerome

Quoted 57 lines · Luigi Tarenga

hi everybody,
I write to you for a problem that sound as my simple mistake but I can't really find a solution after googling and reading official doc.

I'm trying to configure a iscsi target on a centos 6.5 box with a custom kernel compiled from vanilla 3.16.3.

I have compile:
CONFIG_TARGET_CORE=m
CONFIG_ISCSI_TARGET=m
CONFIG_CONFIGFS_FS=m

I mount configfs:

# mount | grep config
configfs on /sys/kernel/config type configfs (rw)

manually load iscsi_target_mod (and this show nothing in dmesg)

and when I run targetcli ls command this is the output:

# targetcli ls
o- /
..................................................................... [...]
   o- backstores
.......................................................... [...]
   | o- block ................................................ [0
Storage Object]
   | o- fileio ............................................... [0
Storage Object]
   | o- pscsi ................................................ [0
Storage Object]
   o- loopback ...................................................... [0
Targets]

I can't see "o- iscsi" so I can't create the iscsi target i need...

# targetcli version
targetcli version 2.0rc1.fb16
$ ls /sys/kernel/config/target/
core  version
# lsmod | grep scsi
iscsi_target_mod      205464  0
target_core_mod       229493  1 iscsi_target_mod
configfs               22151  3 iscsi_target_mod,target_core_mod
scsi_mod               93246  6
iscsi_target_mod,target_core_mod,sg,sd_mod,sr_mod,libata

any idea of what I can check?

many thanks in advance
Luigi
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Hi Jerome,
thanks for the promptly reply. I'm not using the -fb branch. I have installed targetcli from centos rpm:

# rpm -qi fcoe-target-utils-2.0rc1.fb16-5.el6.noarch
Name        : fcoe-target-utils            Relocations: (not relocatable)
Version     : 2.0rc1.fb16                       Vendor: CentOS
Release     : 5.el6                         Build Date: Fri 22 Nov 2013 06:52:35 PM CET
Install Date: Mon 29 Sep 2014 03:13:11 PM CEST      Build Host: c6b9.bsys.dev.centos.org
Group       : System Environment/Libraries   Source RPM: fcoe-target-utils-2.0rc1.fb16-5.el6.src.rpm
Size        : 188886                           License: AGPLv3
Signature   : RSA/SHA1, Sun 24 Nov 2013 08:29:11 PM CET, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem <http://bugs.centos.org>
URL         : https://github.com/agrover/targetcli-fb
Summary     : An administration shell for FCoE storage targets
Description :
An administration shell for TCM/LIO storage targets, most notably
Fiber Channel over Ethernet (FCoE) targets.

I'm not sure what is the initscript you mention. I have in /etc/init.d/:

# ls fcoe-target iscsi*
fcoe-target  iscsi  iscsid

but afaik those are for the initiatior or fcoe-target...

I tryed to manually create the directory but nothing changed:

# ll /sys/kernel/config/target/
total 0
drwxr-xr-x 3 root root    0 Sep 30 10:25 core
drwxr-xr-x 3 root root    0 Sep 30 10:59 iscsi
-r--r--r-- 1 root root 4096 Sep 30 10:59 version
[root@lizard init.d]#
[root@lizard init.d]# targetcli ls
o- / ......................................................................................................................... [...]
  o- backstores 
.............................................................................................................. [...]
  | o- block 
.................................................................................................... [0 Storage Object]
  | o- fileio 
................................................................................................... [0 Storage Object]
  | o- pscsi 
.................................................................................................... [0 Storage Object]
  o- loopback 
.......................................................................................................... [0 Targets]

the only difference I see is that the module is now used:
iscsi_target_mod 205464 1

and I can't rmmod it.

Luigi

Quoted 68 lines · Jerome Martin

Hi Luigi,

I am not 100% sure of that, as you are using the -fb branch, but it seems to me you haven't got the /sys/kernel/config/target/iscsi/ directory. Normally this is created by the initscript.

Can you either try creating it manually, and/or starting the target service susing the initscript ?

Best,

Signature · 1 line
Jerome
Quoted 57 lines · Luigi Tarenga

hi everybody,
I write to you for a problem that sound as my simple mistake but I can't really find a solution after googling and reading official doc.

I'm trying to configure a iscsi target on a centos 6.5 box with a custom kernel compiled from vanilla 3.16.3.

I have compile:
CONFIG_TARGET_CORE=m
CONFIG_ISCSI_TARGET=m
CONFIG_CONFIGFS_FS=m

I mount configfs:

# mount | grep config
configfs on /sys/kernel/config type configfs (rw)

manually load iscsi_target_mod (and this show nothing in dmesg)

and when I run targetcli ls command this is the output:

# targetcli ls
o- /
..................................................................... [...]
   o- backstores
.......................................................... [...]
   | o- block ................................................ [0
Storage Object]
   | o- fileio ............................................... [0
Storage Object]
   | o- pscsi ................................................ [0
Storage Object]
   o- loopback ...................................................... [0
Targets]

I can't see "o- iscsi" so I can't create the iscsi target i need...

# targetcli version
targetcli version 2.0rc1.fb16
$ ls /sys/kernel/config/target/
core  version
# lsmod | grep scsi
iscsi_target_mod      205464  0
target_core_mod       229493  1 iscsi_target_mod
configfs               22151  3 iscsi_target_mod,target_core_mod
scsi_mod               93246  6
iscsi_target_mod,target_core_mod,sg,sd_mod,sr_mod,libata

any idea of what I can check?

many thanks in advance
Luigi

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
#3 lore raw

Hi Luigi,

Quoted 2 lines · Luigi Tarenga

Hi Jerome,
thanks for the promptly reply. I'm not using the -fb branch.

Yes you are:

Quoted 2 lines

I have installed targetcli from centos rpm:

# rpm -qi fcoe-target-utils-2.0rc1.fb16-5.el6.noarch

See the version here? ....fb16...

Quoted 5 lines

I'm not sure what is the initscript you mention. I have in /etc/init.d/:

# ls fcoe-target iscsi*
fcoe-target  iscsi  iscsid

but afaik those are for the initiatior or fcoe-target...

Well, given the name of the redhat package, my best best would be fcoe-target :-)

Quoted 1 line

I tryed to manually create the directory but nothing changed:

Mmmh. ok.

I'll have to take a look at that installing a centos 6.5 box, or we can wait for Andy (who maintains the fb branch) to be around, whichever comes first. I would still try that initscript first though :-)

Quoted 112 lines
# ll /sys/kernel/config/target/
total 0
drwxr-xr-x 3 root root    0 Sep 30 10:25 core
drwxr-xr-x 3 root root    0 Sep 30 10:59 iscsi
-r--r--r-- 1 root root 4096 Sep 30 10:59 version
[root@lizard init.d]#
[root@lizard init.d]# targetcli ls
o- /
.........................................................................................................................
[...]
   o- backstores
..............................................................................................................
[...]
   | o- block
....................................................................................................
[0 Storage Object]
   | o- fileio
...................................................................................................
[0 Storage Object]
   | o- pscsi
....................................................................................................
[0 Storage Object]
   o- loopback
..........................................................................................................
[0 Targets]

the only difference I see is that the module is now used:
iscsi_target_mod 205464 1

and I can't rmmod it.

Luigi

Quoted 6 lines · Jerome Martin

Hi Luigi,

I am not 100% sure of that, as you are using the -fb branch, but it seems to me you haven't got the /sys/kernel/config/target/iscsi/ directory. Normally this is created by the initscript.

Quoted 67 lines

Can you either try creating it manually, and/or starting the target service susing the initscript ?

Best,
--
Jerome

Quoted 59 lines · Luigi Tarenga

hi everybody,
I write to you for a problem that sound as my simple mistake but I can't really find a solution after googling and reading official doc.

I'm trying to configure a iscsi target on a centos 6.5 box with a custom kernel compiled from vanilla 3.16.3.

I have compile:
CONFIG_TARGET_CORE=m
CONFIG_ISCSI_TARGET=m
CONFIG_CONFIGFS_FS=m

I mount configfs:

# mount | grep config
configfs on /sys/kernel/config type configfs (rw)

manually load iscsi_target_mod (and this show nothing in dmesg)

and when I run targetcli ls command this is the output:

# targetcli ls
o- /
.....................................................................
[...]
   o- backstores
.......................................................... [...]
   | o- block ................................................ [0
Storage Object]
   | o- fileio ............................................... [0
Storage Object]
   | o- pscsi ................................................ [0
Storage Object]
   o- loopback ...................................................... [0
Targets]

I can't see "o- iscsi" so I can't create the iscsi target i need...

# targetcli version
targetcli version 2.0rc1.fb16
$ ls /sys/kernel/config/target/
core  version
# lsmod | grep scsi
iscsi_target_mod      205464  0
target_core_mod       229493  1 iscsi_target_mod
configfs               22151  3 iscsi_target_mod,target_core_mod
scsi_mod               93246  6
iscsi_target_mod,target_core_mod,sg,sd_mod,sr_mod,libata

any idea of what I can check?

many thanks in advance
Luigi
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 6 lines
Quoted 3 lines

I have installed targetcli from centos rpm:

# rpm -qi fcoe-target-utils-2.0rc1.fb16-5.el6.noarch

See the version here? ....fb16...

oh ok.

Quoted 8 lines
Quoted 5 lines

I'm not sure what is the initscript you mention. I have in /etc/init.d/:

# ls fcoe-target iscsi*
fcoe-target  iscsi  iscsid

but afaik those are for the initiatior or fcoe-target...

Well, given the name of the redhat package, my best best would be fcoe-target :-)

I started it but still no luck, actually I had to comment out 2 module loading since I didn't compiled them (can this be the problem? would be strange since there is no module dependencies...):

load_modules()

{
    errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
    errmsg=$( /sbin/modprobe target_core_mod 2>&1 ) || return 1
    #errmsg=$( /sbin/modprobe target_core_pscsi 2>&1 ) || return 1
    errmsg=$( /sbin/modprobe target_core_file 2>&1 ) || return 1
    #errmsg=$( /sbin/modprobe target_core_iblock 2>&1 ) || return 1

    return 0
}

Luigi

#5 lore raw

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Best,
--
Jerome

Quoted 41 lines · Luigi Tarenga
Quoted 6 lines
Quoted 3 lines

I have installed targetcli from centos rpm:

# rpm -qi fcoe-target-utils-2.0rc1.fb16-5.el6.noarch

See the version here? ....fb16...

oh ok.

Quoted 9 lines
Quoted 5 lines

I'm not sure what is the initscript you mention. I have in /etc/init.d/:

# ls fcoe-target iscsi*
fcoe-target  iscsi  iscsid

but afaik those are for the initiatior or fcoe-target...

Well, given the name of the redhat package, my best best would be fcoe-target :-)

I started it but still no luck, actually I had to comment out 2 module loading since I didn't
compiled them (can this be the problem? would be strange since there is no module
dependencies...):

load_modules()

{
     errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
     errmsg=$( /sbin/modprobe target_core_mod 2>&1 ) || return 1
     #errmsg=$( /sbin/modprobe target_core_pscsi 2>&1 ) || return 1
     errmsg=$( /sbin/modprobe target_core_file 2>&1 ) || return 1
     #errmsg=$( /sbin/modprobe target_core_iblock 2>&1 ) || return 1

     return 0
}

Luigi
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 8 lines · Jerome Martin

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Best,

Signature · 1 line
Jerome

didn't test that configuration and since I can't find module iscsi_target_mod in stock kernel I would have to recompile it against centos kernel. It's worth trying?

btw, I saw that after loading the module and manually create the iscsi directory this content automatically appear:

# ll /sys/kernel/config/target/iscsi/
total 0
drwxr-xr-x 2 root root    0 Sep 30 11:38 discovery_auth
-r--r--r-- 1 root root 4096 Sep 30 11:39 lio_version

I start suspecting a problem with targetcli or configshell. I regenerated the log.txt file:

# targetcli /iscsi info
No such path /iscsi
# cat log.txt
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:932 run_cmdline() Running command line '/iscsi info'.
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:837 _parse_cmdline() Parsing commandline.
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:844 _parse_cmdline() [('path', 0, 6, []), ('command', 7, 11, None)]
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:848 _parse_cmdline() Found path token /iscsi.
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:848 _parse_cmdline() Found command token info.
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/shell.py:861 _parse_cmdline() Parse gave path='/iscsi' command='info' pparams=[] kparams={}
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/node.py:1857 get_node() Looking for path '/iscsi'
[DEBUG] 2014-30-09 11:40:52 /usr/lib/python2.6/site-packages/configshell/node.py:1857 get_node() Looking for path 'iscsi'
[ERROR] 2014-30-09 11:40:52 No such path /iscsi

Luigi

#7 lore raw
Quoted 7 lines · Luigi Tarenga
Quoted 5 lines · Jerome Martin

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Quoted 7 lines
Quoted 4 lines

Best,
--
Jerome

didn't test that configuration and since I can't find module iscsi_target_mod in stock

ok

Quoted 2 lines

kernel I would have to recompile it against centos kernel. It's worth trying?

Sure :-)

Quoted 9 lines

btw, I saw that after loading the module and manually create the iscsi directory this
content automatically appear:

# ll /sys/kernel/config/target/iscsi/
total 0
drwxr-xr-x 2 root root    0 Sep 30 11:38 discovery_auth
-r--r--r-- 1 root root 4096 Sep 30 11:39 lio_version

Yes, it means that the iscsi module is correctly loaded.

Quoted 3 lines

I start suspecting a problem with targetcli or configshell. I regenerated the log.txt file:

Yes, as I said earlier I'll have to reproduce your setup and/or wait for Andy to come around.

Quoted 37 lines
# targetcli /iscsi info
No such path /iscsi
# cat log.txt
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:932 run_cmdline()
Running command line '/iscsi info'.
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:837
_parse_cmdline() Parsing commandline.
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:844
_parse_cmdline() [('path', 0, 6, []), ('command', 7, 11, None)]
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:848
_parse_cmdline() Found path token /iscsi.
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:848
_parse_cmdline() Found command token info.
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/shell.py:861
_parse_cmdline() Parse gave path='/iscsi' command='info' pparams=[]
kparams={}
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/node.py:1857 get_node()
Looking for path '/iscsi'
[DEBUG] 2014-30-09 11:40:52
/usr/lib/python2.6/site-packages/configshell/node.py:1857 get_node()
Looking for path 'iscsi'
[ERROR] 2014-30-09 11:40:52 No such path /iscsi

Luigi
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 10 lines · Jerome Martin
Quoted 7 lines · Luigi Tarenga
Quoted 5 lines · Jerome Martin

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Best,
--
Jerome

didn't test that configuration and since I can't find module iscsi_target_mod in stock

iscsi is not a supported fabric on rhel/centos 6. Only FCoE uses LIO. scsi-target-utils (tgt) is the supported iscsi target on rhel6. rhel7 uses LIO for both, as does Fedora.

Regards -- Andy

#9 lore raw
Quoted 3 lines · Andy Grover

iscsi is not a supported fabric on rhel/centos 6. Only FCoE uses LIO. scsi-target-utils (tgt) is the supported iscsi target on rhel6. rhel7 uses LIO for both, as does Fedora.

Ha, that explains it then. Thanks Andy.

#10 lore raw
In reply to Andy Grover
Quoted 16 lines · Andy Grover
Quoted 15 lines · Jerome Martin
Quoted 12 lines · Luigi Tarenga
Quoted 9 lines · Jerome Martin

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Best,

Signature · 1 line
Jerome
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

didn't test that configuration and since I can't find module iscsi_target_mod in stock

iscsi is not a supported fabric on rhel/centos 6. Only FCoE uses LIO. scsi-target-utils (tgt) is the supported iscsi target on rhel6. rhel7 uses LIO for both, as does Fedora.

Regards -- Andy

Hi Andy,
I see LIO is a technology preview on rhel 6 but I'm not looking for official support, just play with it :) that said I have a custom kernel compiled from vanilla so if we esclude some problem with udev or other userspace services only kernel modules and targetcli is involved in this configuration. I hope someone that maintain this module have some time to help me to get it running otherwise I will try to use scst (actually I compiled and installed it but still have to configure it).

My final goal is to have a litttle lab that let me write an integration module for my failover cluster manager ( https://code.google.com/p/back-to-work/ ). I need to implement scsi fencing without destroying a production server connected to a real SAN :P

Luigi

#11 lore raw
Quoted 32 lines · Luigi Tarenga
Quoted 16 lines · Andy Grover
Quoted 15 lines · Jerome Martin
Quoted 12 lines · Luigi Tarenga
Quoted 9 lines · Jerome Martin

Luigi,

Out of curiosity, does it work as expected with the stock fedora packaged kernel ?

Best,

Signature · 1 line
Jerome
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

didn't test that configuration and since I can't find module iscsi_target_mod in stock

iscsi is not a supported fabric on rhel/centos 6. Only FCoE uses LIO. scsi-target-utils (tgt) is the supported iscsi target on rhel6. rhel7 uses LIO for both, as does Fedora.

Regards -- Andy

Hi Andy,
I see LIO is a technology preview on rhel 6 but I'm not looking for official support, just play with it :) that said I have a custom kernel compiled from vanilla so if we esclude some problem with udev or other userspace services only kernel modules and targetcli is involved in this configuration. I hope someone that maintain this module have some time to help me to get it running otherwise I will try to use scst (actually I compiled and installed it but still have to configure it).

Quoted 5 lines

My final goal is to have a litttle lab that let me write an integration module for my failover cluster manager ( https://code.google.com/p/back-to-work/ ). I need to implement scsi fencing without destroying a production server connected to a real SAN :P

Luigi

Maybe I misunderstood your statement. Are you saying that the targetcli I'm using (fb16) does not support iscsi fabric? In this case I will try to use the git version.

Luigi

#12 lore raw
Quoted 16 lines
Quoted 16 lines
Quoted 5 lines

iscsi is not a supported fabric on rhel/centos 6. Only FCoE uses LIO. scsi-target-utils (tgt) is the supported iscsi target on rhel6. rhel7 uses LIO for both, as does Fedora.

Regards -- Andy

Hi Andy,
I see LIO is a technology preview on rhel 6 but I'm not looking for official support, just play with it :) that said I have a custom kernel compiled from vanilla so if we esclude some problem with udev or other userspace services only kernel modules and targetcli is involved in this configuration. I hope someone that maintain this module have some time to help me to get it running otherwise I will try to use scst (actually I compiled and installed it but still have to configure it).

My final goal is to have a litttle lab that let me write an integration module for my failover cluster manager ( https://code.google.com/p/back-to-work/ ). I need to implement scsi fencing without destroying a production server connected to a real SAN :P

Quoted 8 lines
Quoted 1 line

Luigi

Maybe I misunderstood your statement. Are you saying that the targetcli I'm using (fb16) does not support iscsi fabric? In this case I will try to use the git version.

Luigi

got it working :D

# targetcli
targetcli shell version 2.1.fb37
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> ls
o- / ...................................................................................................................... [...]
o- backstores
........................................................................................................... [...]
| o- block
............................................................................................... [Storage Objects: 0]
| o- fileio
.............................................................................................. [Storage Objects: 0]
| o- pscsi
............................................................................................... [Storage Objects: 0]
| o- ramdisk
............................................................................................. [Storage Objects: 0]
o- iscsi
......................................................................................................... [Targets: 0]
o- loopback
...................................................................................................... [Targets: 0]
o- sbp
........................................................................................................... [Targets: 0]
o- vhost
......................................................................................................... [Targets: 0] />

I installed the last version from https://fedorahosted.org/releases/t/a/targetcli-fb/
and fortunally I had python2.7 installed in /usr/local (I don't remember why I installed it :D)

builded and installed using python2.7

Thanks Andy for your hint and excuse me if I seemed stubborn :) Thank to Martin too for his support!

regards
Luigi

#13 lore raw
Quoted 2 lines · Luigi Tarenga

Thanks Andy for your hint and excuse me if I seemed stubborn :) Thank to Martin too for his support!

The first name's Jerome :-)

Just a quick note, as you are apparently doing some R&D, may I suggest that you test v3.x instead ? I can use all reports I can get, and this is the way forward :-)

Regards,
--
Jerome

#14 lore raw
Quoted 11 lines · Jerome Martin
Quoted 2 lines · Luigi Tarenga

Thanks Andy for your hint and excuse me if I seemed stubborn :) Thank to Martin too for his support!

The first name's Jerome :-)

Just a quick note, as you are apparently doing some R&D, may I suggest that you test v3.x instead ? I can use all reports I can get, and this is the way forward :-)

Regards,

Signature · 1 line
Jerome

oops... ok Jerome I'll be happy to help doing some tests. Just forgive me, I'm very new to LIO:
what do you mean for v3.x?
python3?
kernel 3.x? (I'm using 3.16.3)
or the targetcli branch from Datera?

Luigi

#15 lore raw
Quoted 5 lines · Luigi Tarenga

On 09/30/2014 06:52 PM, Jerome Martin wrote:
oops... ok Jerome I'll be happy to help doing some tests. Just forgive me, I'm very new to LIO:
what do you mean for v3.x?

I mean targetcli version 3.x

Quoted 1 line

or the targetcli branch from Datera?

OK, as you are new, a little catchup summary :-)

The "targetcli branch from Datera" is the main targetcli repository.
I am actually the original author of targetcli, and still develop it using the Datera repository on GitHub, which is the official home for targetcli on the web.

The "fb" branch done by Andy is a fork of targetcli version 2, and is used in RedHat distributions.

If you look a bit in the mailing list, you'll also notice discussions with Andy to reunify his fork and my code.

Best,
--
Jerome

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw

Hi Luigi,

Quoted 19 lines · Luigi Tarenga

Hi Jerome,
I did some test with 3.x version but I have some problem. Let's start saying i cloned your git repos.

I have a problem generating the rpm with all 3 package (configshell, rtslib, targetcli):

# make rpm
Exporting the repository files...
Cleaning up the target tree...
Fixing version string...
Generating rpm specfile from template...
Generating rpm changelog...
Generating debian changelog...
Generated release tarball:
     dist/configshell-1.5-4-g0827baa.tar.gz
Building rpm packages...
error: line 7: Illegal char '-' in: Version:        1.5-4-g0827baa
make: *** [build/rpm-stamp] Error 1
Quoted 1 line

the error is the same, seem you can't use a hyphen in the version.

Ah, right.
I need to update that, there were some changes in the versionning that breaks the included RPM packaging. Typically the packaging from the git repo is only used for development as distros tend to bin it and replace with their own. I will fix that ASAP.

Quoted 1 line

For now I gave up building rpm and did a simple ./setup.py install:

Great :-)
However, you should generate a release first (make release) and then do the install from the generated tarball, as this will extract version information etc. from the git repo. Also, you will need to install the initscript manually.

Quoted 21 lines

still having an issue about the listing of iscsi fabric:

# /usr/bin/targetcli ls
o- /
.........................................................................................................................
[...]
   o- backstores
..............................................................................................................
[...]
     o- fileio
...................................................................................................
[0 Storage Object]
     o- iblock
...................................................................................................
[0 Storage Object]
     o- pscsi
....................................................................................................
[0 Storage Object]
     o- rd_mcp
...................................................................................................
[0 Storage Object]
Quoted 7 lines
# /usr/bin/targetcli version
Cannot find configshell version. The configshell package has probably
not been built properly from either the git repository or a public tarball.
Cannot find rtslib version. The rtslib package has probably not been
built properly from either the git repository or a public tarball.
Cannot find targetcli version. The targetcli package has probably not
been built properly from either the git repository or a public tarball.

This is what I was talking about above, you need to generate a release tarball first (make release).

Quoted 3 lines

I tried with both python (stock from centos) and python2.7 (compiled from source in /usr/local)

So, again, I would like to reproduce and solve this on CentOS / RHEL. Can you confirm this is version 6.5 with custom-built kernel 3.16.3 ?

In any case, thanks for testing, I need that badly :-)

Best Regards,
--
Jerome

#18 lore raw
Quoted 10 lines

So, again, I would like to reproduce and solve this on CentOS / RHEL. Can you confirm this is version 6.5 with custom-built kernel 3.16.3 ?

In any case, thanks for testing, I need that badly :-)

Best Regards,

Signature · 1 line
Jerome

Hi Jerome,
I confirm I have a centos 6.5 x86_64 with custom kernel and I'm using python2.7 compiled from source too (since this works for targetcli-fb)

I reinstalled everything (from your git repos) with:
make cleanall
make release
cd dist
tar xvf xxxx.tar.gz
cd xxxx
./setup.py build
./setup.py install

I left the LIO configured from a the former fb version:
this was the output with fb:

# targetcli
targetcli shell version 2.1.fb37
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> ls
o- / ......................................................................................................................... [...]
o- backstores
.............................................................................................................. [...]
| o- block
.................................................................................................. [Storage Objects: 0]
| o- fileio
................................................................................................. [Storage Objects: 1]
| | o- test1
.................................................................. [/root/lun-test1 (10.0MiB) write-back deactivated]
| o- pscsi
.................................................................................................. [Storage Objects: 0]
| o- ramdisk
................................................................................................ [Storage Objects: 0]
o- iscsi
............................................................................................................ [Targets: 1]
| o- iqn.2003-01.org.linux-iscsi.lizard.x8664:sn.29470994615c
.......................................................... [TPGs: 1]
| o- tpg1
............................................................................................... [no-gen-acls, no-auth]
| o- acls
.......................................................................................................... [ACLs: 0]
| o- luns
.......................................................................................................... [LUNs: 0]
| o- portals
.................................................................................................... [Portals: 1]
| o- 0.0.0.0:3260
..................................................................................................... [OK]
o- loopback
......................................................................................................... [Targets: 0]
o- sbp
.............................................................................................................. [Targets: 0]
o- vhost
............................................................................................................ [Targets: 0] /> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json

(between the 2 test I removed the -fb version to avoid mixing libs)

now I had to make some little mod to the init script because it seems to target centos7/rhel7:
so this is the patch I used for target.init:

target.init.custom 2014-10-01 14:17:57.343006241 +0200 renamed from target.init 2014-07-31 19:07:30.000000000 +0200 +17 -3
@@ -9,7 +9,7 @@
 ### END INIT INFO
 
 # PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
+#PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="The Linux SCSI Target"
 NAME=target
 DAEMON=/usr/bin/targetcli
@@ -25,10 +25,24 @@
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 # Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
+#. /lib/init/vars.sh
 
 # Define LSB log_* functions - requires lsb-base (>= 3.2-14)
-. /lib/lsb/init-functions
+#. /lib/lsb/init-functions
+
+alias python="python2.7"
+
+log_failure_msg () {
+   echo "$@"
+}
+
+log_action_msg () {
+   echo "$@"
+}
+
+log_warning_msg () {
+   echo "$@"
+}
 
 

and this is the output when I start it:

# ./target.init.custom start
Possible config migration detected, saving the  running target to /etc/target/scsi_target.lio
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
562, in load_live
    source=source, allow_new_attrs=True)
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
190, in _load_parse_tree
    token = self.validate_obj(token, cur)
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
385, in validate_obj
    raise ConfigError("Unknown object type: %s" % obj_type)
rtslib.config.ConfigError: Unknown object type: storage
The Linux SCSI Target looks properly installed
The configfs filesystem is already mounted
Core module target_core_mod already loaded
Failed to load core module target_core_pscsi
Could not start The Linux SCSI Target
# targetcli
targetcli 3.0~pre2-5-g7e32595 (rtslib 3.0~pre2-8-g86e46bc)
Copyright (c) 2011-2014 by Datera, Inc.
All rights reserved.

/> ls
o- / ......................................................................................................................... [...]
o- backstores
.............................................................................................................. [...]
o- fileio
................................................................................................... [1 Storage Object]

    | o- test1 

............................................................................... [/root/lun-test1 (10.0M) deactivated]
o- iblock
................................................................................................... [0 Storage Object]
o- pscsi
.................................................................................................... [0 Storage Object]
o- rd_mcp
................................................................................................... [0 Storage Object] /> exit
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 990, in run_interactive

    self._cli_loop()

File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 820, in _cli_loop
self.run_cmdline(cmdline)
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 934, in run_cmdline
self._execute_command(path, command, pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 909, in _execute_command
result = target.execute_command(command, pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/targetcli/ui_node.py",
line 103, in execute_command
pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/configshell/node.py",
line 1416, in execute_command
result = method(*pparams, **kparams)
File "/usr/local/lib/python2.7/site-packages/targetcli/ui_node.py",
line 119, in ui_command_exit
config.load_live()
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
562, in load_live
source=source, allow_new_attrs=True)
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
190, in _load_parse_tree
token = self.validate_obj(token, cur)
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
385, in validate_obj
raise ConfigError("Unknown object type: %s" % obj_type)
ConfigError: Unknown object type: storage

Luigi

PS: should we keep linux-scsi ML in cc?

#19 lore raw
Quoted 191 lines · Luigi Tarenga
Quoted 10 lines

So, again, I would like to reproduce and solve this on CentOS / RHEL. Can you confirm this is version 6.5 with custom-built kernel 3.16.3 ?

In any case, thanks for testing, I need that badly :-)

Best Regards,

Signature · 1 line
Jerome

Hi Jerome,
I confirm I have a centos 6.5 x86_64 with custom kernel and I'm using python2.7 compiled from source too (since this works for targetcli-fb)

I reinstalled everything (from your git repos) with:
make cleanall
make release
cd dist
tar xvf xxxx.tar.gz
cd xxxx
./setup.py build
./setup.py install

I left the LIO configured from a the former fb version:
this was the output with fb:

# targetcli
targetcli shell version 2.1.fb37
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> ls
o- / ......................................................................................................................... [...]
o- backstores
.............................................................................................................. [...]
| o- block
.................................................................................................. [Storage Objects: 0]
| o- fileio
................................................................................................. [Storage Objects: 1]
| | o- test1
.................................................................. [/root/lun-test1 (10.0MiB) write-back deactivated]
| o- pscsi
.................................................................................................. [Storage Objects: 0]
| o- ramdisk
................................................................................................ [Storage Objects: 0]
o- iscsi
............................................................................................................ [Targets: 1]
| o- iqn.2003-01.org.linux-iscsi.lizard.x8664:sn.29470994615c
.......................................................... [TPGs: 1]
| o- tpg1
............................................................................................... [no-gen-acls, no-auth]
| o- acls
.......................................................................................................... [ACLs: 0]
| o- luns
.......................................................................................................... [LUNs: 0]
| o- portals
.................................................................................................... [Portals: 1]
| o- 0.0.0.0:3260
..................................................................................................... [OK]
o- loopback
......................................................................................................... [Targets: 0]
o- sbp
.............................................................................................................. [Targets: 0]
o- vhost
............................................................................................................ [Targets: 0] /> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json

(between the 2 test I removed the -fb version to avoid mixing libs)

now I had to make some little mod to the init script because it seems to target centos7/rhel7:
so this is the patch I used for target.init:

target.init.custom 2014-10-01 14:17:57.343006241 +0200 renamed from target.init 2014-07-31 19:07:30.000000000 +0200 +0 -0
@@ -9,7 +9,7 @@
 ### END INIT INFO
 
 # PATH should only include /usr/* if it runs after the mountnfs.sh 

script

target.init.custom 2014-10-01 14:17:57.343006241 +0200 renamed from target.init 2014-07-31 19:07:30.000000000 +0200 +17 -3
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
+#PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="The Linux SCSI Target"
 NAME=target
 DAEMON=/usr/bin/targetcli
@@ -25,10 +25,24 @@
 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
 # Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
+#. /lib/init/vars.sh
 
 # Define LSB log_* functions - requires lsb-base (>= 3.2-14)
-. /lib/lsb/init-functions
+#. /lib/lsb/init-functions
+
+alias python="python2.7"
+
+log_failure_msg () {
+   echo "$@"
+}
+
+log_action_msg () {
+   echo "$@"
+}
+
+log_warning_msg () {
+   echo "$@"
+}
 
 

and this is the output when I start it:

# ./target.init.custom start
Possible config migration detected, saving the  running target to /etc/target/scsi_target.lio
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
562, in load_live
    source=source, allow_new_attrs=True)
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
190, in _load_parse_tree
    token = self.validate_obj(token, cur)
  File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line 
385, in validate_obj
    raise ConfigError("Unknown object type: %s" % obj_type)
rtslib.config.ConfigError: Unknown object type: storage
The Linux SCSI Target looks properly installed
The configfs filesystem is already mounted
Core module target_core_mod already loaded
Failed to load core module target_core_pscsi
Could not start The Linux SCSI Target
# targetcli
targetcli 3.0~pre2-5-g7e32595 (rtslib 3.0~pre2-8-g86e46bc)
Copyright (c) 2011-2014 by Datera, Inc.
All rights reserved.

/> ls
o- / ......................................................................................................................... [...]
o- backstores
.............................................................................................................. [...]
o- fileio
................................................................................................... [1 Storage Object]

    | o- test1 

............................................................................... [/root/lun-test1 (10.0M) deactivated]
o- iblock
................................................................................................... [0 Storage Object]
o- pscsi
.................................................................................................... [0 Storage Object]
o- rd_mcp
................................................................................................... [0 Storage Object] /> exit
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 990, in run_interactive

    self._cli_loop()

File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 820, in _cli_loop
self.run_cmdline(cmdline)
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 934, in run_cmdline
self._execute_command(path, command, pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/configshell/shell.py",
line 909, in _execute_command
result = target.execute_command(command, pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/targetcli/ui_node.py",
line 103, in execute_command
pparams, kparams)
File "/usr/local/lib/python2.7/site-packages/configshell/node.py",
line 1416, in execute_command
result = method(*pparams, **kparams)
File "/usr/local/lib/python2.7/site-packages/targetcli/ui_node.py",
line 119, in ui_command_exit
config.load_live()
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
562, in load_live
source=source, allow_new_attrs=True)
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
190, in _load_parse_tree
token = self.validate_obj(token, cur)
File "/usr/local/lib/python2.7/site-packages/rtslib/config.py", line
385, in validate_obj
raise ConfigError("Unknown object type: %s" % obj_type)
ConfigError: Unknown object type: storage

Quoted 3 lines

Luigi

PS: should we keep linux-scsi ML in cc?

I forgot this:

Quoted 1 line

version

Using configshell version 1.5-4-g0827baa
Using rtslib version 3.0~pre2-8-g86e46bc
Using targetcli version 3.0~pre2-5-g7e32595

Luigi