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 `node.CFSNode` (private): `_check_self`, `_create_in_cfs_ine`, `_exists`, `_get_path`, `_list_files`

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`
Inherited from `node.CFSNode`: `configfs_dir`

Properties | [hide private]

| 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`, `path` 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

Property Details | [hide private]

### 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)