Gris Ge
2014-03-27 13:19:56 UTC
Hi Guys,
I have finished the draft on python API document for lsm.System and
lsm.Disk:
https://sourceforge.net/p/libstoragemgmt/wiki/Python_API_Usage/
Any feedback will be appreciated, especially about API design and document
layout.
I also noted down changes between document and current code:
## System
* If we cannot explain all possible combination of bit array map for
System.status, I would suggest we move to constant value.
Checked disk, pool and volume classes, no need to maintain a bit map.
Vendor implementation on system status:
* SMI-S plugin:
SNIA SMI-S OperationalStatus just use bit array to
identify the severe level of error and treat stress and
degraded as OK.
(1.6rev4 Common book, Section 25, PDF Page 25)
* ONTAP plugin:
ONTAP API (8.2) does not support status in 7-mode.
system-node-get() of cluster-mode has temprature, fan, battery
status. We can use them to determine the system status in the future.
* targetd plugin:
No support.
When system having multiple issue need different state string, we set to
the worst state. Example, system is having these errors:
* 2 Disks offline in on RAID 5 pool. -- STATUS_ERROR
* A battery is end of life. -- STATUS_DEGRADED
* A battery is near end of life. -- STATUS_PREDICTIVE_FAILURE
In this case, we set status to the worst state: STATUS_ERROR. Check wiki
page for server level of these status.
* Changed method:
lsm.Client.systems(system_id=None)
# Supporting querying system with given ID. Return a array/list with
# given system object only.
* Do we really need 'flags' as reserved parameter for future use?
I found no python project using reserving a parameter for future use.
* Added constants:
lsm.System.STATUS_UNKNOWN
lsm.System.STATUS_STRESSED
lsm.System.STATUS_STARTING
lsm.System.STATUS_STOPPING
lsm.System.STATUS_STOPPED
lsm.System.STATUS_OTHER
* Removed constants:
lsm.System.STATUS_VENDOR_SPECIFIC
# Replaced by lsm.System.STATUS_UNKNOWN or lsm.System.STATUS_OTHER
* Added property:
lsm.System.status_info
# Free form string. For these uses:
# 1. Store detail error message when
# lsm.System.STATUS_ERROR or lsm.System.STATUS_DEGRADED or
# lsm.System.STATUS_PREDICTIVE_FAILURE or
# lsm.System.STATUS_STRESSED
# 2. Store vendor specific status information when lsm.System.STATUS_OTHER
## Disk
* Removed constants:
lsm.Disk.DISK_TYPE_NOT_APPLICABLE
# No real use
lsm.Disk.STATUS_RECONSTRUCTING
# Reconstruction should be status of pool
lsm.Disk.RETRIEVE_FULL_INFO
# lsm.Client.disks(disk_id=None, opt_data=False) does not this constant.
* Added constants:
lsm.Disk.DISK_TYPE_LUN
# Indicate array is treating remote LUN as its disks to assemble Pool.
* 'num_of_blocks' and 'size_bytes', does C or json hold the integer as large
as python do -- sys.maxint(9223372036854775807)?
* Change 'size_bytes' to defined not calculate on runtime. The definition of
'size_bytes' is usable size. Some array(like EMC CX/VNX) support DIF disk
which sector size is 520, but only 512 is usable. Using 'block size'
multiple count of block is incorrect.
* Move 'status_info' from optional property to mandatory property.
* Removed optional property:
owner_ctrler_id
# No controller support yet.
I have finished the draft on python API document for lsm.System and
lsm.Disk:
https://sourceforge.net/p/libstoragemgmt/wiki/Python_API_Usage/
Any feedback will be appreciated, especially about API design and document
layout.
I also noted down changes between document and current code:
## System
* If we cannot explain all possible combination of bit array map for
System.status, I would suggest we move to constant value.
Checked disk, pool and volume classes, no need to maintain a bit map.
Vendor implementation on system status:
* SMI-S plugin:
SNIA SMI-S OperationalStatus just use bit array to
identify the severe level of error and treat stress and
degraded as OK.
(1.6rev4 Common book, Section 25, PDF Page 25)
* ONTAP plugin:
ONTAP API (8.2) does not support status in 7-mode.
system-node-get() of cluster-mode has temprature, fan, battery
status. We can use them to determine the system status in the future.
* targetd plugin:
No support.
When system having multiple issue need different state string, we set to
the worst state. Example, system is having these errors:
* 2 Disks offline in on RAID 5 pool. -- STATUS_ERROR
* A battery is end of life. -- STATUS_DEGRADED
* A battery is near end of life. -- STATUS_PREDICTIVE_FAILURE
In this case, we set status to the worst state: STATUS_ERROR. Check wiki
page for server level of these status.
* Changed method:
lsm.Client.systems(system_id=None)
# Supporting querying system with given ID. Return a array/list with
# given system object only.
* Do we really need 'flags' as reserved parameter for future use?
I found no python project using reserving a parameter for future use.
* Added constants:
lsm.System.STATUS_UNKNOWN
lsm.System.STATUS_STRESSED
lsm.System.STATUS_STARTING
lsm.System.STATUS_STOPPING
lsm.System.STATUS_STOPPED
lsm.System.STATUS_OTHER
* Removed constants:
lsm.System.STATUS_VENDOR_SPECIFIC
# Replaced by lsm.System.STATUS_UNKNOWN or lsm.System.STATUS_OTHER
* Added property:
lsm.System.status_info
# Free form string. For these uses:
# 1. Store detail error message when
# lsm.System.STATUS_ERROR or lsm.System.STATUS_DEGRADED or
# lsm.System.STATUS_PREDICTIVE_FAILURE or
# lsm.System.STATUS_STRESSED
# 2. Store vendor specific status information when lsm.System.STATUS_OTHER
## Disk
* Removed constants:
lsm.Disk.DISK_TYPE_NOT_APPLICABLE
# No real use
lsm.Disk.STATUS_RECONSTRUCTING
# Reconstruction should be status of pool
lsm.Disk.RETRIEVE_FULL_INFO
# lsm.Client.disks(disk_id=None, opt_data=False) does not this constant.
* Added constants:
lsm.Disk.DISK_TYPE_LUN
# Indicate array is treating remote LUN as its disks to assemble Pool.
* 'num_of_blocks' and 'size_bytes', does C or json hold the integer as large
as python do -- sys.maxint(9223372036854775807)?
* Change 'size_bytes' to defined not calculate on runtime. The definition of
'size_bytes' is usable size. Some array(like EMC CX/VNX) support DIF disk
which sector size is 520, but only 512 is usable. Using 'block size'
multiple count of block is incorrect.
* Move 'status_info' from optional property to mandatory property.
* Removed optional property:
owner_ctrler_id
# No controller support yet.
--
Gris Ge
Gris Ge