Gris Ge
2014-08-05 14:37:16 UTC
Hi Guys,
I am reviewing the lsm.ErrorNumber:
https://sourceforge.net/p/libstoragemgmt/wiki/v1_py_api_user_guide/#appendixf-exceptions-lsmlsmerror
These are changes I would like to discuss:
=========
1. JOB_STARTED
Concern:
Not used by any plugin or lsm.Client methods.
Found in lsmcli where it use it as sys.exit().
Suggest:
Remove it from lsm and move to lsmcli.
2. INDEX_BOUNDS
Concerns:
No idea what it means.
Suggest:
Need documnet.
3. EXISTS_ACCESS_GROUP and other EXISTS_XXX
Concerns:
SMI-S plugin is using EXISTS_ACCESS_GROUP to indicate
another access group is using requested name but not containing
requested initiator ID.
User cannot quickly get this long explaination simply from error
number name, and this is not a sharing error number.
Should we support the replay call -- user invoke the same method
with same argument 2 or more times?
Currently, access group does not raise error on replay call.
Replay call could be:
a. Might be harmful.
If pass the replay call, user might incorrectly use pre-exist
volume. Same thing also apply to fs creation.
We should raise CONFLICT_NAME for this kind of reply call.
b. No harm.
* volume-mask.
* access_group_create()
# with pre-exist access group containing only requested
# initiator id and using request access group name.
Suggest:
Unifiy them into CONFLICT_NAME indicate request name is already in
use when creating.
Another new error number would be CONFLICT_MEMBER indicate requested
member is already used by others. For example, access_group_create()
got a initiator which already used by other access group.
4. FS_NOT_EXPORTED
Concerns:
No idea what it means.
Suggest:
Need documnet.
5. INDEX_BOUNDS
Concerns:
Tony mentioned:
Used today in one case of of StringList when the programmer over
indexes the list. This could be a generic INVALID_ARGUMENT error.
Suggest:
Rename to INVALID_ARGUMENT
6. INVALID_XXX
Concerns:
Tony mentioned:
Most of these are magic check error codes for the C API which
violates #4 item above as all of these are programming errors, not
user input errors. All of these should probably be changed to
INVALID_ARGUMENT as the programmer can fix during development.
Suggest:
Replace by INVALID_ARGUMENT
7. IS_MAPPED and NO_MAPPING
Concern:
Whether we should treat this no-harm replay call as failure or pass.
Suggest:
Treat no-harm replay call as pass.
8. NO_CONNECT
Concerns:
Tony mentioned:
I believe this error should be used to indicate that the plug-in
cannot connect to the array. Only targetd is using it, but I was
unable to force the error condition in my limited testing.
Suggest:
Base on targetd code, it should be replaced by NETWORK_ERROR or
NETWORK_HOSTDOWN.
9. NOT_FOUND_SS
Concerns:
Might confused with volume snapshot.
Suggest:
Renamed to NOT_FOUND_FS_SNAP
10. NOT_FOUND_NFS_EXPORT
Concerns:
In LSM, we have lsm.NfsExport, export_fs(), exports() and
NOT_FOUND_NFS_EXPORT,
Suggest:
Changed to:
fs_export() # like volume_mask()
fs_export_infos() # like planed mask_infos()
NOT_FOUND_FS_EXPORT
lsm.FsExport
11. NOT_FOUND_DISK
Concerns:
No method require this yet.
Suggest:
Remove.
12. NOT_IMPLEMENTED
Concerns:
Does this one mean storage SDK/array can do, but plugin is coded yet.
Suggest:
Use NO_SUPPORT instead.
13. OFFLINE and ON_LINE
Concerns:
Some actions require resource be online or offline before invoking
methods. But literally, OFFLINE might indicate plugin or storage array
or resource offline.
Suggest:
Replace by NO_SUPPORT_ONLINE_CHANGE and NO_SUPPORT_OFFLINE_CHANGE.
And provide dedicate capabilities to guide user.
Which exactly method require this?
14. PLUGIN_DLOPEN
Concerns:
Tony mentiond:
Need to change name, this error indicted C API was unable to
establish, RPC socket to plug-in
Suggest:
SOCKET_TRANS_FAIL
Along with SOCKET_SERIALIZATER_FAIL and SOCKET_JSON_INVALID_ARG
15. PLUGIN_DLSYM
Concerns
Tony mentioned:
Can be deleted, was used when we had shared object plugins
Suggest:
Remove.
16. PLUGIN_ERROR
Concerns:
Should be replaced by LSM_PLUGIN_BUG
Suggest:
Replace by LSM_PLUGIN_BUG
17. PLUGIN_MISSING_HOST, PLUGIN_MISSING_NS, PLUGIN_MISSING_PORT
Concerns:
Can be replaced by INVALID_URI
Suggest:
Replace by INVALID_URI for URI syntax error and require field
missing.
18. PLUGIN_PERMISSION
Concerns:
Renamed to PLUGIN_SOCKET_PERMISSION_ERROR
Suggest:
Check above
19. PLUGIN_UNKNOWN_HOST
Concerns:
DNS name resolve problem could be count as NETWORK_ERROR
Suggest:
Replace by NETWORK_ERROR
20. PLUGIN_TIMEOUT
Concerns:
Duplicate with TIMEOUT
Suggest:
Remove.
21. SIZE_INSUFFICIENT_SPACE, SIZE_TOO_LARGE
Concerns:
Replace by NO_ENOUGH_SPACE
Suggest.
Replace by NO_ENOUGH_SPACE
22. SIZE_SAME
Concerns:
If size is the same, volume_resize() or fs_resize() should treat it
as pass.
Suggest:
Remove.
23. SIZE_TOO_SMALL
Concerns:
Any ideas? I(Gris) haven't try to reproduce it yet.
Suggest:
We keep it.
24. UNSUPPORTED_PROVISIONING
Suggest:
Replace with INVALID_ARGUMENT or NO_SUPPORT base on use case.
25. DISK_BUSY
Concern:
No need.
Suggest:
Remove.
26. VOLUME_BUSY
Suggest:
Replaced by:
VOLUME_MASKED
VOLUME_IS_REPLICATE_SOURCE # Are we keeping volume_replicate()?
27. ACCESS_GROUP_BUSY and MASKED_ACCESS_GROUP
Suggest:
Replaced by:
ACCESS_GROUP_MASKED
=========
Thank you in advance.
Best regards.
I am reviewing the lsm.ErrorNumber:
https://sourceforge.net/p/libstoragemgmt/wiki/v1_py_api_user_guide/#appendixf-exceptions-lsmlsmerror
These are changes I would like to discuss:
=========
1. JOB_STARTED
Concern:
Not used by any plugin or lsm.Client methods.
Found in lsmcli where it use it as sys.exit().
Suggest:
Remove it from lsm and move to lsmcli.
2. INDEX_BOUNDS
Concerns:
No idea what it means.
Suggest:
Need documnet.
3. EXISTS_ACCESS_GROUP and other EXISTS_XXX
Concerns:
SMI-S plugin is using EXISTS_ACCESS_GROUP to indicate
another access group is using requested name but not containing
requested initiator ID.
User cannot quickly get this long explaination simply from error
number name, and this is not a sharing error number.
Should we support the replay call -- user invoke the same method
with same argument 2 or more times?
Currently, access group does not raise error on replay call.
Replay call could be:
a. Might be harmful.
If pass the replay call, user might incorrectly use pre-exist
volume. Same thing also apply to fs creation.
We should raise CONFLICT_NAME for this kind of reply call.
b. No harm.
* volume-mask.
* access_group_create()
# with pre-exist access group containing only requested
# initiator id and using request access group name.
Suggest:
Unifiy them into CONFLICT_NAME indicate request name is already in
use when creating.
Another new error number would be CONFLICT_MEMBER indicate requested
member is already used by others. For example, access_group_create()
got a initiator which already used by other access group.
4. FS_NOT_EXPORTED
Concerns:
No idea what it means.
Suggest:
Need documnet.
5. INDEX_BOUNDS
Concerns:
Tony mentioned:
Used today in one case of of StringList when the programmer over
indexes the list. This could be a generic INVALID_ARGUMENT error.
Suggest:
Rename to INVALID_ARGUMENT
6. INVALID_XXX
Concerns:
Tony mentioned:
Most of these are magic check error codes for the C API which
violates #4 item above as all of these are programming errors, not
user input errors. All of these should probably be changed to
INVALID_ARGUMENT as the programmer can fix during development.
Suggest:
Replace by INVALID_ARGUMENT
7. IS_MAPPED and NO_MAPPING
Concern:
Whether we should treat this no-harm replay call as failure or pass.
Suggest:
Treat no-harm replay call as pass.
8. NO_CONNECT
Concerns:
Tony mentioned:
I believe this error should be used to indicate that the plug-in
cannot connect to the array. Only targetd is using it, but I was
unable to force the error condition in my limited testing.
Suggest:
Base on targetd code, it should be replaced by NETWORK_ERROR or
NETWORK_HOSTDOWN.
9. NOT_FOUND_SS
Concerns:
Might confused with volume snapshot.
Suggest:
Renamed to NOT_FOUND_FS_SNAP
10. NOT_FOUND_NFS_EXPORT
Concerns:
In LSM, we have lsm.NfsExport, export_fs(), exports() and
NOT_FOUND_NFS_EXPORT,
Suggest:
Changed to:
fs_export() # like volume_mask()
fs_export_infos() # like planed mask_infos()
NOT_FOUND_FS_EXPORT
lsm.FsExport
11. NOT_FOUND_DISK
Concerns:
No method require this yet.
Suggest:
Remove.
12. NOT_IMPLEMENTED
Concerns:
Does this one mean storage SDK/array can do, but plugin is coded yet.
Suggest:
Use NO_SUPPORT instead.
13. OFFLINE and ON_LINE
Concerns:
Some actions require resource be online or offline before invoking
methods. But literally, OFFLINE might indicate plugin or storage array
or resource offline.
Suggest:
Replace by NO_SUPPORT_ONLINE_CHANGE and NO_SUPPORT_OFFLINE_CHANGE.
And provide dedicate capabilities to guide user.
Which exactly method require this?
14. PLUGIN_DLOPEN
Concerns:
Tony mentiond:
Need to change name, this error indicted C API was unable to
establish, RPC socket to plug-in
Suggest:
SOCKET_TRANS_FAIL
Along with SOCKET_SERIALIZATER_FAIL and SOCKET_JSON_INVALID_ARG
15. PLUGIN_DLSYM
Concerns
Tony mentioned:
Can be deleted, was used when we had shared object plugins
Suggest:
Remove.
16. PLUGIN_ERROR
Concerns:
Should be replaced by LSM_PLUGIN_BUG
Suggest:
Replace by LSM_PLUGIN_BUG
17. PLUGIN_MISSING_HOST, PLUGIN_MISSING_NS, PLUGIN_MISSING_PORT
Concerns:
Can be replaced by INVALID_URI
Suggest:
Replace by INVALID_URI for URI syntax error and require field
missing.
18. PLUGIN_PERMISSION
Concerns:
Renamed to PLUGIN_SOCKET_PERMISSION_ERROR
Suggest:
Check above
19. PLUGIN_UNKNOWN_HOST
Concerns:
DNS name resolve problem could be count as NETWORK_ERROR
Suggest:
Replace by NETWORK_ERROR
20. PLUGIN_TIMEOUT
Concerns:
Duplicate with TIMEOUT
Suggest:
Remove.
21. SIZE_INSUFFICIENT_SPACE, SIZE_TOO_LARGE
Concerns:
Replace by NO_ENOUGH_SPACE
Suggest.
Replace by NO_ENOUGH_SPACE
22. SIZE_SAME
Concerns:
If size is the same, volume_resize() or fs_resize() should treat it
as pass.
Suggest:
Remove.
23. SIZE_TOO_SMALL
Concerns:
Any ideas? I(Gris) haven't try to reproduce it yet.
Suggest:
We keep it.
24. UNSUPPORTED_PROVISIONING
Suggest:
Replace with INVALID_ARGUMENT or NO_SUPPORT base on use case.
25. DISK_BUSY
Concern:
No need.
Suggest:
Remove.
26. VOLUME_BUSY
Suggest:
Replaced by:
VOLUME_MASKED
VOLUME_IS_REPLICATE_SOURCE # Are we keeping volume_replicate()?
27. ACCESS_GROUP_BUSY and MASKED_ACCESS_GROUP
Suggest:
Replaced by:
ACCESS_GROUP_MASKED
=========
Thank you in advance.
Best regards.
--
Gris Ge
Gris Ge