Client Class Reference

Main client class for library. More...

Public Member Functions

def plugin_register
 Method added so that the interface for the client RPC and the plug-in itself match.
def __init__
 Class constructor.
def plugin_unregister
 Synonym for close.
def close
 Does an orderly plugin_unregister of the plug-in.
def available_plugins
 Retrieves all the available plug-ins.
def time_out_set
 Sets the timeout for the plug-in.
def time_out_get
 Retrieves the current time-out value.
def job_status
 Retrieves the status of the specified job id.
def job_free
 Frees the resources for the specified job id.
def capabilities
 Gets the capabilities of the array.
def plugin_info
 Gets information about the plug-in.
def pools
 Returns an array of pool objects.
def systems
 Returns an array of system objects.
def iscsi_chap_auth
 Register a user/password for the specified initiator for CHAP authentication.
def volumes
 Returns an array of volume objects.
def volume_create
 Creates a volume.
def volume_resize
 Re-sizes a volume.
def volume_replicate
 Replicates a volume from the specified pool.
def volume_replicate_range_block_size
 Size of a replicated block.
def volume_replicate_range
 Replicates a portion of a volume to itself or another volume.
def volume_delete
 Deletes a volume.
def volume_enable
 Makes a volume online and available to the host.
def volume_disable
 Takes a volume offline.
def disks
 Returns an array of disk objects.
def volume_mask
 Access control for allowing an access group to access a volume.
def volume_unmask
 Revokes access to a volume to initiators in an access group.
def access_groups
 Returns a list of access group objects.
def access_group_create
 Creates an access a group with the specified initiator in it.
def access_group_delete
 Deletes an access group.
def access_group_initiator_add
 Adds an initiator to an access group.
def access_group_initiator_delete
 Deletes an initiator from an access group.
def volumes_accessible_by_access_group
 Returns the list of volumes that access group has access to.
def access_groups_granted_to_volume
 Returns the list of access groups that have access to the specified volume.
def volume_child_dependency
 Checks to see if a volume has child dependencies.
def volume_child_dependency_rm
 Removes any child dependency.
def fs
 Returns a list of file system objects.
def fs_delete
 Deletes a file system.
def fs_resize
 Re-sizes a file system.
def fs_create
 Creates a file system.
def fs_clone
 Clones a file system.
def fs_file_clone
 Clones an individual file or files on the specified file system.
def fs_snapshots
 Returns a list of snapshots.
def fs_snapshot_create
 Creates a snapshot (Point in time read only copy).
def fs_snapshot_delete
 Deletes a snapshot.
def fs_snapshot_restore
 Reverts a snapshot.
def fs_child_dependency
 Checks to see if a file system has child dependencies.
def fs_child_dependency_rm
 Removes child dependencies from a FS or specific file.
def export_auth
 Returns a list of all the NFS client authentication types.
def exports
 Returns a list of all the exported file systems.
def export_fs
 Exports a FS as specified in the export.
def export_remove
 Removes the specified export.
def target_ports
 Returns a list of target ports.
def volume_raid_info
 Returns the RAID information of certain volume.
def pool_member_info
 Query the membership information of specified pool.
def volume_raid_create_cap_get
 Queries all the supported RAID types and stripe sizes which could be used for input into volume_raid_create.
def volume_raid_create
 Create a disk RAID pool and allocate entire storage space to new volume.

Data Fields

 plugin_path

Static Public Attributes

int FLAG_RSVD = 0
 Used for default flag value.

Detailed Description

Main client class for library.

** IMPORTANT ** Theory of operation for methods in this class. We are using the name of the method and the name of the parameters and using python introspection abilities to translate them to the method and parameter names. Makes the code compact, but you will break things if the IPlugin class does not match the method names and parameters here!

Definition at line 62 of file _client.py.


Member Function Documentation

def __init__ (   self,
  uri,
  plain_text_password = None,
  timeout_ms = 30000,
  flags = 0 
)

Class constructor.

Parameters:
self The this pointer
uri The uniform resource identifier
plain_text_password Password as plain text (Optional)
timeout_ms The timeout in ms
flags Reserved for future use, must be zero.
Returns:
None

Definition at line 130 of file _client.py.

def access_group_create (   self,
  name,
  init_id,
  init_type,
  system,
  flags = FLAG_RSVD 
)

Creates an access a group with the specified initiator in it.

Parameters:
self The this pointer
name The initiator group name
init_id Initiator id
init_type Type of initiator (Enumeration)
system Which system to create this group on
flags Reserved for future use, must be zero.
Returns:
AccessGroup on success, else raises LsmError
Creates an access group and add the specified initiator id,
init_type and desired access.

Definition at line 559 of file _client.py.

def access_group_delete (   self,
  access_group,
  flags = FLAG_RSVD 
)

Deletes an access group.

Parameters:
self The this pointer
access_group The access group to delete
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Deletes an access group

Definition at line 575 of file _client.py.

def access_group_initiator_add (   self,
  access_group,
  init_id,
  init_type,
  flags = FLAG_RSVD 
)

