背景
182x网卡需要支持对网卡网口数量进行动态配置和切换,实现网卡从2网口模式到4网口模式的灵活切换,满足不同业务场景需求。当前无配置导入导出项及web接口进行承载,需要新增配置导入导出项及web接口实现网卡网口数量配置。
关联ISSUE
整体方案
1、新增资源树协作对象和接口承载预加载端口数量,可由web和redfish接口查询和设置;
2、配置两个不同的网卡CSR文件分别对应2网口和4网口,自发现根据预加载端口数量选择加载不同的网卡CSR文件;
"NetworkAdapterPreload_1": {
"PortCount": 2,
"PortCountAllowableValues": [2, 4]
},
"Connector_PCIE_2Port": {
"Bom": "14140130",
"Slot": 3,
"Presence": "<=/NetworkAdapterPreload_1.PortCount |> expr($1 == 2 ? 1 : 0)",
"Id": "111",
"AuxId": "222"
},
"Connector_PCIE_4Port": {
"Bom": "14140130",
"Slot": 3,
"Presence": "<=/NetworkAdapterPreload_1.PortCount |> expr($1 == 4 ? 1 : 0)",
"Id": "aaa",
"AuxId": "bbb"
}
评审点
1、配置导入导出项支持网卡待生效网口数量配置
2、web接口支持查询网卡待生效网口数量
2、web接口支持设置网卡待生效网口数量
详细描述
评审点1: 配置导入导出项支持网卡待生效网口数量配置
新增NetworkAdapterPreload配置项类别,类型为数组,数组元素类型为对象,包含配置项如下:
| 配置项名称 | 配置项类别 | 配置项 | 归属组件 | 取值说明 | 导入导出类型 | 导出后是否可直接导入 |
|---|---|---|---|---|---|---|
| 网卡NodeId(网卡设备标识符) | NetworkAdapterPreload | NodeId | network_adapter | string | ExportOnly | 否 |
| 预加载端口数量 | NetworkAdapterPreload | PortCount | network_adapter | integer | ImportAndExport | 否 |
| 预加载端口数量允许的取值范围 | NetworkAdapterPreload | PortCountAllowableValues | network_adapter | array,数组元素类型为integer | ExportOnly | 否 |
评审点2: web接口支持查询网卡待生效网口数量
URI: https://device_ip/UI/Rest/System/NetworkAdapter/:adapterId
操作类型: GET
变化类型: 新增属性
操作权限:ReadOnly
请求消息体:无
| 属性名称 | 取值类型 | 说明 | 取值范围 | 默认值 | 约束 |
|---|---|---|---|---|---|
| PortCount | integer | 当前生效端口数量 | - | 无 | |
| PreloadPortCount | integer | 预加载端口数量 | - | 无 | |
| PreloadPortCountAllowableValues | array,数组元素类型为integer | 预加载端口数量取值,例如[2,4]表示支持配置成2口或4口 | - | 无 |
响应:
{
"AdapterId": "PCIeCard4(SP566)",
"AssociatedResource": "CPU2",
...
"PortCount": 2,
"PreloadPortCount": 4,
"PreloadPortCountAllowableValues": [2, 4]
}
评审点3: web接口支持设置网卡待生效网口数量
URI: https://device_ip/UI/Rest/System/NetworkAdapter/:adapterId
操作类型: PATCH
变化类型: 新增操作类型
操作权限:BasicSetting
请求消息体:
{
"PreloadPortCount": 4
}
| 属性名称 | 取值类型 | 说明 | 取值范围 | 默认值 | 约束 |
|---|---|---|---|---|---|
| PreloadPortCount | integer | 预加载端口数量 | - | 无 |
响应:
{
"AdapterId": "PCIeCard4(SP566)",
"AssociatedResource": "CPU2",
...
"PortCount": 4,
"PreloadPortCount": 4,
"PreloadPortCountAllowableValues": [2, 4]
}
错误引擎:
属性类型错误:
"PropertyValueTypeError": {
"Description": "Indicates that a property was given the wrong value type, such as when a number is supplied for a property that requires a string.",
"Message": "The value %1 for the property %2 is of a different type than the property can accept.",
"Severity": "Warning",
"NumberOfArgs": 2,
"ParamTypes": [
"string",
"string"
],
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed.",
"HttpStatusCode": 400,
"IpmiCompletionCode": "0xFF",
"SnmpStatusCode": 7,
"TraceDepth": 0
}
属性取值不支持:
"PropertyValueNotInList": {
"Description": "Indicates that a property was given the correct value type but the value of that property was not supported. This values not in an enumeration",
"Message": "The value %1 for the property %2 is not in the list of acceptable values.",
"Severity": "Warning",
"NumberOfArgs": 2,
"ParamTypes": [
"string",
"string"
],
"Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed.",
"HttpStatusCode": 400,
"IpmiCompletionCode": "0xC9",
"SnmpStatusCode": 10,
"TraceDepth": 0
}
评审结论
1、配置导入导出项支持网卡待生效网口数量配置
同意新增NetworkAdapterPreload配置项类别,类型为数组,数组元素类型为对象,包含配置项如下:
NodeId:网卡NodeId(网卡设备标识符),类型为stringPortCount:预加载端口数量,类型为integerPortCountAllowableValues:预加载端口数量取值,类型为array,数组元素类型为integer
2、web接口支持查询网卡待生效网口数量
同意新增如下属性:
uri:https://device_ip/UI/Rest/System/NetworkAdapter/:adapterId
操作类型:GET
权限:ReadOnly
变化类型:新增属性
PortCount:当前生效端口数量,类型为integerPreloadPortCount:预加载端口数量,类型为integerPreloadPortCountAllowableValues:预加载端口数量取值,类型为array,数组元素类型为integer
3、web接口支持设置网卡待生效网口数量
同意新增如下属性设置接口:
uri:https://device_ip/UI/Rest/System/NetworkAdapter/:adapterId
操作类型:PATCH
权限:BasicSetting
变化类型:新增操作类型
PreloadPortCount:预加载端口数量,类型为integer