Trouble getting LIO working on Ubuntu 13.40

1,042 views
Skip to first unread message

Blake Garner

unread,
Sep 15, 2013, 3:32:08 PM9/15/13
to linux-iscsi-...@googlegroups.com
I'm attempting to get LIO working on Ubuntu 13.40 and running into what seems like configuration issues. 


Added these to /etc/modules and rebuilt the boot ramdisk using  update-initramfs -u
qla2xxx
tcm_qla2xxx
target_core_mod

Installed targetcli via 
apt-get install targetcli

When attempting to start targetcli I'm getting the following errors. 


# targetcli
Welcome to the targetcli shell:

 Copyright (c) 2011 by RisingTide Systems LLC.


Traceback (most recent call last):
  File "/usr/bin/targetcli", line 80, in <module>
    main()
  File "/usr/bin/targetcli", line 73, in main
    root_node.refresh()
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_root.py", line 46, in refresh
    UIBackstores(self)
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 50, in __init__
    self.refresh()
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 54, in refresh
    UIPSCSIBackstore(self)
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 183, in __init__
    UIBackstore.__init__(self, 'pscsi', parent)
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 68, in __init__
    self.refresh()
  File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 72, in refresh
    for so in RTSRoot().storage_objects:
  File "/usr/lib/python2.7/dist-packages/rtslib/root.py", line 67, in __init__
    self._create_in_cfs_ine('any')
  File "/usr/lib/python2.7/dist-packages/rtslib/node.py", line 71, in _create_in_cfs_ine
    os.mkdir(self.path)
OSError: [Errno 2] No such file or directory: '/sys/kernel/config/target'

Further investigation shows this error also. 

# /etc/init.d/target start
Loading target_core_mod/ConfigFS core:   [OK]
Calling ConfigFS script /etc/target/tcm_start.sh for target_core_mod:   [FAILED]
Calling ConfigFS script /etc/target/lio_start.sh for iscsi_target_mod:   [FAILED]
Calling ConfigFS script /etc/target/fc_start.sh:   [FAILED]
Calling ConfigFS script /etc/target/loopback_start.sh:   [FAILED]
Calling ConfigFS script /etc/target/qla2xxx_start.sh:   [FAILED]
Calling ConfigFS script /etc/target/srpt_start.sh:   [FAILED]

And it looks like tcm_node is not happy.. 

# tcm_node
/sys/kernel/config/target/version No such file or directory
Is kernel module loaded?

From the instructions on the wiki I have set things up as needed. However something is not right or missing from the kernel modules? 

Suggestions on what I'm missing? 

Thanks,
Blake




Nicholas A. Bellinger

unread,
Sep 16, 2013, 4:24:40 PM9/16/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
Hi Blake,
This means that configfs has not been loaded and/or mounted under
/sys/kernel/config.

/etc/init.d/target will normally be doing this at 'target start' time,
so I'm unsure why this is not happening as usual on your Ubuntu 13.40
setup.

You can confirm by adding configfs to your /etc/modules, and include
the following line in /etc/fstab:

configfs /sys/kernel/config configfs defaults 0 0

--nab


Blake Garner

unread,
Sep 16, 2013, 11:20:30 PM9/16/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
Ok so turns out that you don't want to have any of the modules listed in /etc/modules . When you create the /etc/modules.d/qla2xxx.conf file with options qlini_mode="disabled" you need to rebuild ramdisk. Once I did that things work as expected. Might be a good tip for the wiki however. 

Right now my problem is the zfs zvol I created is not showing up under /dev/disks/by-id. This seems to be a zfs issue from what I can tell. 

Thanks,
Blake

Nicholas A. Bellinger

unread,
Sep 17, 2013, 3:38:43 PM9/17/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
On Mon, 2013-09-16 at 20:20 -0700, Blake Garner wrote:
> Ok so turns out that you don't want to have any of the modules listed
> in /etc/modules . When you create the /etc/modules.d/qla2xxx.conf file
> with options qlini_mode="disabled" you need to rebuild ramdisk.

I assume you mean /etc/modprobe.d/qla2xx.conf here. ;)

> Once I did that things work as expected. Might be a good tip for the
> wiki however.
>

<nod>, adding a note that initrd/initramfs needs to be rebuilt under:

http://www.linux-iscsi.org/wiki/Fibre_Channel#Enable_target_mode

