背景
在盘故障预警和健康监控场景下,支持硬盘SMART日志7*24小时持续采集,帮助客户在盘故障定位、健康巡检、预维护时使用。BMC定期采集盘SMART数据,存储日志最多400份,需要提供独立的日志收集接口,避免影响通用信息收集的规格。
关联ISSUE
https://gitcode.com/openUBMC/storage/issues/417
整体方案
RAID卡下的SATA盘和直通NVMe盘,每隔24小时(首次启动1小时采集一次)采集一下SMART信息并存储到日志当中,每个盘日志最多存储400份。用户可以使用Web或Redfish将指定硬盘的日志导出。
评审点
| 评审点 | 标题 | 接口类型 |
|---|---|---|
| 评审点一 | 新增webrest接口 /UI/Rest/System/Storage/Drives/:id/DumpLog | webrest |
| 评审点二 | 新增redfish接口导出硬盘日志/redfish/v1/Managers/:managerid/DiagnosticService/Actions/DiagnosticService.ExportDriveLog | redfish |
| 评审点三 | 新增redfish接口查询导出硬盘日志方法参数/redfish/v1/Managers/:managerid/DiagnosticService/ExportDriveLogActionInfo | redfish |
| 评审点四 | 资源协作接口bmc.kepler.Systems.Storage.Drives新增日志收集方法 | 资源协作 |
详细描述
评审点一:新增webrest接口/UI/Rest/System/Storage/Drives/:id/DumpLog
资源URI:/UI/Rest/System/Storage/Drives/:id/DumpLog
操作类型:Post
应用场景: 硬盘页面触发日志收集
请求参数: {}
响应参数:
{“url”:“/UI/Rest/Task/1”}
评审点二:新增redfish接口导出硬盘日志/redfish/v1/Managers/:managerid/DiagnosticService/Actions/DiagnosticService.ExportDriveLog
URI:/redfish/v1/Managers/:managerid/DiagnosticService/Actions/DiagnosticService.ExportDriveLog
新增资源版本:hwdiagnosticservice.v1_0_0.json
操作类型: Post
操作权限: DiagnoseMgmt
输入参数:
| 参数名 | 类型 | 必填 | 示例/取值约束 | 描述 |
|---|---|---|---|---|
| DriveName | string | 否 | 示例: Disk1 不填表示导出所有盘(槽位)的日志 |
指定硬盘名称 |
| Type | string | 是 | 日志导出类型:URI | 日志类型 |
| Content | string | 是 | 示例: “/tmp/文件路径” | 导出文件路径,支持本地导出和远程导出 |
Schema定义:
hwdiagnosticservice.v1_0_0.json
"ExportDriveLog": {
"patternProperties": {
"^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
"type": [
"array",
"boolean",
"number",
"null",
"object",
"string"
],
"description": "This property shall specify a valid odata or Redfish property."
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "Friendly action name"
},
"target": {
"type": "string",
"format": "uri",
"description": "Link to invoke action"
},
"@Redfish.ActionInfo": {
"description": "The term can be applied to an action to specify a URI to an ActionInfo resource that describes the parameters supported by this instance of the action.",
"type": "string",
"format": "uri-reference",
"readonly": true
}
},
"parameters": {
"DriveId": {
"type": "integer",
"readonly": false,
"requiredParameter": false,
"description": "Drive id.",
"longDescription": "Drive id."
},
"Type": {
"type": "string",
"readonly": false,
"requiredParameter": true,
"description": "Export type.",
"longDescription": "Export type."
},
"Content": {
"type": "string",
"readonly": false,
"requiredParameter": true,
"description": "File export directory.",
"longDescription": "File export directory."
}
},
"description": "This action export Drive log.",
"longDescription": "This action export Drive log."
},
评审点三:新增redfish接口查询导出硬盘日志方法参数/redfish/v1/Managers/:managerid/DiagnosticService/ExportDriveLogActionInfo
资源URI:/redfish/v1/Managers/:managerid/DiagnosticService/ExportDriveLogActionInfo
新增资源版本:hwdiagnosticservice.v1_0_0.json
操作类型: Get
操作权限: ReadOnly
输入参数:
无
响应参数:
{
"@odata.context": "/redfish/v1/$metadata#ActionInfo.ActionInfo",
"@odata.id": "/redfish/v1/Managers/1/DiagnosticService/ExportDriveLogActionInfo",
"@odata.type": "#ActionInfo.v1_0_0.ActionInfo",
"Id": "ExportDriveLogActionInfo",
"Name": "Export Drive Log Action Info",
"Parameters": [
{
"Name": "DriveName",
"DataType": "String",
"Required": false
},
{
"Name": "Type",
"Required": true,
"DataType": "String",
"AllowableValues": [
"URI"
]
},
{
"Name": "Content",
"Required": true,
"DataType": "String"
}
],
"Oem": {}
}
评审点四:资源协作接口bmc.kepler.Systems.Storage.Drives新增日志收集方法
资源协作接口: bmc.kepler.Systems.Storage.Drives
新增方法
| 方法名称 | 请求签名 | 请求参数描述 | 响应签名 | 响应参数描述 | 方法描述 | 访问权限 |
|---|---|---|---|---|---|---|
DumpLog |
ss |
DriveName: 表示硬盘名称,如果未指定明确的硬盘表示导出所有硬盘的日志 OutputFilePath:导出文件路径,字符串类型。1、支持本地导出:“/tmp/文件路径” 2、支持远程导出:“文件传输协议://用户名:密码@ip地址/目录/文件名”,文件传输协议包括五种:sftp、https、nfs、cifs、scp |
u | TaskId: 任务Id, 数字类型U32 | 导出硬盘日志 |
DiagnoseMgmt |
是否准备好AI预审
是
评审结论
- 同意新增硬盘smart日志导出的webrest接口
- 资源URI: /UI/Rest/System/Storage/Drives/:id/DumpLog
- 操作类型:post
- 请求参数为 {}
- 同意新增硬盘smart日志导出的redfish接口
- 资源URI: /redfish/v1/Managers/:managerid/DiagnosticService/Actions/DiagnosticService.ExportDriveLog
- 资源版本: hwdiagnosticservice.v1_0_0.json
- 操作类型:post
- 操作权限: DiagnoseMgmt
- 输入参数:1、DriveName 硬盘名称,类型为string。2、Type为日志导出类型。3、Content为日志导出的路径。
- 同意新增查询硬盘smart日志导出action的参数查询接口。
- 资源URI: /redfish/v1/Managers/:managerid/DiagnosticService/Actions/DiagnosticService.ExportDriveLog
- 操作类型:get
- 资源版本 :hwdiagnosticservice.v1_0_0.json
- 资源权限: ReadOnly
- 同意资源协作接口新增日志收集方法
- 对应接口:bmc.kepler.Systems.Storage.Drives
- 入参:1、DriveName表示硬盘名称,类型为string。2、OutputFilePath表示日志的导出路径,类型为string
- 响应参数:1、TaskId 表示任务的id,类型为u32
- 操作权限为DiagnoseMgmt
遗留问题
1、Type理解错误。
闭环: Type更正为日志导出类型,示例为URI
2、与诉求方对一下,有没有全量收集日志的诉求。如果全量,redfish的DriveId参数要做成可选,资源协作接口要新增全量导出的接口.
闭环: 有全量的诉求,参数DriveId改为DriveName, 不填表示全量导出

