Package rtslib :: Module target :: Class LUN
[hide private]
[frames] | no frames]

Class LUN

  object --+    
           |    
node.CFSNode --+
               |
              LUN

This is an interface to RTS Target LUNs in configFS. A LUN is identified by its parent TPG and LUN index.

Instance Methods [hide private]
 
__repr__(self)
repr(x)
 
__init__(self, parent_tpg, lun=None, storage_object=None, alias=None)
A LUN object can be instanciated in two ways:
 
_configure(self, storage_object, alias)
 
_get_alias(self)
 
_get_storage_object(self)
 
_get_parent_tpg(self)
 
_get_lun(self)
 
_list_mapped_luns(self)
 
delete(self)
If the underlying configFS object does not exist, this method does nothing.
 
dump(self)

Inherited from node.CFSNode: __eq__, __ne__, get_attribute, get_parameter, list_attributes, list_parameters, set_attribute, set_parameter

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
setup(cls, tpg_obj, lun, err_func)
Class Variables [hide private]
  MAX_LUN = 255
  parent_tpg = property(_get_parent_tpg, doc= "Get the parent TP...
  lun = property(_get_lun, doc= "Get the LUN index as an int.")
  storage_object = property(_get_storage_object, doc= "Get the s...
  alias = property(_get_alias, doc= "Get the LUN alias.")
  mapped_luns = property(_list_mapped_luns, doc= "List all Mappe...

Inherited from node.CFSNode: configfs_dir, exists, path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__init__(self, parent_tpg, lun=None, storage_object=None, alias=None)
(Constructor)

 

A LUN object can be instanciated in two ways:

  • Creation mode: If storage_object is specified, the underlying configFS object will be created with that parameter. No LUN with the same lun index can pre-exist in the parent TPG in that mode, or instanciation will fail.
  • Lookup mode: If storage_object is not set, then the LUN will be bound to the existing configFS LUN object of the parent TPG having the specified lun index. The underlying configFS object must already exist in that mode.
Parameters:
  • parent_tpg (TPG) - The parent TPG object.
  • lun (0-255) - The LUN index.
  • storage_object (StorageObject subclass) - The storage object to be exported as a LUN.
  • alias (string) - An optional parameter to manually specify the LUN alias. You probably do not need this.
Returns:
A LUN object.
Overrides: object.__init__

delete(self)

 

If the underlying configFS object does not exist, this method does nothing. If the underlying configFS object exists, this method attempts to delete it along with all MappedLUN objects referencing that LUN.

Overrides: node.CFSNode.delete

dump(self)

 
Overrides: node.CFSNode.dump

Class Variable Details [hide private]

parent_tpg

Value:
property(_get_parent_tpg, doc= "Get the parent TPG object.")

storage_object

Value:
property(_get_storage_object, doc= "Get the storage object attached to\
 the LUN.")

mapped_luns

Value:
property(_list_mapped_luns, doc= "List all MappedLUN objects referenci\
ng this LUN.")