>
> Right now my problem is the zfs zvol I created is not showing up
> under /dev/disks/by-id. This seems to be a zfs issue from what I can
> tell.

FYI, targetcli should be already filtering zfs zvol major/minor ranges
so they can be used by IBLOCK.

--nab


Blake Garner

unread,
Sep 17, 2013, 6:15:47 PM9/17/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel


On Tuesday, September 17, 2013 12:38:43 PM UTC-7, n...@linux-iscsi.org wrote:
On Mon, 2013-09-16 at 20:20 -0700, Blake Garner wrote:
> Ok so turns out that you don't want to have any of the modules listed
> in /etc/modules . When you create the /etc/modules.d/qla2xxx.conf file
> with options qlini_mode="disabled" you need to rebuild ramdisk.

I assume you mean /etc/modprobe.d/qla2xx.conf here.  ;)

Yes 

>  Once I did that things work as expected. Might be a good tip for the
> wiki however.
>

<nod>, adding a note that initrd/initramfs needs to be rebuilt under:

http://www.linux-iscsi.org/wiki/Fibre_Channel#Enable_target_mode

>
> Right now my problem is the zfs zvol I created is not showing up
> under /dev/disks/by-id. This seems to be a zfs issue from what I can
> tell.

FYI, targetcli should be already filtering zfs zvol major/minor ranges
so they can be used by IBLOCK.

I'm not clear on what you are saying here. 

What path to the zvol should I be using ideally? Every one I attempted other than /dev/disks/by-* gave me an error about not being a block device.  

--nab

Thanks! 

Nicholas A. Bellinger

unread,
Sep 18, 2013, 12:28:29 AM9/18/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
On Tue, 2013-09-17 at 15:15 -0700, Blake Garner wrote:
>
> On Tuesday, September 17, 2013 12:38:43 PM UTC-7, n...@linux-iscsi.org
> wrote:

<SNIP>

> > Right now my problem is the zfs zvol I created is not
> showing up
> > under /dev/disks/by-id. This seems to be a zfs issue from
> what I can
> > tell.
>
> FYI, targetcli should be already filtering zfs zvol
> major/minor ranges
> so they can be used by IBLOCK.
>
>
> I'm not clear on what you are saying here.
>
> What path to the zvol should I be using ideally? Every one I attempted
> other than /dev/disks/by-* gave me an error about not being a block
> device.
>

The filtering is done by zvol major number, which in current rtslib code
is defined as '230'.

The patch to add this to the list of type_disk_known_majors is here:

Added ZFS ZVols to list of accepted TYPE_DISK
http://www.risingtidesystems.com/git/?p=rtslib.git;a=commitdiff;h=655e87fcf85040d51f90d3fea4b550f33388319f

--nab

Blake Garner

unread,
Sep 18, 2013, 2:26:07 AM9/18/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
Ok so sounds like I need to build from source instead of just using the version from the package system on ubuntu server 13.4. I'll give that a shot. 

Once I'm on that version this should work? 

/backstores> iblock/ create name=disk_name dev=/dev/zvol/zfspoolname/zfszvolname

Thanks,
Blake

Nicholas A. Bellinger

unread,
Sep 18, 2013, 2:49:20 AM9/18/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
On Tue, 2013-09-17 at 23:26 -0700, Blake Garner wrote:
> Ok so sounds like I need to build from source instead of just using
> the version from the package system on ubuntu server 13.4. I'll give
> that a shot.
>

Yes, Ubuntu's 13.4's python-rtslib package is v2.1, and has not been
updated to v2.2 as of yet. v2.2 is now in Debian unstable, and should
be making it's way downstream to Ubuntu in the near future. Opening a
request in launchpad would likely make that happen quicker too.

Also, it's easy enough to add this one line patch to rtslib/utils.py
code as well.

>
> Once I'm on that version this should work?
> /backstores> iblock/ create name=disk_name dev=/dev/zvol/zfspoolname/zfszvolname
>

Correct.

--nab


Blake Garner

unread,
Sep 18, 2013, 12:57:43 PM9/18/13
to linux-iscsi-...@googlegroups.com, Blake Garner, target-devel
Ok I updated the file /usr/lib/python2.7/dist-packages/rtslib/utils.py and added the line from the patch and it's working! 

Thanks for the help!
Reply all
Reply to author
Forward
0 new messages