Discussion:
[PATCH] MegaRAID plugin: Add perccli support
Charles Rose
2015-06-05 17:29:33 UTC
Permalink
storcli will not work on with Dell PERC (PowerEdge RAID Controller).
perccli is compatible with storcli and has been validated for use with
Dell PERC.

Signed-off-by: Charles Rose <***@gmail.com>
---
plugin/megaraid/megaraid.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 62ad028..17e8f77 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -210,7 +210,8 @@ def _lsm_raid_type_to_mega(lsm_raid_type):

class MegaRAID(IPlugin):
_DEFAULT_BIN_PATHS = [
- "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli"]
+ "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli",
+ "/opt/MegaRAID/perccli/perccli64", "/opt/MegaRAID/perccli/perccli"]
_CMD_JSON_OUTPUT_SWITCH = 'J'

def __init__(self):
--
2.4.2
Gris Ge
2015-06-08 02:30:59 UTC
Permalink
Post by Charles Rose
storcli will not work on with Dell PERC (PowerEdge RAID Controller).
perccli is compatible with storcli and has been validated for use with
Dell PERC.
Hi Charles,

Thanks for the patches.

Could include information about your tested hardware information?
Like error message indicate storcli does not work, and hardware model.

I will check with Dell and LSI guys on this meanwhile.

Best regards.
--
Gris Ge
Charles Rose
2015-06-12 14:30:20 UTC
Permalink
Post by Gris Ge
Post by Charles Rose
storcli will not work on with Dell PERC (PowerEdge RAID Controller).
perccli is compatible with storcli and has been validated for use with
Dell PERC.
Hi Charles,
Thanks for the patches.
Could include information about your tested hardware information?
Like error message indicate storcli does not work, and hardware model.
Gris,
I tested this on a Dell PowerEdge R730xd and PERC H330 Mini.

Without patch, storcli installed (no errors reported, but no output as
well):
[***@dell-r730xd-01 ~]# lsmcli --uri=megaraid:// list --type=SYSTEMS
[***@dell-r730xd-01 ~]#

[***@dell-r730xd-01 ~]# lsmcli --uri=megaraid:// list --type=VOLUMES
[***@dell-r730xd-01 ~]#

With patch, storcli and perccli installed:
[***@dell-r730xd-01 ~]# lsmcli --uri=megaraid:// list --type=SYSTEMS
ID | Name | Status | Info
--------------------------------------------------------------------------
3CE00C5 | PERC H330 Mini PCIE 00:03:00:00 ver: 25.2.1.0037 | OK |

[***@dell-r730xd-01 ~]# lsmcli --uri=megaraid:// list --type=VOLUMES
ID | Name | SCSI VPD 0x83 | Size | Disabled | Pool ID
| System ID
--------------------------------------------------------------------------------------
3CE00C5:VD0 | VD 0 | | 145492017152 | No |
3CE00C5:DG0 | 3CE00C5
Post by Gris Ge
I will check with Dell and LSI guys on this meanwhile.
Best regards.
_______________________________________________
libstoragemgmt-devel mailing list
https://lists.fedorahosted.org/mailman/listinfo/libstoragemgmt-devel
Gris Ge
2015-06-13 01:14:47 UTC
Permalink
Post by Charles Rose
Gris,
I tested this on a Dell PowerEdge R730xd and PERC H330 Mini.
Without patch, storcli installed (no errors reported, but no output
With patch 'MegaRAID Plugin: Raise NOT_FOUND_SYSTEM error if not
found.' which already in master tree:
https://github.com/libstorage/libstoragemgmt/commit/50acf0a3fc8dd5eb22adfdf53f86e1e38b897209

User will be informed that no system bean found via storcli.
Oh. The patch is already committed with your gmail ID.

Change committed patch's comments is kind of tough, it requires
overriding master tree which might mess other peoples' next
'git pull'.

How about we add your dell ID into AUTHORS file and megarad.py
author/copyright comments in stead?

Thank you.

Best regards.
--
Gris Ge
Gris Ge
2015-06-10 12:01:56 UTC
Permalink
From: Charles Rose <***@gmail.com>

storcli will not work on with Dell PERC (PowerEdge RAID Controller).
perccli is compatible with storcli and has been validated for use with
Dell PERC.

Signed-off-by: Charles Rose <***@gmail.com>
Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index bf928f9..58d1723 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -210,7 +210,8 @@ def _lsm_raid_type_to_mega(lsm_raid_type):

class MegaRAID(IPlugin):
_DEFAULT_BIN_PATHS = [
- "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli"]
+ "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli",
+ "/opt/MegaRAID/perccli/perccli64", "/opt/MegaRAID/perccli/perccli"]
_CMD_JSON_OUTPUT_SWITCH = 'J'

