Package rtslib :: Module fabrics
[hide private]
[frames] | no frames]

Module fabrics


Copyright (c) 2011 by RisingTide Systems LLC
Copyright (c) 2013 by Andy Grover

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, version 3 (AGPLv3).

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


Description
-----------

Instead of having a class to handle each fabric type, rtslib uses a
single FabricModule class. An instance of FabricModule changes its
behavior depending on parameters it picks up from here. These used to
be listed in "spec" files, but are now here.


Available parameters
--------------------

* features
Lists the target fabric available features. Default value:
("discovery_auth", "acls", "acls_auth", "nps")
example: features = ("discovery_auth", "acls", "acls_auth")
example: features = () # no features supported

Detail of features:

  * tpgts
  The target fabric module is using iSCSI-style target portal group tags.

  * discovery_auth
  The target fabric module supports a fabric-wide authentication for
  discovery.
  
  * acls
  The target's TPGTs support explicit initiator ACLs.
  
  * acls_auth
  The target's TPGT's ACLs support per-ACL initiator authentication.
  
  * nps
  The TPGTs support iSCSI-like IPv4/IPv6 network portals, using IP:PORT
  group names.
  
  * nexus
  The TPGTs have a 'nexus' attribute that contains the local initiator
  serial unit. This attribute must be set before being able to create any
  LUNs.
  
* wwn_type
Sets the type of WWN expected by the target fabric. Defaults to 'free'.
Example: wwn_type = "iqn"
Current valid types are:

  * free
  Freeform WWN.

  * iqn
  The fabric module targets are using iSCSI-type IQNs.

  * naa
  NAA SAS address type WWN.

  * unit_serial
  Disk-type unit serial.

* wwns()
This function returns an iterable (either generator or list) of valid
target WWNs for the fabric, if WWNs should be chosen from existing
fabric interfaces. The most common case for this is hardware-set
WWNs. This function should return a string with the WWN formatted for
what the fabric module expects.

* kernel_module
Sets the name of the kernel module implementing the fabric modules. If
not specified, it will be assumed to be MODNAME_target_mod, where
MODNAME is the name of the fabric module, from the fabrics list. Note
that you must not specify any .ko or such extension here.
Example: kernel_module = "my_module"

* configfs_group
Sets the name of the configfs group used by the fabric module. Defaults to the
name of the module from the fabrics list.
Example: configfs_group = "iscsi"

Functions [hide private]
 
_colonize(str)
helper function to add colons every 2 chars
 
_srpt_wwns()
 
_qla_wwns()
 
_sbp_wwns()
 
_fc_wwns()
Variables [hide private]
  _ib_srpt = {'configfs_group': 'srpt', 'features': ('acls'), 'k...
  _iscsi = {'wwn_type': 'iqn'}
  _loopback = {'features': ('nexus'), 'kernel_module': 'tcm_loop...
  _qla2xxx = {'features': ('acls'), 'kernel_module': 'tcm_qla2xx...
  _sbp = {'features': (), 'kernel_module': 'sbp_target', 'wwns':...
  _tcm_fc = {'configfs_group': 'fc', 'features': ('acls'), 'kern...
  _usb_gadget = {'features': ('nexus'), 'kernel_module': 'tcm_us...
  fabrics = [('ib_srpt', {'configfs_group': 'srpt', 'features': ...
  _default_features = ('discovery_auth', 'acls', 'acls_auth', 'n...
  _default_wwn_type = 'free'
  specs = {'ib_srpt': {'configfs_group': 'srpt', 'features': ('a...
  __package__ = 'rtslib'
  f_name = 'tcm_fc'
  f_ovr = {'configfs_group': 'fc', 'features': ('acls'), 'kernel...
  fabric = {'configfs_group': 'fc', 'features': ('acls'), 'kerne...
Variables Details [hide private]

_ib_srpt

Value:
{'configfs_group': 'srpt',
 'features': ('acls'),
 'kernel_module': 'ib_srpt',
 'wwns': <function _srpt_wwns at 0x8fd1e2c>}

_loopback

Value:
{'features': ('nexus'),
 'kernel_module': 'tcm_loop',
 'wwn_type': 'naa'}

_qla2xxx

Value:
{'features': ('acls'),
 'kernel_module': 'tcm_qla2xxx',
 'wwns': <function _qla_wwns at 0x8fd917c>}

_sbp

Value:
{'features': (),
 'kernel_module': 'sbp_target',
 'wwns': <function _sbp_wwns at 0x8fd94fc>}

_tcm_fc

Value:
{'configfs_group': 'fc',
 'features': ('acls'),
 'kernel_module': 'tcm_fc',
 'wwns': <function _fc_wwns at 0x8fd94c4>}

_usb_gadget

Value:
{'features': ('nexus'),
 'kernel_module': 'tcm_usb_gadget',
 'wwn_type': 'naa'}

fabrics

Value:
[('ib_srpt',
  {'configfs_group': 'srpt',
   'features': ('acls'),
   'kernel_module': 'ib_srpt',
   'wwns': <function _srpt_wwns at 0x8fd1e2c>}),
 ('iscsi', {'wwn_type': 'iqn'}),
 ('loopback',
  {'features': ('nexus'), 'kernel_module': 'tcm_loop', 'wwn_type': 'na\
...

_default_features

Value:
('discovery_auth', 'acls', 'acls_auth', 'nps', 'tpgts')

specs

Value:
{'ib_srpt': {'configfs_group': 'srpt',
             'features': ('acls'),
             'kernel_module': 'ib_srpt',
             'wwn_list': [],
             'wwn_type': 'free'},
 'iscsi': {'configfs_group': 'iscsi',
           'features': ('discovery_auth',
                        'acls',
...

f_ovr

Value:
{'configfs_group': 'fc',
 'features': ('acls'),
 'kernel_module': 'tcm_fc',
 'wwns': <function _fc_wwns at 0x8fd94c4>}

fabric

Value:
{'configfs_group': 'fc',
 'features': ('acls'),
 'kernel_module': 'tcm_fc',
 'wwn_list': [],
 'wwn_type': 'free'}