Maximum number of iSCSI targets in FreeBSD10

Hi,

I've been looking into using FreeBSD as a storage platform for large numbers of iSCSI volumes. I've got things working quite smoothly with ctld exporting zvol's, but it seems I can only create 256 targets before I run into the following message:

Code:
Apr  2 17:03:42 kickpuncher kernel: ctl: can't allocate LUN on target 0, out of LUNs
Apr  2 17:03:42 kickpuncher ctld[2667]: error returned from LUN creation request: ctl_be_block_create: LUN configuration error, see dmesg for details

Is this an inherent limitation, or am I doing something wrong?
 
As far as I know this is a limitation of iSCSI, there are only 8 bits available for the LUN. But you should be able to define more targets, each with 255 LUNs.
 
SirDice said:
But you should be able to define more targets, each with 255 LUNs.

That's what I would have thought. My ctld.conf looks like this:
Code:
target iqn.2012-06.com.example:volume-1 {
        auth-group no-authentication
        portal-group pg0
        lun 0 {
                path /dev/zvol/test/volume-1
        }
}

target iqn.2012-06.com.example:volume-2 {
        auth-group no-authentication
        portal-group pg0
        lun 0 {
                path /dev/zvol/test/volume-2
        }
}

... and so on.

ctladm devlist shows this:

Code:
LUN Backend       Size (Blocks)   BS Serial Number    Device ID       
  0 block                  2048  512 MYSERIAL   0     MYDEVID   0     
  1 block                  2048  512 MYSERIAL   1     MYDEVID   1     
  2 block                  2048  512 MYSERIAL   2     MYDEVID   2     
  3 block                  2048  512 MYSERIAL   3     MYDEVID   3     
  4 block                  2048  512 MYSERIAL   4     MYDEVID   4     
  5 block                  2048  512 MYSERIAL   5     MYDEVID   5     
  ...

so it looks like LUN's are being numbered automatically.
 
I know enough about iSCSI to get it working and the problem you mentioned is an interesting one. I can imagine, especially with big storage servers, the need to have more than 255. Hopefully somebody with more iSCSI knowledge knows how to deal with that.

While searching for an answer I did find it's not specific to FreeBSD, it seems Windows suffers from the same limitations.
 
walterheukels said:
FYI, I've switched to istgt now, which is working fine. I'm guessing this is a kernel limitation then.
That's interesting. The ctld(8) is a new addition to FreeBSD 10.0, it's probably not complete yet. Hopefully that will be corrected with the next version.
 
Back
Top