-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sas2ircu and sas3ircu support #595
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"copyright": "Copyright 2016, EMC, Inc.", | ||
"properties": { | ||
"adapter": { | ||
"$ref": "flash-megaraid.json#/definitions/Adapter" | ||
} | ||
}, | ||
"required": ["adapter"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2015, EMC, Inc. | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
friendlyName: 'Catalog sasraid', | ||
injectableName: 'Task.Catalog.sasraid', | ||
implementsTask: 'Task.Base.Linux.Catalog', | ||
optionsSchema: 'catalog-sas.json', | ||
options: { | ||
adapter: '0', | ||
commands: [ | ||
'sudo python /opt/sas_info.py /opt/sas2ircu', | ||
'sudo python /opt/sas_info.py /opt/sas3ircu' | ||
] | ||
}, | ||
properties: { | ||
catalog: { | ||
type: 'sasraid' | ||
} | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ function commandParserFactory(Logger, Promise, _) { | |
perccliDriveInfo = 'sudo /opt/MegaRAID/perccli/perccli64 /c0 /eall /sall show all J', | ||
perccliVirtualDiskInfo = 'sudo /opt/MegaRAID/perccli/perccli64 /c0 /vall show all J', | ||
perccliVersionInfo = 'sudo /opt/MegaRAID/perccli/perccli64 -v', | ||
sas2ircuInfo = 'sudo python /opt/sas_info.py /opt/sas2ircu', | ||
sas3ircuInfo = 'sudo python /opt/sas_info.py /opt/sas2ircu', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the key word is sas3ircu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, my carelessness . |
||
mpt2fusionAdapterInfo = 'sudo /opt/mpt/mpt2fusion/sas2flash -s -list', | ||
mellanoxInfo = 'sudo mlxfwmanager --query-xml', | ||
lshw = 'sudo lshw -json', | ||
|
@@ -729,6 +731,38 @@ function commandParserFactory(Logger, Promise, _) { | |
}; | ||
|
||
|
||
CommandParser.prototype[sas2ircuInfo] = function(data) { | ||
if (data.error) { | ||
return Promise.resolve({ source: 'megaraid-controllers', error: data.error }); | ||
} | ||
try { | ||
var store = true; | ||
var parsed = JSON.parse(data.stdout); | ||
if (parsed.Controllers[0]['Command Status'].Status === 'Failure') { | ||
store = false; | ||
} | ||
return Promise.resolve({ data: parsed, source: 'megaraid-controllers', store: store }); | ||
} catch (e) { | ||
return Promise.resolve({ source: 'megaraid-controllers', error: e }); | ||
} | ||
}; | ||
|
||
CommandParser.prototype[sas3ircuInfo] = function(data) { | ||
if (data.error) { | ||
return Promise.resolve({ source: 'megaraid-controllers', error: data.error }); | ||
} | ||
try { | ||
var store = true; | ||
var parsed = JSON.parse(data.stdout); | ||
if (parsed.Controllers[0]['Command Status'].Status === 'Failure') { | ||
store = false; | ||
} | ||
return Promise.resolve({ data: parsed, source: 'megaraid-controllers', store: store }); | ||
} catch (e) { | ||
return Promise.resolve({ source: 'megaraid-controllers', error: e }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the source here still "megaraid-controllers"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not very familiar with sas2008/sas3008 raid card series, if these cards are mega series? |
||
} | ||
}; | ||
|
||
CommandParser.prototype[megaraidVirtualDiskInfo] = function(data) { | ||
if (data.error) { | ||
return Promise.resolve({ source: 'megaraid-virtual-disks', error: data.error }); | ||
|
@@ -809,6 +843,8 @@ function commandParserFactory(Logger, Promise, _) { | |
CommandParser.prototype[perccliVirtualDiskInfo] = | ||
CommandParser.prototype[megaraidVirtualDiskInfo]; | ||
CommandParser.prototype[perccliAdapterInfo] = CommandParser.prototype[megaraidAdapterInfo]; | ||
CommandParser.prototype[sas2ircuInfo] = CommandParser.prototype[sas2ircuInfo]; | ||
CommandParser.prototype[sas3ircuInfo] = CommandParser.prototype[sas3ircuInfo]; | ||
CommandParser.prototype[perccliControllerCount] = | ||
CommandParser.prototype[megaraidControllerCount]; | ||
CommandParser.prototype[mpt2fusionAdapterInfo] = function(data) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use linux command job for template rendering, and don't need to modify the basic catalog job here which might bring side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once upon a time, my raid card could not get catalog info successfully, a certain RackHd developer told me to modify these code. I could not find slack Threads for this.If it is not a bug, I think here code is useless.