def __init__(self):
--
1.8.3.1
Gris Ge
2015-06-10 12:01:57 UTC
Permalink
Issue:
The perccli-1.11.03-1.noarch might generate invalid control character:

00001e0 / 0 0 " , \n \t \t \t " R e v i s i
00001f0 o n N o " : " d _ 022 002 r y
0000200 S e "

# Note the 022 and 002 control character.

Fix:
Set 'strict=False' in python json.loads() to allow control character
in string.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 58d1723..4039486 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -301,7 +301,7 @@ def _storcli_exec(self, storcli_cmds, flag_json=True):
raise

if flag_json:
- output_dict = json.loads(output)
+ output_dict = json.loads(output, strict=False)
ctrl_output = output_dict.get('Controllers')
if len(ctrl_output) != 1:
raise LsmError(
--
1.8.3.1
Tony Asleson
2015-06-10 15:01:46 UTC
Permalink
Post by Gris Ge
00001e0 / 0 0 " , \n \t \t \t " R e v i s i
00001f0 o n N o " : " d _ 022 002 r y
0000200 S e "
# Note the 022 and 002 control character.
Set 'strict=False' in python json.loads() to allow control character
in string.
Hi Gris,

Did you try running this json through the C code paths on the client to
ensure that it works? Otherwise we may need to replace these characters
instead of allowing control characters in the json.

Regards,
Tony
Gris Ge
2015-06-11 03:19:23 UTC
Permalink
Post by Tony Asleson
Post by Gris Ge
00001e0 / 0 0 " , \n \t \t \t " R e v i s i
00001f0 o n N o " : " d _ 022 002 r y
0000200 S e "
# Note the 022 and 002 control character.
Set 'strict=False' in python json.loads() to allow control character
in string.
Hi Gris,
Did you try running this json through the C code paths on the client
to ensure that it works? Otherwise we may need to replace these
characters instead of allowing control characters in the json.
Good point.
Maybe remove all control characters is a better choice.
Post by Tony Asleson
Regards,
Tony
--
Gris Ge
Gris Ge
2015-06-11 07:15:18 UTC
Permalink
Changes in V2:

Patch 2/4:
* Replace all non-printable characters to space for json error.

Charles Rose (1):
MegaRAID plugin: Add perccli support

Gris Ge (3):
MegaRAID Plugin: Fix json error for invalid control character.
MegaRAID Plugin: Update manpage for Dell PERC.
MegaRAID Plugin: Raise NOT_FOUND_SYSTEM error if not found.

doc/man/megaraid_lsmplugin.1.in | 33 ++++++++++++++++++++++++++-------
plugin/megaraid/megaraid.py | 12 ++++++++++--
2 files changed, 36 insertions(+), 9 deletions(-)
--
1.8.3.1
Gris Ge
2015-06-11 07:15:19 UTC
Permalink
From: Charles Rose <***@gmail.com>

storcli will not work on with Dell PERC (PowerEdge RAID Controller).
perccli is compatible with storcli and has been validated for use with
Dell PERC.

Signed-off-by: Charles Rose <***@gmail.com>
Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index bf928f9..58d1723 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -210,7 +210,8 @@ def _lsm_raid_type_to_mega(lsm_raid_type):

class MegaRAID(IPlugin):
_DEFAULT_BIN_PATHS = [
- "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli"]
+ "/opt/MegaRAID/storcli/storcli64", "/opt/MegaRAID/storcli/storcli",
+ "/opt/MegaRAID/perccli/perccli64", "/opt/MegaRAID/perccli/perccli"]
_CMD_JSON_OUTPUT_SWITCH = 'J'

def __init__(self):
--
1.8.3.1
Gris Ge
2015-06-11 07:15:20 UTC
Permalink
Issue:
The perccli-1.11.03-1.noarch might generate invalid control character:

00001e0 / 0 0 " , \n \t \t \t " R e v i s i
00001f0 o n N o " : " d _ 022 002 r y
0000200 S e "

# Note the 022 and 002 control character.

Fix:
Remove all non-printable characters([^\x20-\x7e]) to space before pass them
to Python json.loads().

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 2 ++
1 file changed, 2 insertions(+)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 58d1723..6868178 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -300,6 +300,8 @@ def _storcli_exec(self, storcli_cmds, flag_json=True):
else:
raise

