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]
 
__init__(self, parent_tpg, lun, storage_object=None, alias=None)
A LUN object can be instantiated in two ways:
 
_create_in_cfs_ine(self, mode)
Creates the configFS node if it does not already exist depending on the mode.
 
_configure(self, storage_object, alias)
 
_get_alias(self)
 
_get_storage_object(self)
 
_get_parent_tpg(self)
 
_get_lun(self)
 
_get_alua_metadata_path(self)
 
_list_mapped_luns(self)
 
delete(self)
If the underlying configFS object does not exist, this method does nothing.

Inherited from node.CFSNode: __nonzero__, __str__, get_attribute, get_auth_attr, get_parameter, list_attributes, list_auth_attrs, list_parameters, set_attribute, set_auth_attr, set_parameter

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

Class Variables [hide private]

Inherited from node.CFSNode: alua_metadata_dir, configfs_dir

Properties [hide private]
  alua_metadata_path
Get the ALUA metadata directory path for the LUN.
  parent_tpg
Get the parent TPG object.
  lun
Get the LUN index as an int.
  storage_object
Get the storage object attached to the LUN.
  alias
Get the LUN alias.
  mapped_luns
List all MappedLUN objects referencing this LUN.

Inherited from node.CFSNode: exists, is_fresh, path

Inherited from object: __class__

Method Details [hide private]

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

 

A LUN object can be instantiated 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 instantiation 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__

_create_in_cfs_ine(self, mode)

 

Creates the configFS node if it does not already exist depending on the mode. any -> makes sure it exists, also works if the node already does exist lookup -> make sure it does NOT exist create -> create the node which must not exist beforehand Upon success (no exception raised), self._fresh is True if a node was created, else self._fresh is False.

Overrides: node.CFSNode._create_in_cfs_ine
(inherited documentation)

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

Property Details [hide private]

alua_metadata_path

Get the ALUA metadata directory path for the LUN.

Get Method:
_get_alua_metadata_path(self)

parent_tpg

Get the parent TPG object.

Get Method:
_get_parent_tpg(self)

lun

Get the LUN index as an int.

Get Method:
_get_lun(self)

storage_object

Get the storage object attached to the LUN.

Get Method:
_get_storage_object(self)

alias

Get the LUN alias.

Get Method:
_get_alias(self)

mapped_luns

List all MappedLUN objects referencing this LUN.

Get Method:
_list_mapped_luns(self)