Adds an initiator to an access group.

Parameters:
self The this pointer
access_group Group to add initiator to
init_id Initiators id
init_type Initiator id type (enumeration)
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Adds an initiator to an access group

Definition at line 589 of file _client.py.

def access_group_initiator_delete (   self,
  access_group,
  init_id,
  init_type,
  flags = FLAG_RSVD 
)

Deletes an initiator from an access group.

Parameters:
self The this pointer
access_group The access group to remove initiator from
init_id The initiator to remove from the group
init_type Initiator id type (enumeration)
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Deletes an initiator from an access group

Definition at line 606 of file _client.py.

def access_groups (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns a list of access group objects.

Parameters:
self The this pointer
search_key Search Key
search_value Search value
flags Reserved for future use, must be zero.
Returns:
List of access groups
Returns a list of access groups

Definition at line 542 of file _client.py.

def access_groups_granted_to_volume (   self,
  volume,
  flags = FLAG_RSVD 
)

Returns the list of access groups that have access to the specified volume.

Parameters:
self The this pointer
volume The volume to list access groups for
flags Reserved for future use, must be zero.
Returns:
list of access groups
Returns the list of access groups that have access to the specified
volume.

Definition at line 637 of file _client.py.

def available_plugins (   field_sep = ':',
  flags = FLAG_RSVD 
)

Retrieves all the available plug-ins.

Retrieves all the available plug-ins

Return list of strings of available plug-ins with the
"desc<sep>version"

Definition at line 183 of file _client.py.

def capabilities (   self,
  system,
  flags = FLAG_RSVD 
)

Gets the capabilities of the array.

Parameters:
self The this pointer
system The system of interest
flags Reserved for future use, must be zero.
Returns:
Capability object
Fetches the capabilities of the array

Returns a capability object, see data,py for details.

Definition at line 269 of file _client.py.

def close (   self,
  flags = FLAG_RSVD 
)

Does an orderly plugin_unregister of the plug-in.

Parameters:
self The this pointer
flags Reserved for future use, must be zero.

Does an orderly plugin_unregister of the plug-in

Definition at line 172 of file _client.py.

def disks (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns an array of disk objects.

Parameters:
self The this pointer
search_key Search Key
search_value Search value
flags When equal to DISK.FLAG_RETRIEVE_FULL_INFO returned objects will contain optional data. If not defined, only the mandatory properties will be returned.
Returns:
An array of disk objects.
Returns an array of disk objects

Definition at line 502 of file _client.py.

def export_auth (   self,
  flags = FLAG_RSVD 
)

Returns a list of all the NFS client authentication types.

Parameters:
self The this pointer
flags Reserved for future use, must be zero.
Returns:
An array of client authentication types.
What types of NFS client authentication are supported.

Definition at line 904 of file _client.py.

def export_fs (   self,
  fs_id,
  export_path,
  root_list,
  rw_list,
  ro_list,
  anon_uid = NfsExport.ANON_UID_GID_NA,
  anon_gid = NfsExport.ANON_UID_GID_NA,
  auth_type = None,
  options = None,
  flags = FLAG_RSVD 
)

Exports a FS as specified in the export.

Parameters:
self The this pointer
fs_id The FS ID to export
export_path The export path (Set to None for array to pick)
root_list List of hosts with root access
rw_list List of hosts with read/write access
ro_list List of hosts with read only access
anon_uid UID to map to anonymous
anon_gid GID to map to anonymous
auth_type NFS client authentication type
options Options to pass to plug-in
flags Reserved for future use, must be zero.
Returns:
NfsExport on success, else raises LsmError
Exports a filesystem as specified in the arguments

Definition at line 938 of file _client.py.

def export_remove (   self,
  export,
  flags = FLAG_RSVD 
)

Removes the specified export.

Parameters:
self The this pointer
export The export to remove
flags Reserved for future use, must be zero.
Returns:
None on success, else raises LsmError
Removes the specified export

Definition at line 953 of file _client.py.

def exports (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns a list of all the exported file systems.

Parameters:
self The this pointer
search_key Search Key
search_value Search value
flags Reserved for future use, must be zero.
Returns:
An array of export objects
Get a list of all exported file systems on the controller.

Definition at line 917 of file _client.py.

def fs (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns a list of file system objects.

Parameters:
self The this pointer
search_key Search Key
search_value Search value
flags Reserved for future use, must be zero.
Returns:
A list of FS objects.
Returns a list of file systems on the controller.

Definition at line 686 of file _client.py.

def fs_child_dependency (   self,
  fs,
  files,
  flags = FLAG_RSVD 
)

Checks to see if a file system has child dependencies.

Parameters:
fs The file system to check
files The files to check (optional)
flags Reserved for future use, must be zero.
Returns:
True or False
Returns True if the specified filesystem or specified file on this
file system has child dependencies.  This implies that this filesystem
or specified file on this file system cannot be deleted or possibly
modified because it would affect its children.

Definition at line 869 of file _client.py.

def fs_child_dependency_rm (   self,
  fs,
  files,
  flags = FLAG_RSVD 
)

Removes child dependencies from a FS or specific file.

Parameters:
self The this pointer
fs The file system to remove child dependencies for
files The list of files to remove child dependencies (opt.)
flags Reserved for future use, must be zero.
Returns:
None if complete, else job id.
If this filesystem or specified file on this filesystem has child
dependency this method will fully replicate the blocks removing the
relationship between them.  This should return None(success) if
fs_child_dependency would return False.

Note:  This operation could take a very long time depending on the size
of the filesystem and the number of child dependencies.

Returns None if completed, else job id.  Raises LsmError on errors.

Definition at line 885 of file _client.py.

def fs_clone (   self,
  src_fs,
  dest_fs_name,
  snapshot = None,
  flags = FLAG_RSVD 
)

Clones a file system.

Parameters:
self The this pointer
src_fs The source file system to clone
dest_fs_name The destination file system clone name
snapshot Optional, create clone from previous snapshot
flags Reserved for future use, must be zero.
Returns:
tuple (job_id, file system)
Creates a thin, point in time read/writable copy of src to dest.
Optionally uses snapshot as backing of src_fs

Returns a tuple (job_id, file system)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 754 of file _client.py.

def fs_create (   self,
  pool,
  name,
  size_bytes,
  flags = FLAG_RSVD 
)

Creates a file system.

Parameters:
self The this pointer
pool The pool object to allocate space from
name The human text name for the file system
size_bytes The size of the file system in bytes
flags Reserved for future use, must be zero.
Returns:
tuple (job_id, file system), When one is None the other is valid
Creates a file system given a pool, name and size.
Note: size is limited to 2**64 bytes

Returns a tuple (job_id, file system)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 735 of file _client.py.

def fs_delete (   self,
  fs,
  flags = FLAG_RSVD 
)

Deletes a file system.

Parameters:
self The this pointer
fs The file system to delete
flags Reserved for future use, must be zero.
Returns:
None on success, else job id
WARNING: Destructive

Deletes a file system and everything it contains
Returns None on success, else job id

Definition at line 699 of file _client.py.

def fs_file_clone (   self,
  fs,
  src_file_name,
  dest_file_name,
  snapshot = None,
  flags = FLAG_RSVD 
)

Clones an individual file or files on the specified file system.

Parameters:
self The this pointer
fs The file system the files are on
src_file_name The source file name
dest_file_name The dest. file name
snapshot Optional, the snapshot to base clone source file from
flags Reserved for future use, must be zero.
Returns:
None on success, else job id
Creates a thinly provisioned clone of src to dest.
Note: Source and Destination are required to be on same filesystem and
all directories in destination path need to exist.

Returns None on success, else job id

Definition at line 775 of file _client.py.

def fs_resize (   self,
  fs,
  new_size_bytes,
  flags = FLAG_RSVD 
)

Re-sizes a file system.

Parameters:
self The this pointer
fs The file system to re-size
new_size_bytes The new size of the file system in bytes
flags Reserved for future use, must be zero.
Returns:
tuple (job_id, re-sized file system), When one is None the other is valid
Re-size a file system

Returns a tuple (job_id, re-sized file system)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 716 of file _client.py.

def fs_snapshot_create (   self,
  fs,
  snapshot_name,
  flags = FLAG_RSVD 
)

Creates a snapshot (Point in time read only copy).

Parameters:
self The this pointer
fs The file system to snapshot
snapshot_name The human readable snapshot name
flags Reserved for future use, must be zero.
Returns:
tuple (job_id, snapshot)
Snapshot is a point in time read-only copy

Create a snapshot on the chosen file system.

Returns a tuple (job_id, snapshot)
Notes:
- Snapshot name may not match what was passed in
  (depends on array implementation)
- Tuple return values are mutually exclusive, when one
  is None the other must be valid.

Definition at line 805 of file _client.py.

def fs_snapshot_delete (   self,
  fs,
  snapshot,
  flags = FLAG_RSVD 
)

Deletes a snapshot.

Parameters:
self The this pointer
fs The filesystem the snapshot it for
snapshot The specific snap shot to delete
flags Reserved for future use, must be zero.
Returns:
None on success, else job id
Frees the re-sources for the given snapshot on the supplied filesystem.

Returns None on success else job id, LsmError exception on error

Definition at line 827 of file _client.py.

def fs_snapshot_restore (   self,
  fs,
  snapshot,
  files,
  restore_files,
  all_files = False,
  flags = FLAG_RSVD 
)

Reverts a snapshot.

Parameters:
self The this pointer
fs The file system object to restore snapshot for
snapshot The snapshot file to restore back too
files The specific files to restore
restore_files Individual files to restore
all_files Set to True if all files should be restored back
flags Reserved for future use, must be zero.
Returns:
None on success, else job id
WARNING: Destructive!

Reverts a file-system or just the specified files from the snapshot.
If a list of files is supplied but the array cannot restore just them
then the operation will fail with an LsmError raised.  If files == None
and all_files = True then all files on the file-system are restored.

Restore_file if None none must be the same length as files with each
index in each list referring to the associated file.

Returns None on success, else job id, LsmError exception on error

Definition at line 846 of file _client.py.

def fs_snapshots (   self,
  fs,
  flags = FLAG_RSVD 
)

Returns a list of snapshots.

Parameters:
self The this pointer
fs The file system
flags Reserved for future use, must be zero.
Returns:
a list of snapshot objects.
Returns a list of snapshot names for the supplied file system

Definition at line 792 of file _client.py.

def iscsi_chap_auth (   self,
  init_id,
  in_user,
  in_password,
  out_user,
  out_password,
  flags = FLAG_RSVD 
)

Register a user/password for the specified initiator for CHAP authentication.

Note: If you pass an empty user and password the expected behavior is to remove any authentication for the specified initiator.

Parameters:
self The this pointer
init_id The initiator ID
in_user User for inbound CHAP
in_password Password for inbound CHAP
out_user Outbound username
out_password Outbound password
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Register a user/password for the specified initiator for CHAP
authentication.

Definition at line 329 of file _client.py.

def job_free (   self,
  job_id,
  flags = FLAG_RSVD 
)

Frees the resources for the specified job id.

Parameters:
self The this pointer
job_id Job id in which to release resource for
flags Reserved for future use, must be zero.

Frees resources for a given job number.

Returns None on success, else raises an LsmError

Definition at line 255 of file _client.py.

def job_status (   self,
  job_id,
  flags = FLAG_RSVD 
)

Retrieves the status of the specified job id.

Parameters:
self The this pointer
job_id The job identifier
flags Reserved for future use, must be zero.
Returns:
A tuple ( status (enumeration), percent_complete, completed item)
Returns the stats of the given job.

Returns a tuple ( status (enumeration), percent_complete,
            completed item).
else LsmError exception.

Definition at line 240 of file _client.py.

def plugin_info (   self,
  flags = FLAG_RSVD 
)

Gets information about the plug-in.

Parameters:
self The this pointer
flags Reserved for future use
Returns:
Tuple (description, version)
Returns a description and version of plug-in

Definition at line 282 of file _client.py.

def plugin_register (   self,
  uri,
  plain_text_password,
  timeout_ms,
  flags = 0 
)

Method added so that the interface for the client RPC and the plug-in itself match.

Definition at line 74 of file _client.py.

def plugin_unregister (   self,
  flags = FLAG_RSVD 
)

Synonym for close.

Synonym for close.

Definition at line 162 of file _client.py.

def pool_member_info (   self,
  pool,
  flags = FLAG_RSVD 
)

Query the membership information of specified pool.

Parameters:
self The this pointer
pool The pool to query
flags Reserved for future use, must be zero
Returns:
[raid_type, member_type, [member_ids]], lsmError on error
lsm.Client.pool_member_info(self, pool, flags=lsm.Client.FLAG_RSVD)

Version:
    1.2
Usage:
    Query the membership information of certain pool:
RAID type, member type and member ids.
    Currently, LibStorageMgmt supports two types of pool:
* Sub-pool -- Pool.MEMBER_TYPE_POOL
    Pool space is allocated from parent pool.
    Example:
        * NetApp ONTAP volume

* Disk RAID pool -- Pool.MEMBER_TYPE_DISK
    Pool is a RAID group assembled by disks.
    Example:
        * LSI MegaRAID disk group
        * EMC VNX pool
        * NetApp ONTAP aggregate
Parameters:
    pool (lsm.Pool object)
Pool to query
    flags (int)
Optional. Reserved for future use.
Should be set as lsm.Client.FLAG_RSVD.
Returns:
    [raid_type, member_type, member_ids]

    raid_type (int)
RAID Type of requested pool.
    Could be one of these values:
        Volume.RAID_TYPE_RAID0
            Stripe
        Volume.RAID_TYPE_RAID1
            Two disks Mirror
        Volume.RAID_TYPE_RAID3
            Byte-level striping with dedicated parity
        Volume.RAID_TYPE_RAID4
            Block-level striping with dedicated parity
        Volume.RAID_TYPE_RAID5
            Block-level striping with distributed parity
        Volume.RAID_TYPE_RAID6
            Block-level striping with two distributed parities,
            aka, RAID-DP
        Volume.RAID_TYPE_RAID10
            Stripe of mirrors
        Volume.RAID_TYPE_RAID15
            Parity of mirrors
        Volume.RAID_TYPE_RAID16
            Dual parity of mirrors
        Volume.RAID_TYPE_RAID50
            Stripe of parities Volume.RAID_TYPE_RAID60
            Stripe of dual parities
        Volume.RAID_TYPE_RAID51
            Mirror of parities
        Volume.RAID_TYPE_RAID61
            Mirror of dual parities
        Volume.RAID_TYPE_JBOD
            Just bunch of disks, no parity, no striping.
        Volume.RAID_TYPE_UNKNOWN
            The plugin failed to detect the volume's RAID type.
        Volume.RAID_TYPE_MIXED
            This pool contains multiple RAID settings.
        Volume.RAID_TYPE_OTHER
            Vendor specific RAID type
    member_type (int)
Could be one of these values:
    Pool.MEMBER_TYPE_POOL
        Current pool(also known as sub-pool) is allocated from
        other pool(parent pool). The 'raid_type' will set to
        RAID_TYPE_OTHER unless certain RAID system support RAID
        using space of parent pools.
    Pool.MEMBER_TYPE_DISK
        Pool is created from RAID group using whole disks.
    Pool.MEMBER_TYPE_OTHER
        Vendor specific RAID member type.
    Pool.MEMBER_TYPE_UNKNOWN
        Plugin failed to detect the RAID member type.
    member_ids (list of strings)
When 'member_type' is Pool.MEMBER_TYPE_POOL,
the 'member_ids' will contain a list of parent Pool IDs.
When 'member_type' is Pool.MEMBER_TYPE_DISK,
the 'member_ids' will contain a list of disk IDs.
When 'member_type' is Pool.MEMBER_TYPE_OTHER or
Pool.MEMBER_TYPE_UNKNOWN, the member_ids should be an empty
list.
SpecialExceptions:
    LsmError
ErrorNumber.NO_SUPPORT
ErrorNumber.NOT_FOUND_POOL
Capability:
    lsm.Capabilities.POOL_MEMBER_INFO

Definition at line 1079 of file _client.py.

def pools (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns an array of pool objects.

Parameters:
self The this pointer
search_key Search key
search_value Search value
flags Reserved for future use, must be zero.
Returns:
An array of pool objects.
Returns an array of pool objects.  Pools are used in both block and
file system interfaces, thus the reason they are in the base class.

Definition at line 295 of file _client.py.

def systems (   self,
  flags = FLAG_RSVD 
)

Returns an array of system objects.

Parameters:
self The this pointer
flags Reserved for future use, must be zero.
Returns:
An array of system objects.
Returns an array of system objects.  System information is used to
distinguish resources from on storage array to another when the plug=in
supports the ability to have more than one array managed by it

Definition at line 308 of file _client.py.

def target_ports (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns a list of target ports.

Parameters:
self The this pointer
search_key The key to search against
search_value The value to search for
flags Reserved for future use, must be zero
Returns:
List of target ports, else raises LsmError
Returns a list of target ports

Definition at line 966 of file _client.py.

def time_out_get (   self,
  flags = FLAG_RSVD 
)

Retrieves the current time-out value.

Parameters:
self The this pointer
flags Reserved for future use, must be zero.
Returns:
Time-out value
Retrieves the current time-out

Return time-out in ms, else raise LsmError

Definition at line 225 of file _client.py.

def time_out_set (   self,
  ms,
  flags = FLAG_RSVD 
)

Sets the timeout for the plug-in.

Parameters:
self The this pointer
ms Time-out in ms
flags Reserved for future use, must be zero.

Sets any time-outs for the plug-in (ms)

Return None on success, else LsmError exception

Definition at line 212 of file _client.py.

def volume_child_dependency (   self,
  volume,
  flags = FLAG_RSVD 
)

Checks to see if a volume has child dependencies.

Parameters:
self The this pointer
volume The volume to check
flags Reserved for future use, must be zero.
Returns:
True or False
Returns True if this volume has other volumes which are dependant on
it. Implies that this volume cannot be deleted or possibly modified
because it would affect its children.

Definition at line 651 of file _client.py.

def volume_child_dependency_rm (   self,
  volume,
  flags = FLAG_RSVD 
)

Removes any child dependency.

Parameters:
self The this pointer
volume The volume to remove dependencies for
flags Reserved for future use, must be zero.
Returns:
None if complete, else job id.
If this volume has child dependency, this method call will fully
replicate the blocks removing the relationship between them.  This
should return None (success) if volume_child_dependency would return
False.

Note:  This operation could take a very long time depending on the size
of the volume and the number of child dependencies.

Returns None if complete else job id, raises LsmError on errors.

Definition at line 665 of file _client.py.

def volume_create (   self,
  pool,
  volume_name,
  size_bytes,
  provisioning,
  flags = FLAG_RSVD 
)

Creates a volume.

Parameters:
self The this pointer
pool The pool object to allocate storage from
volume_name The human text name for the volume
size_bytes Size of the volume in bytes
provisioning How the volume is to be provisioned
flags Reserved for future use, must be zero.
Returns:
A tuple (job_id, new volume), when one is None the other is valid.
Creates a volume, given a pool, volume name, size and provisioning

returns a tuple (job_id, new volume)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 364 of file _client.py.

def volume_delete (   self,
  volume,
  flags = FLAG_RSVD 
)

Deletes a volume.

Parameters:
self The this pointer
volume The volume object which represents the volume to delete
flags Reserved for future use, must be zero.
Returns:
None on success, else job id. Raises LsmError on errors.
Deletes a volume.

Returns None on success, else job id

Definition at line 456 of file _client.py.

def volume_disable (   self,
  volume,
  flags = FLAG_RSVD 
)

Takes a volume offline.

Parameters:
self The this pointer
volume The volume object
flags Reserved for future use, must be zero.
Returns:
None on success, else raises LsmError on errors.
Makes a volume unavailable to the host

returns None on success, else raises LsmError on errors.

Definition at line 484 of file _client.py.

def volume_enable (   self,
  volume,
  flags = FLAG_RSVD 
)

Makes a volume online and available to the host.

Parameters:
self The this pointer
volume The volume to place online
flags Reserved for future use, must be zero.
Returns:
None on success, else raises LsmError
Makes a volume available to the host

returns None on success, else raises LsmError on errors.

Definition at line 470 of file _client.py.

def volume_mask (   self,
  access_group,
  volume,
  flags = FLAG_RSVD 
)

Access control for allowing an access group to access a volume.

Parameters:
self The this pointer
access_group The access group
volume The volume to grant access to
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Allows an access group to access a volume.

Definition at line 516 of file _client.py.

def volume_raid_create (   self,
  name,
  raid_type,
  disks,
  strip_size,
  flags = FLAG_RSVD 
)

Create a disk RAID pool and allocate entire storage space to new volume.

Parameters:
self The this pointer
name Name of the raid to be created
raid_type The raid type (enumerated) of the raid group
disks List of disk objects to use
strip_size Strip size in bytes
flags Flags
Returns:
the newly created volume, lsmError on errors
lsm.Client.volume_raid_create(self, name, raid_type, disks,
                      strip_size, flags=lsm.Client.FLAG_RSVD)

Version:
    1.2
Usage:
    This method is dedicated to local hardware RAID cards.
    Create a disk RAID pool and allocate entire storage space to
    new volume using requested volume name.
    When dealing with RAID10, 50 or 60, the first half part of
    'disks' will be located in one bottom layer RAID group.
    The new volume and new pool will created within the same system
    of provided disks.
    This method does not allow duplicate call, when duplicate call
    was issued, LsmError with ErrorNumber.DISK_NOT_FREE will be raise.
    User should check disk.status for Disk.STATUS_FREE before
    invoking this method.
Parameters:
    name (string)
The name for new volume.
The requested volume name might be ignored due to restriction
of hardware RAID vendors.
The pool name will be automatically choosed by plugin.
    raid_type (int)
The RAID type for the RAID group, possible values are:
    Volume.RAID_TYPE_RAID0
    Volume.RAID_TYPE_RAID1
    Volume.RAID_TYPE_RAID5
    Volume.RAID_TYPE_RAID6
    Volume.RAID_TYPE_RAID10
    Volume.RAID_TYPE_RAID15
    Volume.RAID_TYPE_RAID16
    Volume.RAID_TYPE_RAID50
Please check volume_raid_create_cap_get() returns to get
supported all raid types of current hardware RAID card.
    disks ([lsm.Disks,])
A list of lsm.Disk objects. Free disks used for new RAID group.
    strip_size (int)
The size in bytes of strip.
When setting strip_size to Volume.VCR_STRIP_SIZE_DEFAULT, it
allow hardware RAID cards to choose their default value.
Please use volume_raid_create_cap_get() method to get all
supported strip size of current hardware RAID card.
The Volume.VCR_STRIP_SIZE_DEFAULT is always supported when
lsm.Capabilities.VOLUME_CREATE_RAID is supported.
    flags (int)
Optional. Reserved for future use.
Should be set as lsm.Client.FLAG_RSVD.
Returns:
    lsm.Volume
The lsm.Volume object for newly created volume.
SpecialExceptions:
    LsmError
lsm.ErrorNumber.NO_SUPPORT
    Method not supported or RAID type not supported.
lsm.ErrorNumber.DISK_NOT_FREE
    Disk is not in Disk.STATUS_FREE status.
lsm.ErrorNumber.NOT_FOUND_DISK
    Disk not found
lsm.ErrorNumber.INVALID_ARGUMENT
    1. Invalid input argument data.
    2. Disks are not from the same system.
    3. Disks are not from the same enclosure.
    4. Invalid strip_size.
    5. Disk count are meet the minimum requirement:
        RAID1: len(disks) == 2
        RAID5: len(disks) >= 3
        RAID6: len(disks) >= 4
        RAID10: len(disks) % 2 == 0 and len(disks) >= 4
        RAID50: len(disks) % 2 == 0 and len(disks) >= 6
        RAID60: len(disks) % 2 == 0 and len(disks) >= 8
lsm.ErrorNumber.NAME_CONFLICT
    Requested name is already be used by other volume.
Sample:
    lsm_client = lsm.Client('sim://')
    disks = lsm_client.disks()
    free_disks = [d for d in disks if d.status == Disk.STATUS_FREE]
    new_vol = lsm_client.volume_raid_create(
'raid0_vol1', Volume.RAID_TYPE_RAID0, free_disks)
Capability:
    lsm.Capabilities.VOLUME_CREATE_RAID
Indicate current system support volume_raid_create() method.
At least one RAID type should be supported.
The strip_size == Volume.VCR_STRIP_SIZE_DEFAULT is supported.

Definition at line 1246 of file _client.py.

def volume_raid_create_cap_get (   self,
  system,
  flags = FLAG_RSVD 
)

Queries all the supported RAID types and stripe sizes which could be used for input into volume_raid_create.

Parameters:
self The this pointer
system System (raid) card to query
flags Reserved for future use, must be zero
Returns:
[raid_types, strip_sizes], lsmError on error
lsm.Client.volume_raid_create_cap_get(
    self, system, flags=lsm.Client.FLAG_RSVD)

Version:
    1.2
Usage:
    This method is dedicated to local hardware RAID cards.
    Query out all supported RAID types and strip sizes which could
    be used by lsm.Client.volume_raid_create() method.
Parameters:
    system (lsm.System)
Instance of lsm.System
    flags (int)
Optional. Reserved for future use.
Should be set as lsm.Client.FLAG_RSVD.
Returns:
    [raid_types, strip_sizes]
raid_types ([int])
    List of integer, possible values are:
        Volume.RAID_TYPE_RAID0
        Volume.RAID_TYPE_RAID1
        Volume.RAID_TYPE_RAID5
        Volume.RAID_TYPE_RAID6
        Volume.RAID_TYPE_RAID10
        Volume.RAID_TYPE_RAID50
        Volume.RAID_TYPE_RAID60
strip_sizes ([int])
    List of integer. Stripe size in bytes.
SpecialExceptions:
    LsmError
lsm.ErrorNumber.NO_SUPPORT
    Method not supported.
Sample:
    lsm_client = lsm.Client('sim://')
    lsm_sys = lsm_client.systems()[0]
    disks = lsm_client.disks(
search_key='system_id', search_value=lsm_sys.id)

    free_disks = [d for d in disks if d.status == Disk.STATUS_FREE]
    supported_raid_types, supported_strip_sizes = \
lsm_client.volume_raid_create_cap_get(lsm_sys)
    new_vol = lsm_client.volume_raid_create(
'test_volume_raid_create', supported_raid_types[0],
free_disks, supported_strip_sizes[0])

Capability:
    lsm.Capabilities.VOLUME_CREATE_RAID
This method is mandatory when volume_raid_create() is
supported.

Definition at line 1183 of file _client.py.

def volume_raid_info (   self,
  volume,
  flags = FLAG_RSVD 
)

Returns the RAID information of certain volume.

Parameters:
self The this pointer
volume The volume to retrieve RAID information for
flags Reserved for future use, must be zero
Returns:
[raid_type, strip_size, disk_count, min_io_size, opt_io_size], else raises LsmError
Query the RAID information of certain volume.

New in version 1.2.

Query the RAID type, strip size, extents count, minimum I/O size,
optimal I/O size of given volume.

This method requires this capability:
    lsm.Capabilities.VOLUME_RAID_INFO

Args:
    volume (Volume object): Volume to query
    flags (int): Reserved for future use. Should be set as
lsm.Client.FLAG_RSVD
Returns:
    [raid_type, strip_size, disk_count, min_io_size, opt_io_size]

    raid_type (int): RAID Type of requested volume.
Could be one of these values:
    Volume.RAID_TYPE_RAID0
        Stripe
    Volume.RAID_TYPE_RAID1
        Two disks Mirror
    Volume.RAID_TYPE_RAID3
        Byte-level striping with dedicated parity
    Volume.RAID_TYPE_RAID4
        Block-level striping with dedicated parity
    Volume.RAID_TYPE_RAID5
        Block-level striping with distributed parity
    Volume.RAID_TYPE_RAID6
        Block-level striping with two distributed parities,
        aka, RAID-DP
    Volume.RAID_TYPE_RAID10
        Stripe of mirrors
    Volume.RAID_TYPE_RAID15
        Parity of mirrors
    Volume.RAID_TYPE_RAID16
        Dual parity of mirrors
    Volume.RAID_TYPE_RAID50
        Stripe of parities
    Volume.RAID_TYPE_RAID60
        Stripe of dual parities
    Volume.RAID_TYPE_RAID51
        Mirror of parities
    Volume.RAID_TYPE_RAID61
        Mirror of dual parities
    Volume.RAID_TYPE_JBOD
        Just bunch of disks, no parity, no striping.
    Volume.RAID_TYPE_UNKNOWN
        The plugin failed to detect the volume's RAID type.
    Volume.RAID_TYPE_MIXED
        This volume contains multiple RAID settings.
    Volume.RAID_TYPE_OTHER
        Vendor specific RAID type
    strip_size(int): The size of strip on each disk or other storage
extent.
For RAID1/JBOD, it should be set as sector size.
If plugin failed to detect strip size, it should be set
as Volume.STRIP_SIZE_UNKNOWN(0).
    disk_count(int): The count of disks used for assembling the RAID
group(s) where this volume allocated from.
For any RAID system using the slice of disk, this value
indicate how many disk slices are used for the RAID.
For exmaple, on LVM RAID, the 'disk_count' here indicate the
count of PVs used for certain volume.
Another example, on EMC VMAX, the 'disk_count' here indicate
how many hyper volumes are used for this volume.
For any RAID system using remote LUN for data storing, each
remote LUN should be count as a disk.
If the plugin failed to detect disk_count, it should be set
as Volume.DISK_COUNT_UNKNOWN(0).
    min_io_size(int): The minimum I/O size, device preferred I/O
size for random I/O. Any I/O size not equal to a multiple
of this value may get significant speed penalty.
Normally it refers to strip size of each disk(extent).
If plugin failed to detect min_io_size, it should try these
values in the sequence of:
logical sector size -> physical sector size ->
Volume.MIN_IO_SIZE_UNKNOWN(0).
    opt_io_size(int): The optimal I/O size, device preferred I/O
size for sequential I/O. Normally it refers to RAID group
stripe size.
If plugin failed to detect opt_io_size, it should be set
to Volume.OPT_IO_SIZE_UNKNOWN(0).
Raises:
    LsmError:
ErrorNumber.NO_SUPPORT
    No support.

Definition at line 981 of file _client.py.

def volume_replicate (   self,
  pool,
  rep_type,
  volume_src,
  name,
  flags = FLAG_RSVD 
)

Replicates a volume from the specified pool.

Parameters:
self The this pointer
pool The pool to re-size from
rep_type Replication type (enumeration,see common.data.Volume)
volume_src The volume to replicate
name Human readable name of replicated volume
flags Reserved for future use, must be zero.
Returns:
A tuple (job_id, new replicated volume), when one is None the other is valid.
Replicates a volume from the specified pool.

Returns a tuple (job_id, replicated volume)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 404 of file _client.py.

def volume_replicate_range (   self,
  rep_type,
  volume_src,
  volume_dest,
  ranges,
  flags = FLAG_RSVD 
)

Replicates a portion of a volume to itself or another volume.

Parameters:
self The this pointer
rep_type Replication type (enumeration, see common.data.Volume)
volume_src The volume src to replicate from
volume_dest The volume dest to replicate to
ranges An array of Block range objects
See also:
lsm.common.data.BlockRange
Parameters:
flags Reserved for future use, must be zero.
Returns:
Job id or None when completed, else raises LsmError on errors.
Replicates a portion of a volume to itself or another volume.  The src,
dest and number of blocks values change with vendor, call
volume_replicate_range_block_size to get block unit size.

Returns Job id or None when completed, else raises LsmError on errors.

Definition at line 439 of file _client.py.

def volume_replicate_range_block_size (   self,
  system,
  flags = FLAG_RSVD 
)

Size of a replicated block.

Parameters:
self The this pointer
system The system to request the rep. block range size from
flags Reserved for future use, must be zero
Returns:
Size of the replicated block in bytes
Returns the size of a replicated block in bytes.

Definition at line 421 of file _client.py.

def volume_resize (   self,
  volume,
  new_size_bytes,
  flags = FLAG_RSVD 
)

Re-sizes a volume.

Parameters:
self The this pointer
volume The volume object to re-size
new_size_bytes Size of the volume in bytes
flags Reserved for future use, must be zero.
Returns:
A tuple (job_id, new re-sized volume), when one is None the other is valid.
Re-sizes a volume.

Returns a tuple (job_id, re-sized_volume)
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.

Definition at line 383 of file _client.py.

def volume_unmask (   self,
  access_group,
  volume,
  flags = FLAG_RSVD 
)

Revokes access to a volume to initiators in an access group.

Parameters:
self The this pointer
access_group The access group
volume The volume to grant access to
flags Reserved for future use, must be zero.
Returns:
None on success, throws LsmError on errors.
Revokes access for an access group for a volume

Definition at line 529 of file _client.py.

def volumes (   self,
  search_key = None,
  search_value = None,
  flags = FLAG_RSVD 
)

Returns an array of volume objects.

Parameters:
self The this pointer
search_key Search key to use
search_value Search value
flags Reserved for future use, must be zero.
Returns:
An array of volume objects.
Returns an array of volume objects

Definition at line 347 of file _client.py.

def volumes_accessible_by_access_group (   self,
  access_group,
  flags = FLAG_RSVD 
)

Returns the list of volumes that access group has access to.

Parameters:
self The this pointer
access_group The access group to list volumes for
flags Reserved for future use, must be zero.
Returns:
list of volumes
Returns the list of volumes that access group has access to.

Definition at line 622 of file _client.py.


Field Documentation

int FLAG_RSVD = 0 [static]

Used for default flag value.

Definition at line 67 of file _client.py.

Definition at line 143 of file _client.py.


The documentation for this class was generated from the following file:

Generated on 9 Jul 2015 for libStorageMgmt by  doxygen 1.6.1