+ output = re.sub("[^\x20-\x7e]", " ", output)
+
if flag_json:
output_dict = json.loads(output)
ctrl_output = output_dict.get('Controllers')
--
1.8.3.1
Gris Ge
2015-06-11 07:15:22 UTC
Permalink
* Will raise NOT_FOUND_SYSTEM if no controller found.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 6868178..775612a 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -326,8 +326,13 @@ def _storcli_exec(self, storcli_cmds, flag_json=True):
return output

def _ctrl_count(self):
- return self._storcli_exec(
+ ctrl_count = self._storcli_exec(
["show", "ctrlcount"]).get("Controller Count")
+ if ctrl_count < 1:
+ raise LsmError(
+ ErrorNumber.NOT_FOUND_SYSTEM,
+ "No MegaRAID controller detected by %s" % self._storcli_bin)
+ return ctrl_count

def _lsm_status_of_ctrl(self, ctrl_show_all_output):
lsi_status_info = ctrl_show_all_output['Status']
--
1.8.3.1
Gris Ge
2015-06-11 07:15:21 UTC
Permalink
* Add Dell PERC information.
* Add notes for Volume.id will change in the future.

Signed-off-by: Gris Ge <***@redhat.com>
---
doc/man/megaraid_lsmplugin.1.in | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/doc/man/megaraid_lsmplugin.1.in b/doc/man/megaraid_lsmplugin.1.in
index 0e2f6aa..0e978f2 100644
--- a/doc/man/megaraid_lsmplugin.1.in
+++ b/doc/man/megaraid_lsmplugin.1.in
@@ -1,15 +1,22 @@
-.TH megaraid_lsmplugin "1" "Januray 2015" "megaraid_lsmplugin @VERSION@" "libStorageMgmt"
+.TH megaraid_lsmplugin "1" "June 2015" "megaraid_lsmplugin @VERSION@" "libStorageMgmt"
.SH NAME
megaraid_lsmplugin -- LibstorageMgmt MegaRAID plugin

.SH DESCRIPTION
LibstorageMgmt megaraid plugin allows user to manage LSI MegaRAID via vendor
-tool \fBstorcli\fR[1].
+tool \fBstorcli\fR[1] or Dell PERC via \fBperccli\fR[2].
The 'megaraid_lsmplugin' executable file is for libStorageMgmt
daemon to execute when client user specifies megaraid plugin in the URI.

Extra SELinux actions are required to allowing plugin access the hardware.

+When both storcli and percli is installed, the plugin will use storcli
+by default even that will result in no system found on Dell PERC server.
+In this case, please remove storcli.
+
+Please be noted, current volume ID is just for temperate use, we will change
+to use volume VPD83 as volume ID once vendor provide so.
+
.SH URI
To use this plugin, users should set their URI to this format:
.nf
@@ -20,17 +27,28 @@ To use this plugin, users should set their URI to this format:

.fi

-.TP storcli
+
+.TP
+\fBURI paramerter -- 'storcli'\fR
+
The 'storcli' URI parameter is used to specified the path of storcli tool.
-By default, this plugin will try these paths used by storcli rpm:
-\fB/opt/MegaRAID/storcli/storcli64\fR and \fB/opt/MegaRAID/storcli/storcli\fR.
+By default, this plugin will try these paths:
+
+storcli rpm:
+
+\fB/opt/MegaRAID/storcli/storcli64\fR, \fB/opt/MegaRAID/storcli/storcli\fR
+
+perccli rpm:
+
+\fB/opt/MegaRAID/perccli/perccli64\fR, \fB/opt/MegaRAID/perccli/perccli\fR

.SH ROOT PRIVILEGE
This plugin requires both \fBlsmd\fR daemon and API client running as root
user. Please check manpage \fIlsmd.conf (5)\fR for detail.

.SH SUPPORTED HARDWARES
-Please refer to LSI website for hardware support status of storcli.
+Please refer to LSI or Dell website for hardware support status of
+storcli/perccli.
Detailed support status can be queried via:

* \fBlsm.Client.capabilities()\fR (Python API)
@@ -42,7 +60,8 @@ This plugin only execute \fBstorcli\fR on localhost. No network connection
required.

.SH SEE ALSO
-\fIlsmcli\fR(1), \fIlsmd\fR(1), [1] http://www.lsi.com
+\fIlsmcli\fR(1), \fIlsmd\fR(1), [1] http://www.lsi.com,
+[2] http://www.dell.com

.SH BUGS
Please report bugs to
--
1.8.3.1
Gris Ge
2015-06-10 12:01:59 UTC
Permalink
* Will raise NOT_FOUND_SYSTEM if no controller found.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/megaraid/megaraid.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 4039486..29c9ff8 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -324,8 +324,13 @@ def _storcli_exec(self, storcli_cmds, flag_json=True):
return output

def _ctrl_count(self):
- return self._storcli_exec(
+ ctrl_count = self._storcli_exec(
["show", "ctrlcount"]).get("Controller Count")
+ if ctrl_count < 1:
+ raise LsmError(
+ ErrorNumber.NOT_FOUND_SYSTEM,
+ "No MegaRAID controller detected by %s" % self._storcli_bin)
+ return ctrl_count

def _lsm_status_of_ctrl(self, ctrl_show_all_output):
lsi_status_info = ctrl_show_all_output['Status']
--
1.8.3.1
Gris Ge
2015-06-10 12:01:58 UTC
Permalink
* Add Dell PERC information.
* Add notes for Volume.id will change in the future.

Signed-off-by: Gris Ge <***@redhat.com>
---
doc/man/megaraid_lsmplugin.1.in | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/doc/man/megaraid_lsmplugin.1.in b/doc/man/megaraid_lsmplugin.1.in
index 0e2f6aa..0e978f2 100644
--- a/doc/man/megaraid_lsmplugin.1.in
+++ b/doc/man/megaraid_lsmplugin.1.in
@@ -1,15 +1,22 @@
-.TH megaraid_lsmplugin "1" "Januray 2015" "megaraid_lsmplugin @VERSION@" "libStorageMgmt"
+.TH megaraid_lsmplugin "1" "June 2015" "megaraid_lsmplugin @VERSION@" "libStorageMgmt"
.SH NAME
megaraid_lsmplugin -- LibstorageMgmt MegaRAID plugin

.SH DESCRIPTION
LibstorageMgmt megaraid plugin allows user to manage LSI MegaRAID via vendor
-tool \fBstorcli\fR[1].
+tool \fBstorcli\fR[1] or Dell PERC via \fBperccli\fR[2].
The 'megaraid_lsmplugin' executable file is for libStorageMgmt
daemon to execute when client user specifies megaraid plugin in the URI.

Extra SELinux actions are required to allowing plugin access the hardware.

+When both storcli and percli is installed, the plugin will use storcli
+by default even that will result in no system found on Dell PERC server.
+In this case, please remove storcli.
+
+Please be noted, current volume ID is just for temperate use, we will change
+to use volume VPD83 as volume ID once vendor provide so.
+
.SH URI
To use this plugin, users should set their URI to this format:
.nf
@@ -20,17 +27,28 @@ To use this plugin, users should set their URI to this format:

.fi

-.TP storcli
+
+.TP
+\fBURI paramerter -- 'storcli'\fR
+
The 'storcli' URI parameter is used to specified the path of storcli tool.
-By default, this plugin will try these paths used by storcli rpm:
-\fB/opt/MegaRAID/storcli/storcli64\fR and \fB/opt/MegaRAID/storcli/storcli\fR.
+By default, this plugin will try these paths:
+
+storcli rpm:
+
+\fB/opt/MegaRAID/storcli/storcli64\fR, \fB/opt/MegaRAID/storcli/storcli\fR
+
+perccli rpm:
+
+\fB/opt/MegaRAID/perccli/perccli64\fR, \fB/opt/MegaRAID/perccli/perccli\fR

.SH ROOT PRIVILEGE
This plugin requires both \fBlsmd\fR daemon and API client running as root
user. Please check manpage \fIlsmd.conf (5)\fR for detail.

.SH SUPPORTED HARDWARES
-Please refer to LSI website for hardware support status of storcli.
+Please refer to LSI or Dell website for hardware support status of
+storcli/perccli.
Detailed support status can be queried via:

* \fBlsm.Client.capabilities()\fR (Python API)
@@ -42,7 +60,8 @@ This plugin only execute \fBstorcli\fR on localhost. No network connection
required.

.SH SEE ALSO
-\fIlsmcli\fR(1), \fIlsmd\fR(1), [1] http://www.lsi.com
+\fIlsmcli\fR(1), \fIlsmd\fR(1), [1] http://www.lsi.com,
+[2] http://www.dell.com

.SH BUGS
Please report bugs to
--
1.8.3.1
Loading...