ó -ÎP`c@sýddlZddlZddlmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZddlmZddlmZddlmZddlmZddlZd„Zd„Zd „Z d efd „ƒYZ!dS( iÿÿÿÿN(tVolumet NfsExportt CapabilitiestPooltSystemtBatterytDiskt AccessGroupt FileSystemt FsSnapshott uri_parsetLsmErrort ErrorNumbertINetworkAttachedStoraget TargetPort(treturn_requires(tUDS_PATH(t TransPort(tIDatacCs |d=|S(s‚ Used to remove the self key from the dict d. Self is included when calling the function locals() in a class method. tself((td((s//usr/lib/python2.7/site-packages/lsm/_client.pyt _del_self"scCs/|r+||kr+ttjd|ƒ‚ndS(NsUnsupported search_key: '%s'(R R tUNSUPPORTED_SEARCH_KEY(t search_keytsupported_keys((s//usr/lib/python2.7/site-packages/lsm/_client.pyt_check_search_key+s cCsttjdƒ‚dS(Ns`The libStorageMgmt daemon is not running (process name lsmd), try 'service libstoragemgmt start'(R R tDAEMON_NOT_RUNNING(((s//usr/lib/python2.7/site-packages/lsm/_client.pyt_raise_no_daemon3s tClientcBsœeZdZdIZdJZdKZdLZdd„Zdd„Ze d„ƒZ e d„ƒZ dMddd „Z edMƒed „ƒZedMƒed „ƒZe eejdgƒd ed „ƒƒZedMƒed„ƒZeeƒed„ƒZeeeeƒed„ƒZedMƒed„ƒZeeƒed„ƒZeejdejdƒed„ƒZeegƒdMdMed„ƒZeegƒed„ƒZ edMƒed„ƒZ!edMƒed„ƒZ"ee#gƒdMdMed„ƒZ$eejde#ƒed„ƒZ%eejde#ƒed„ƒZ&eejde#ƒed„ƒZ'eeƒed„ƒZ(eejdƒed„ƒZ)eejdƒed„ƒZ*edMƒed„ƒZ+edMƒed „ƒZ,ee-gƒdMdMed!„ƒZ.edMƒed"„ƒZ/edMƒed#„ƒZ0ee1gƒdMdMed$„ƒZ2ee1ƒed%„ƒZ3edMƒed&„ƒZ4ee1ƒed'„ƒZ5ee1ƒed(„ƒZ6ee#gƒed)„ƒZ7ee1gƒed*„ƒZ8ee9ƒed+„ƒZ:eejdƒed,„ƒZ;ee<gƒdMdMed-„ƒZ=eejdƒed.„ƒZ>eejde<ƒed/„ƒZ?eejde<ƒed0„ƒZ@eejde<ƒdMed1„ƒZAeejdƒdMed2„ƒZBeeCgƒed3„ƒZDeejdeCƒed4„ƒZEeejdƒed5„ƒZFeejdƒeGed6„ƒZHee9ƒed7„ƒZIeejdƒed8„ƒZJeejdgƒed9„ƒZKeeLgƒdMdMed:„ƒZMeeLƒeLjNeLjNdMdMed;„ƒZOedMƒed<„ƒZPeeQgƒdMdMed=„ƒZReeeeeegƒed>„ƒZSeeeejdggƒed?„ƒZTeegeggƒed@„ƒZUee#ƒedA„ƒZVedMƒedB„ƒZWedMƒedC„ƒZXeeYgƒdMdMedD„ƒZZeeeeeegƒedE„ƒZ[edMƒedF„ƒZ\edMƒedG„ƒZ]edMƒedH„ƒZ^RS(NiiiicCstdƒ‚dS(NsDo not call directly!(t RuntimeError(Rturitplain_text_passwordt timeout_mstflags((s//usr/lib/python2.7/site-packages/lsm/_client.pytplugin_registerQscCs |jjdttƒƒƒdS(s3 Instruct the plug-in to get ready R"N(t_tptrpcRtlocals(RRtpasswordttimeoutR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyt__start[scCs£tjƒ}tjj|ƒrŸx~tj|ƒD]j\}}}xX|D]P}tjj||ƒ}y!tj|ƒ}|j ƒt SWqDt k r“qDXqDWq.Wnt S(N( Rt_plugin_uds_pathtostpathtexiststwalktjoint _TransPortt get_sockettclosetTrueR tFalse(tuds_pathtroott sub_folderstfilestfilenametudsts((s//usr/lib/python2.7/site-packages/lsm/_client.pyt_check_daemon_existses    cCs)t}dtjkr%tjd}n|S(Nt LSM_UDS_PATH(t _UDS_PATHR*tenviron(trc((s//usr/lib/python2.7/site-packages/lsm/_client.pyR)ysi0uc Cs||_||_||_tjƒ|_t|dgƒ}|d}d|krp|jdƒ\}}|}ntj j |j|ƒ|_ tj j |j ƒr¾t t j|j ƒƒ|_n/tjƒrættjd|j ƒ‚ntƒ|j||||ƒdS(Ntschemet+sPlug-in %s not found!(t_urit _passwordt_timeoutRR)t _uds_pathR tsplitR*R+R.t plugin_pathR,R/R0R#R;R R tPLUGIN_NOT_EXISTRt_Client__start( RRRR R!tuR@tplugtproto((s//usr/lib/python2.7/site-packages/lsm/_client.pyt__init__‰s"        cCs|j|ƒdS(s$ Synonym for close. N(R1(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pytplugin_unregister¨scCs6|jjdttƒƒƒ|jjƒd|_dS(sB Does an orderly plugin_unregister of the plug-in RNN(R#R$RR%R1tNone(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR1²s t:c CsÏg}tjƒstƒntjƒ}x tj|ƒD]\}}}x}|D]u}tjj||ƒ}ttj |ƒƒ} | j dt d|ƒƒ\} } |j d| || fƒ| j ƒqNWq8W|S(s Retrieves all the available plug-ins Return list of strings of available plug-ins with the "descversion" t plugin_infoR!s%s%s%s(RR;RR)R*R-R+R.R/R0R$tdicttappendR1( t field_sepR!R?R4R5R6R7R8R9ttptitv((s//usr/lib/python2.7/site-packages/lsm/_client.pytavailable_plugins¾s     !cCs|jjdttƒƒƒS(sr Sets any time-outs for the plug-in (ms) Return None on success, else LsmError exception t time_out_set(R#R$RR%(RtmsR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRYÜscCs|jjdttƒƒƒS(sd Retrieves the current time-out Return time-out in ms, else raise LsmError t time_out_get(R#R$RR%(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR[éscCs|jjdttƒƒƒS(sÆ Returns the stats of the given job. Returns a tuple ( status (enumeration), percent_complete, completed item). else LsmError exception. t job_status(R#R$RR%(Rtjob_idR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR\øs cCs|jjdttƒƒƒS(ss Frees resources for a given job number. Returns None on success, else raises an LsmError tjob_free(R#R$RR%(RR]R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR^scCs|jjdttƒƒƒS(sv Fetches the capabilities of the array Returns a capability object, see data,py for details. t capabilities(R#R$RR%(RtsystemR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR_scCs|jjdttƒƒƒS(s> Returns a description and version of plug-in RQ(R#R$RR%(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRQ"scCs,t|tjƒ|jjdttƒƒƒS(s¡ 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. tpools(RRtSUPPORTED_SEARCH_KEYSR#R$RR%(RRt search_valueR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRa/scCs|jjdttƒƒƒS(së 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 tsystems(R#R$RR%(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRd<scCs­tjddkr@t|ttfƒsdttjdƒ‚qdn$t|tƒsdttjdƒ‚n|dks||dkr‘ttjdƒ‚n|jj dt t ƒƒƒS(sÆ lsm.Client.system_read_cache_pct_update(self, system, read_pct, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: This method updates the read cache percentage on a system if supported Parameters: system(lsm.System) an lsm.System object. read_pct(int) the desired read cache percentage. flags (int) Optional. Reserved for future use. Should be set as lsm.Client.FLAG_RSVD. Returns: returns None on success, else raises LsmError on errors. SpecialExceptions: iis&Invalid read_pct, should be an integerids,Invalid read_pct, should be in range 0 - 100tsystem_read_cache_pct_update( tsyst version_infot isinstancetinttlongR R tINVALID_ARGUMENTR#R$RR%(RR`tread_pctR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyReKs      cCs5tj|tjdtƒ|jjdttƒƒƒS(sg Register a user/password for the specified initiator for CHAP authentication. traise_exceptiontiscsi_chap_auth(Rtinitiator_id_verifytINIT_TYPE_ISCSI_IQNR2R#R$RR%(Rtinit_idtin_usert in_passwordtout_usert out_passwordR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRn}s  cCs,t|tjƒ|jjdttƒƒƒS(s4 Returns an array of volume objects tvolumes(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRvscCs|jjdttƒƒƒS(sî 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. t volume_create(R#R$RR%(Rtpoolt volume_namet size_bytest provisioningR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRw s cCs|jjdttƒƒƒS(sà 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. t volume_resize(R#R$RR%(Rtvolumetnew_size_bytesR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR|³s cCs|jjdttƒƒƒS(sß 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. tvolume_replicate(R#R$RR%(RRxtrep_typet volume_srctnameR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÈs cCs|jjdttƒƒƒS(sB Returns the size of a replicated block in bytes. t!volume_replicate_range_block_size(R#R$RR%(RR`R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRƒÙs cCs|jjdttƒƒƒS(s- 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. tvolume_replicate_range(R#R$RR%(RR€Rt volume_desttrangesR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR„ës cCs|jjdttƒƒƒS(sQ Deletes a volume. Returns None on success, else job id t volume_delete(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR‡üscCs|jjdttƒƒƒS(sx Makes a volume available to the host returns None on success, else raises LsmError on errors. t volume_enable(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRˆ scCs|jjdttƒƒƒS(sz Makes a volume unavailable to the host returns None on success, else raises LsmError on errors. tvolume_disable(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR‰scCs,t|tjƒ|jjdttƒƒƒS(s2 Returns an array of disk objects tdisks(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRŠ*scCs|jjdttƒƒƒS(s< Allows an access group to access a volume. t volume_mask(R#R$RR%(Rt access_groupR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR‹8scCs|jjdttƒƒƒS(sA Revokes access for an access group for a volume t volume_unmask(R#R$RR%(RRŒR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyREscCs,t|tjƒ|jjdttƒƒƒS(s1 Returns a list of access groups t access_groups(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRŽRscCs>tj||dtƒd\}}|jjdttƒƒƒS(ss Creates an access group and add the specified initiator id, init_type and desired access. Rmitaccess_group_create(RRoR2R#R$RR%(RR‚Rqt init_typeR`R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRcscCs|jjdttƒƒƒS(s) Deletes an access group taccess_group_delete(R#R$RR%(RRŒR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR‘sscCs>tj||dtƒd\}}|jjdttƒƒƒS(s6 Adds an initiator to an access group Rmitaccess_group_initiator_add(RRoR2R#R$RR%(RRŒRqRR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR’scCs8tj|ddtƒd}|jjdttƒƒƒS(s; Deletes an initiator from an access group Rmitaccess_group_initiator_deleteN(RRoROR2R#R$RR%(RRŒRqRR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR“’s  cCs|jjdttƒƒƒS(sN Returns the list of volumes that access group has access to. t"volumes_accessible_by_access_group(R#R$RR%(RRŒR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR”¢s cCs|jjdttƒƒƒS(se Returns the list of access groups that have access to the specified volume. taccess_groups_granted_to_volume(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR•±s cCs|jjdttƒƒƒS(sÐ 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. tvolume_child_dependency(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR–¿scCs|jjdttƒƒƒS(sÐ 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. tvolume_child_dependency_rm(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR—Ís cCs,t|tjƒ|jjdttƒƒƒS(sC Returns a list of file systems on the controller. tfs(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR˜âscCs|jjdttƒƒƒS(s WARNING: Destructive Deletes a file system and everything it contains Returns None on success, else job id t fs_delete(R#R$RR%(RR˜R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR™ïscCs|jjdttƒƒƒS(sË 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. t fs_resize(R#R$RR%(RR˜R~R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRšs cCs|jjdttƒƒƒS(s  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. t fs_create(R#R$RR%(RRxR‚RzR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR›s cCs|jjdttƒƒƒS(s# 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. tfs_clone(R#R$RR%(Rtsrc_fst dest_fs_nametsnapshotR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRœ&s cCs|jjdttƒƒƒS(sü 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 t fs_file_clone(R#R$RR%(RR˜t src_file_nametdest_file_nameRŸR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR ;s cCs|jjdttƒƒƒS(sO Returns a list of snapshot names for the supplied file system t fs_snapshots(R#R$RR%(RR˜R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR£LscCs|jjdttƒƒƒS(s| 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. tfs_snapshot_create(R#R$RR%(RR˜t snapshot_nameR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¤YscCs|jjdttƒƒƒS(s£ Frees the re-sources for the given snapshot on the supplied filesystem. Returns None on success else job id, LsmError exception on error tfs_snapshot_delete(R#R$RR%(RR˜RŸR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¦oscCs|jjdttƒƒƒS(s6 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 tfs_snapshot_restore(R#R$RR%(RR˜RŸR7t restore_filest all_filesR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR§‚scCs|jjdttƒƒƒS(s& 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. tfs_child_dependency(R#R$RR%(RR˜R7R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRª™scCs|jjdttƒƒƒS(sõ 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. tfs_child_dependency_rm(R#R$RR%(RR˜R7R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR«©s cCs|jjdttƒƒƒS(sH What types of NFS client authentication are supported. t export_auth(R#R$RR%(RR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¬¼scCs,t|tjƒ|jjdttƒƒƒS(sL Get a list of all exported file systems on the controller. texports(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR­Ésc CsQt|ƒt|ƒt|ƒr5ttjdƒ‚n|jjdttƒƒƒS(sD Exports a filesystem as specified in the arguments s(Host cannot both in rw_list and ro_list.t export_fs(tsetR R RkR#R$RR%( Rtfs_idt export_patht root_listtrw_listtro_listtanon_uidtanon_gidt auth_typetoptionsR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR®Þs   cCs|jjdttƒƒƒS(s. Removes the specified export t export_remove(R#R$RR%(RtexportR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¹ðscCs,t|tjƒ|jjdttƒƒƒS(s0 Returns a list of target ports t target_ports(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR»ýscCs|jjdttƒƒƒS(sQuery 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 example, 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. tvolume_raid_info(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¼ s[cCs|jjdttƒƒƒS(s? 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 tpool_member_info(R#R$RR%(RRxR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR½ns`cCs|jjdttƒƒƒS(sû 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. tvolume_raid_create_cap_get(R#R$RR%(RR`R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¾Ös5c CsÀt|ƒdkr'ttjdƒ‚n|tjkr]t|ƒdkr]ttjdƒ‚n|tjkr“t|ƒdkr“ttjdƒ‚n|tjkrÉt|ƒdkrÉttjdƒ‚n|tjkrt|ƒdsút|ƒdkrttjd ƒ‚qn|tj kr[t|ƒdsCt|ƒd kr[ttjd ƒ‚q[n|tj kr¤t|ƒdsŒt|ƒd kr¤ttjd ƒ‚q¤n|j j dt tƒƒƒS(s 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 chosen 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. is.Illegal input disks argument: no disk includedis7Illegal input disks argument: RAID 1 only allow 2 disksis<Illegal input disks argument: RAID 5 require 3 or more disksis<Illegal input disks argument: RAID 6 require 4 or more diskssRIllegal input disks argument: RAID 10 require even disks count and 4 or more disksisRIllegal input disks argument: RAID 50 require even disks count and 6 or more disksisRIllegal input disks argument: RAID 60 require even disks count and 8 or more diskstvolume_raid_create(tlenR R RkRtRAID_TYPE_RAID1tRAID_TYPE_RAID5tRAID_TYPE_RAID6tRAID_TYPE_RAID10tRAID_TYPE_RAID50tRAID_TYPE_RAID60R#R$RR%(RR‚t raid_typeRŠt strip_sizeR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyR¿s@Y ! ! ! """cCs|jjdttƒƒƒS(sF lsm.Client.volume_ident_led_on(self, volume, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: This method enables the IDENT LED on a volume if supported Parameters: volume (lsm.Volume) An lsm.Volume object. flags (int) Optional. Reserved for future use. Should be set as lsm.Client.FLAG_RSVD. Returns: returns None on success, else raises LsmError on errors. SpecialExceptions: tvolume_ident_led_on(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÉžscCs|jjdttƒƒƒS(sK lsm.Client.volume_ident_led_off(self, volume, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: This method disables the IDENT LED on a volume if supported Parameters: volume (lsm.Volume) An lsm.Volume object. flags (int) Optional. Reserved for future use. Should be set as lsm.Client.FLAG_RSVD. Returns: returns None on success, else raises LsmError on errors. SpecialExceptions: tvolume_ident_led_off(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRʹscCs,t|tjƒ|jjdttƒƒƒS(s~ lsm.Client.batteries(self, search_key=None, search_value=None, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: Query batteries. When present, super capacitors will also be included. Parameters: search_key (string, optional) The key name for the search. Valid search keys are stored in lsm.Battery.SUPPORTED_SEARCH_KEYS search_value (string, optional) The value of search_key to match. flags (int, optional): Reserved for future use. Should be set as lsm.Client.FLAG_RSVD Returns: [lsm.Battery] lsm.Battery (object) lsm.Battery.id (string) Unique ID for this cache hardware. lsm.Battery.name (string) Human friendly name, might include physical location, model name and etc. lsm.Battery.type (int) The hardware type of cache. Could be one of these values: lsm.Battery.TYPE_CHEMICAL Chemical battery. lsm.Battery.TYPE_CAPACITOR Supper capacitor. lsm.Battery.TYPE_OTHER Vendor specific battery type. lsm.Battery.TYPE_UNKNOWN Unknown type. lsm.Battery.status (int, bitmap) Could be any combination of these values: lsm.Battery.STATUS_OK Battery is fully charged, health and not in use currently. lsm.Battery.STATUS_DISCHARGING Battery is in use. lsm.Battery.STATUS_CHARGING Battery is charging. lsm.Battery.STATUS_LEARNING Battery is calibrating itself by discharging battery and recharging again. lsm.Battery.STATUS_DEGRADED Battery is in degraded mode, need attention. For example, battery is near end of life. lsm.Battery.STATUS_ERROR Battery is having hardware error or end of life. lsm.Battery.STATUS_OTHER Vendor specific status. lsm.Battery.STATUS_UNKNOWN Unknown. lsm.Battery.system_id (string) The id of system which current battery belong to. SpecialExceptions: LsmError ErrorNumber.NO_SUPPORT Capability: lsm.Capabilities.BATTERIES t batteries(RRRbR#R$RR%(RRRcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRËÏsBcCs|jjdttƒƒƒS(sø lsm.Client.volume_cache_info(self, volume, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: Query RAM cache setting and status of specified volume on read and write I/O. Parameters: volume (Lsm.Volume) The lsm.Volume instance. flags (int, optional): Reserved for future use. Should be set as lsm.Client.FLAG_RSVD Returns: [int, int, int, int, int] write_cache_policy (int) The write cache policy. Valid values are: * lsm.Volume.WRITE_CACHE_POLICY_WRITE_BACK The storage system will use write back mode if cache hardware found. * lsm.Volume.WRITE_CACHE_POLICY_AUTO The controller will use write back mode when battery/capacitor is in good health, otherwise, write through mode. * lsm.Volume.WRITE_CACHE_POLICY_WRITE_THROUGH The storage system will use write through mode. * lsm.Volume.WRITE_CACHE_POLICY_UNKNOWN Plugin failed to detect this setting. write_cache_status (int) The status of write cache. Valid values are: * lsm.Volume.WRITE_CACHE_STATUS_WRITE_THROUGH * lsm.Volume.WRITE_CACHE_STATUS_WRITE_BACK * lsm.Volume.WRITE_CACHE_STATUS_UNKNOWN read_cache_policy (int) The policy for read cache. Valid values are: * lsm.Volume.READ_CACHE_POLICY_ENABLED Read cache is enabled, when reading I/O on previous unchanged written I/O or read I/O in cache will be returned to I/O initiator immediately without checking backing store(normally disk). * lsm.Volume.READ_CACHE_POLICY_DISABLED Read cache is disabled. * lsm.Volume.READ_CACHE_POLICY_UNKNOWN Plugin failed to detect the read cache policy. read_cache_status (int) The status of read cache. Valid values are: * lsm.Volume.READ_CACHE_STATUS_ENABLED * lsm.Volume.READ_CACHE_STATUS_DISABLED * lsm.Volume.READ_CACHE_STATUS_UNKNOWN physical_disk_cache (int) Whether physical disk's cache is enabled or not. Please be advised, HDD's physical disk ram cache might be not protected by storage system's battery or capacitor on sudden power loss, you could lose data if a power failure occurs during a write process. For SSD's physical disk cache, please check with the vendor of your hardware RAID card and SSD disk. Valid values are: * lsm.Volume.PHYSICAL_DISK_CACHE_ENABLED Physical disk cache enabled. * lsm.Volume.PHYSICAL_DISK_CACHE_DISABLED Physical disk cache disabled. * lsm.Volume.PHYSICAL_DISK_CACHE_USE_DISK_SETTING Physical disk cache is determined by the disk vendor via physical disks' SCSI caching mode page(0x08 page). It is strongly suggested to change this value to lsm.Volume.PHYSICAL_DISK_CACHE_ENABLED or lsm.Volume.PHYSICAL_DISK_CACHE_DISABLED * lsm.Volume.PHYSICAL_DISK_CACHE_UNKNOWN Plugin failed to detect the physical disk status. SpecialExceptions: LsmError ErrorNumber.NO_SUPPORT ErrorNumber.NOT_FOUND_VOLUME Capability: lsm.Capabilities.VOLUME_CACHE_INFO tvolume_cache_info(R#R$RR%(RR}R!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÌsRcCsO|tjkr3|tjkr3ttjdƒ‚n|jjdtt ƒƒƒS(sø lsm.Client.volume_physical_disk_cache_update(self, volume, pdc, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: Change the setting of RAM physical disk cache of specified volume. On some product(like HPE SmartArray), this action will be effective at system level which means that even you are requesting a change on a specified volume, this change will apply to all other volumes on the same controller(system). Parameters: volume (Lsm.Volume) The lsm.Volume instance. pdc (int) lsm.Volume.PHYSICAL_DISK_CACHE_ENABLED Enable physical disk cache. lsm.Volume.PHYSICAL_DISK_CACHE_DISABLED Disable physical disk cache flags (int, optional): Reserved for future use. Should be set as lsm.Client.FLAG_RSVD Returns: N/A SpecialExceptions: LsmError ErrorNumber.NO_SUPPORT You might also get NO_SUPPORT error when trying to change SSD physical disk cache on MegaRAID. ErrorNumber.NOT_FOUND_VOLUME Capability: lsm.Capabilities.VOLUME_PHYSICAL_DISK_CACHE_SET Allow changing physical disk cache. lsm.Capabilities.VOLUME_PHYSICAL_DISK_CACHE_SET_SYSTEM_LEVEL Indicate that this action will change system settings which are effective on all volumes in this storage system. For example, on HPE SmartArray, the physical disk cache setting is a controller level setting. s`Argument pdc should be Volume.PHYSICAL_DISK_CACHE_ENABLED or Volume.PHYSICAL_DISK_CACHE_DISABLEDt!volume_physical_disk_cache_update( RtPHYSICAL_DISK_CACHE_ENABLEDtPHYSICAL_DISK_CACHE_DISABLEDR R RkR#R$RR%(RR}tpdcR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÍhs )   cCs^|tjkrB|tjkrB|tjkrBttjdƒ‚n|jjdt t ƒƒƒS(s© lsm.Client.volume_write_cache_policy_update(self, volume, wcp, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: Change the RAM write cache policy on specified volume. If lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_IMPACT_READ is supported(e.g. HPE SmartArray), the changes on write cache policy might also impact read cache policy. If lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_WB_IMPACT_OTHER is supported(e.g. HPE SmartArray), changing write cache policy to write back mode might impact other volumes in the same system. Parameters: volume (Lsm.Volume) The lsm.Volume instance. wcp (int) Could be one of these value: * lsm.Volume.WRITE_CACHE_POLICY_WRITE_BACK Change to write back mode. * lsm.Volume.WRITE_CACHE_POLICY_AUTO Change to auto mode: use write back mode when battery/capacitor is healthy, otherwise use write through. * lsm.Volume.WRITE_CACHE_POLICY_WRITE_THROUGH Change to write through mode. flags (int, optional): Reserved for future use. Should be set as lsm.Client.FLAG_RSVD Returns: N/A SpecialExceptions: LsmError ErrorNumber.NO_SUPPORT ErrorNumber.NOT_FOUND_VOLUME Capability: lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_WRITE_BACK Allow changing to always mode. lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_AUTO Allow changing to auto mode. lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_WRITE_THROUGH Allow changing to disable mode. lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_IMPACT_READ Indicate this action might impact read cache policy. lsm.Capabilities.VOLUME_WRITE_CACHE_POLICY_SET_WB_IMPACT_OTHER Indicate that changing to write back mode might impact other volumes. For example, on HPE SmartArray, changing to write back mode will change all other volumes with auto write cache policy to write back mode. sˆArgument wcp should be Volume.WRITE_CACHE_POLICY_WRITE_BACK or Volume.WRITE_CACHE_POLICY_AUTO or Volume.WRITE_CACHE_POLICY_WRITE_THROUGHt volume_write_cache_policy_update( RtWRITE_CACHE_POLICY_WRITE_BACKtWRITE_CACHE_POLICY_AUTOt WRITE_CACHE_POLICY_WRITE_THROUGHR R RkR#R$RR%(RR}twcpR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÑ›s4   cCsO|tjkr3|tjkr3ttjdƒ‚n|jjdtt ƒƒƒS(s lsm.Client.volume_read_cache_policy_update(self, volume, rcp, flags=lsm.Client.FLAG_RSVD) Version: 1.3 Usage: Change the RAM read cache policy of specified volume. If lsm.Capabilities.VOLUME_READ_CACHE_POLICY_SET_IMPACT_WRITE is supported(like HPE SmartArray), the change on write cache policy might also impact read cache policy. Parameters: volume (Lsm.Volume) The lsm.Volume instance. rcp (int) Could be one of these value: * lsm.Volume.READ_CACHE_POLICY_ENABLED Enable read cache. * lsm.Volume.READ_CACHE_POLICY_DISABLED Disable read cache. flags (int, optional): Reserved for future use. Should be set as lsm.Client.FLAG_RSVD Returns: N/A SpecialExceptions: LsmError ErrorNumber.NO_SUPPORT ErrorNumber.NOT_FOUND_VOLUME Capability: lsm.Capabilities.VOLUME_READ_CACHE_POLICY_SET Allow enabling or disabling read cache policy. lsm.Capabilities.VOLUME_READ_CACHE_POLICY_SET_IMPACT_WRITE Indicate that changing read cache policy might impact write cache policy. For example, on HPE SmartArray, disabling read cache will also change write cache policy to write through. s\Argument rcp should be Volume.READ_CACHE_POLICY_ENABLED or Volume.READ_CACHE_POLICY_DISABLEDtvolume_read_cache_policy_update( RtREAD_CACHE_POLICY_ENABLEDtREAD_CACHE_POLICY_DISABLEDR R RkR#R$RR%(RR}trcpR!((s//usr/lib/python2.7/site-packages/lsm/_client.pyRÖÚs &   iiiiN(_t__name__t __module__t FLAG_RSVDt#FLAG_VOLUME_CREATE_USE_SYSTEM_CACHEt%FLAG_VOLUME_CREATE_USE_IO_PASSTHROUGHt'FLAG_VOLUME_CREATE_DISABLE_SYSTEM_CACHEt)FLAG_VOLUME_CREATE_DISABLE_IO_PASSTHROUGHR"RIt staticmethodR;R)RORMt_return_requiresRNR1tsixt string_typesRXRYRiR[t_IDataR\R^RR_RQRRaRRdReRnRRvRwR|RRƒR„R‡RˆR‰RRŠR‹RRRŽRR‘R’R“R”R•tboolR–R—RR˜R™RšR›RœR R R£R¤R¦R3R§RªR«R¬RR­tANON_UID_GID_NAR®R¹RR»R¼R½R¾R¿RÉRÊRRËRÌRÍRÑRÖ(((s//usr/lib/python2.7/site-packages/lsm/_client.pyR@s             1                           ag> ‡   DS 2 > ("R*RftlsmRRRRRRRRRR R R R R Rt lsm._commonRRâRR=tlsm._transportRR/t lsm._dataRRåRãRRRR(((s//usr/lib/python2.7/site-packages/lsm/_client.pyts  d