已开启
GroupID #1433
jupitergone创建于 25 天前
GroupID #1433
已开启
共 14 个文件变更+321-189
| @@ -1,5 +1,11 @@ | |||
| 1 | # Changelog | 1 | # Changelog |
| 2 | All notable changes to this project will be documented in this file. | 2 | All notable changes to this project will be documented in this file. |
| 3 | +## [1.110.100] 2026-08-11 | ||
| 4 | +社区软件包剪裁psu work mode的cli接口 | ||
| 5 | + | ||
| 6 | +## [1.110.99] 2026-08-11 | ||
| 7 | +修复ipmcset -t maintenance -d importcsr帮助信息不完整问题 | ||
| 8 | + | ||
| 3 | ## [1.110.99] 2026-08-07 | 9 | ## [1.110.99] 2026-08-07 |
| 4 | 修复电源通信状态异常时返回值不为null的问题 | 10 | 修复电源通信状态异常时返回值不为null的问题 |
| 5 | 11 | ||
| @@ -1,4 +1,5 @@ | |||
| 1 | {% | 1 | {% |
| 2 | + local cjson = require('cjson') | ||
| 2 | local get_real_work_mode = { | 3 | local get_real_work_mode = { |
| 3 | [0] = 'DC', | 4 | [0] = 'DC', |
| 4 | [1] = 'AC', | 5 | [1] = 'AC', |
| @@ -12,9 +13,10 @@ | |||
| 12 | one_power.Model,one_power.SerialNumber, one_power.FirmwareVersion, one_power.Rate, get_real_work_mode[one_power.PowerSupplyType]) | 13 | one_power.Model,one_power.SerialNumber, one_power.FirmwareVersion, one_power.Rate, get_real_work_mode[one_power.PowerSupplyType]) |
| 13 | echo(line) | 14 | echo(line) |
| 14 | end | 15 | end |
| 15 | - | 16 | + if ActiveStandbySupported ~= cjson.null then |
| 16 | - echo(string.format('\n%-23s :\n', 'Current PSU WorkMode')) | 17 | + echo(string.format('\n%-23s :\n', 'Current PSU WorkMode')) |
| 17 | - echo(string.format('%-23s :\n', 'Actual PSU Status')) | 18 | + echo(string.format('%-23s :\n', 'Actual PSU Status')) |
| 19 | + end | ||
| 18 | -- 支持主备 | 20 | -- 支持主备 |
| 19 | if ActiveStandbySupported == true then | 21 | if ActiveStandbySupported == true then |
| 20 | if PowerActualWorkingMode == 'Active/Standby' then | 22 | if PowerActualWorkingMode == 'Active/Standby' then |
| @@ -29,7 +31,9 @@ | |||
| 29 | echo(string.format('%-23s : Load Balancing\n', ' Work Mode')) | 31 | echo(string.format('%-23s : Load Balancing\n', ' Work Mode')) |
| 30 | end | 32 | end |
| 31 | end | 33 | end |
| 32 | - echo(string.format('%-23s :\n', 'Predicted PSU Status')) | 34 | + if PowerWorkingMode ~= cjson.null then |
| 35 | + echo(string.format('%-23s :\n', 'Predicted PSU Status')) | ||
| 36 | + end | ||
| 33 | -- 期待的电源工作模式 | 37 | -- 期待的电源工作模式 |
| 34 | if PowerWorkingMode == 'Active/Standby' then | 38 | if PowerWorkingMode == 'Active/Standby' then |
| 35 | echo(string.format('%-23s : Active/Standby\n', ' Work Mode')) | 39 | echo(string.format('%-23s : Active/Standby\n', ' Work Mode')) |
| @@ -906,17 +906,17 @@ | |||
| 906 | "Usage": "ipmcget -d psuinfo", | 906 | "Usage": "ipmcget -d psuinfo", |
| 907 | "Brief": "", | 907 | "Brief": "", |
| 908 | "RspBody": { | 908 | "RspBody": { |
| 909 | - "ActiveStandbySupported": "${ProcessingFlow[1]/Destination/ActiveStandbySupported}", | 909 | + "ActiveStandbySupported": null, |
| 910 | "GetPowerList": "${Statements/GetPowerList()}", | 910 | "GetPowerList": "${Statements/GetPowerList()}", |
| 911 | - "PowerWorkingMode": "${ProcessingFlow[1]/Destination/PowerWorkingMode}", | 911 | + "PowerWorkingMode": null, |
| 912 | - "PowerActualWorkingMode": "${ProcessingFlow[1]/Destination/PowerActualWorkingMode}", | 912 | + "PowerActualWorkingMode": null, |
| 913 | - "ExpectedActivePSU": "${ProcessingFlow[1]/Destination/ExpectedActivePSU}", | 913 | + "ExpectedActivePSU": null, |
| 914 | - "DeepSleepSupported": "${ProcessingFlow[1]/Destination/DeepSleepSupported}", | 914 | + "DeepSleepSupported": null, |
| 915 | - "DeepSleep": "${ProcessingFlow[1]/Destination/DeepSleep}" | 915 | + "DeepSleep": null |
| 916 | }, | 916 | }, |
| 917 | "Statements": { | 917 | "Statements": { |
| 918 | "GetPowerList": { | 918 | "GetPowerList": { |
| 919 | - "Input": "${ProcessingFlow[2]/Destination/PowerList}", | 919 | + "Input": "${ProcessingFlow[1]/Destination/PowerList}", |
| 920 | "Steps": [ | 920 | "Steps": [ |
| 921 | { | 921 | { |
| 922 | "Type": "Expand" | 922 | "Type": "Expand" |
| @@ -925,19 +925,6 @@ | |||
| 925 | } | 925 | } |
| 926 | }, | 926 | }, |
| 927 | "ProcessingFlow": [ | 927 | "ProcessingFlow": [ |
| 928 | - { | ||
| 929 | - "Type": "Property", | ||
| 930 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 931 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 932 | - "Destination": { | ||
| 933 | - "ActiveStandbySupported": "ActiveStandbySupported", | ||
| 934 | - "PowerWorkingMode": "PowerWorkingMode", | ||
| 935 | - "PowerActualWorkingMode": "PowerActualWorkingMode", | ||
| 936 | - "ExpectedActivePSU": "ExpectedActivePSU", | ||
| 937 | - "DeepSleepSupported": "DeepSleepSupported", | ||
| 938 | - "DeepSleep": "DeepSleep" | ||
| 939 | - } | ||
| 940 | - }, | ||
| 941 | { | 928 | { |
| 942 | "Type": "List", | 929 | "Type": "List", |
| 943 | "Path": "/bmc/kepler/Systems/1/PowerMgmt", | 930 | "Path": "/bmc/kepler/Systems/1/PowerMgmt", |
| @@ -757,7 +757,8 @@ | |||
| 757 | "Properties": { | 757 | "Properties": { |
| 758 | "option": { | 758 | "option": { |
| 759 | "Required": true, | 759 | "Required": true, |
| 760 | - "Type": "string" | 760 | + "Type": "string", |
| 761 | + "Description": " Connector name of the firmware to be imported, e.g.: Connector_BCU_1_0101" | ||
| 761 | }, | 762 | }, |
| 762 | "filepath": { | 763 | "filepath": { |
| 763 | "Required": true, | 764 | "Required": true, |
| @@ -768,7 +769,7 @@ | |||
| 768 | "Formula": "^/tmp/.{1,246}\\.hpm$" | 769 | "Formula": "^/tmp/.{1,246}\\.hpm$" |
| 769 | } | 770 | } |
| 770 | ], | 771 | ], |
| 771 | - "Description": " e.g.: /tmp/image.hpm" | 772 | + "Description": " e.g.: /tmp/image.hpm\r\nNote:\r\n 1.The values for option can be queried using ipmcget -t maintenance -d listcsr.\r\n 2.The file path must not exceed 255 bytes, and the file must be in .hpm format.\r\n 3.The BMC will automatically restart after the import operation is successfully completed." |
| 772 | } | 773 | } |
| 773 | } | 774 | } |
| 774 | }, | 775 | }, |
| @@ -669,159 +669,7 @@ | |||
| 669 | } | 669 | } |
| 670 | ] | 670 | ] |
| 671 | }, | 671 | }, |
| 672 | - { | 672 | + |
| 673 | - "Uri": "/cli/v1/_/psuworkmode", | ||
| 674 | - "Interfaces": [ | ||
| 675 | - { | ||
| 676 | - "Type": "Patch", | ||
| 677 | - "Usage": "ipmcset -d psuworkmode -v <option> [active psuid|enabled/disabled]", | ||
| 678 | - "Description": "Set PSU work mode", | ||
| 679 | - "ReqBody": { | ||
| 680 | - "Type": "object", | ||
| 681 | - "Required": true, | ||
| 682 | - "Properties": { | ||
| 683 | - "value1": { | ||
| 684 | - "Required": false | ||
| 685 | - }, | ||
| 686 | - "value2": { | ||
| 687 | - "Required": false | ||
| 688 | - }, | ||
| 689 | - "value3": { | ||
| 690 | - "Required": false | ||
| 691 | - } | ||
| 692 | - } | ||
| 693 | - }, | ||
| 694 | - "RspBody": { | ||
| 695 | - "value1": "${ReqBody/value1}", | ||
| 696 | - "value2": "${ReqBody/value2}", | ||
| 697 | - "value3": "${ReqBody/value3}", | ||
| 698 | - "GetAllValueParamsValid": "${Statements/GetAllValueParamsValid()}", | ||
| 699 | - "DeepSleepSupported": "${ProcessingFlow[1]/Destination/DeepSleepSupported}", | ||
| 700 | - "NormalAndRedundancy": "${ProcessingFlow[1]/Destination/NormalAndRedundancy}", | ||
| 701 | - "OnePowerList": "${ProcessingFlow[2]/Destination/OnePowerList}" | ||
| 702 | - }, | ||
| 703 | - "Statements": { | ||
| 704 | - "GetAllValueParamsValid": { | ||
| 705 | - "Steps": [ | ||
| 706 | - { | ||
| 707 | - "Type": "Script", | ||
| 708 | - "Formula": "check_psuworkmode_params_valid.lua" | ||
| 709 | - } | ||
| 710 | - ] | ||
| 711 | - }, | ||
| 712 | - "GetDeepSleepStatus": { | ||
| 713 | - "Input": "${ReqBody/value2}", | ||
| 714 | - "Steps": [ | ||
| 715 | - { | ||
| 716 | - "Type": "Switch", | ||
| 717 | - "Formula": [ | ||
| 718 | - { | ||
| 719 | - "Case": "enabled", | ||
| 720 | - "To": "Enabled" | ||
| 721 | - }, | ||
| 722 | - { | ||
| 723 | - "Case": "disabled", | ||
| 724 | - "To": "Disabled" | ||
| 725 | - } | ||
| 726 | - ] | ||
| 727 | - } | ||
| 728 | - ] | ||
| 729 | - } | ||
| 730 | - }, | ||
| 731 | - "ProcessingFlow": [ | ||
| 732 | - { | ||
| 733 | - "Type": "Property", | ||
| 734 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 735 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 736 | - "Destination": { | ||
| 737 | - "DeepSleepSupported": "DeepSleepSupported", | ||
| 738 | - "NormalAndRedundancy": "NormalAndRedundancy" | ||
| 739 | - } | ||
| 740 | - }, | ||
| 741 | - { | ||
| 742 | - "Type": "List", | ||
| 743 | - "Path": "/bmc/kepler/Systems/1/PowerMgmt", | ||
| 744 | - "Destination": { | ||
| 745 | - "Members": "OnePowerList" | ||
| 746 | - } | ||
| 747 | - }, | ||
| 748 | - { | ||
| 749 | - "Type": "Method", | ||
| 750 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 751 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 752 | - "Name": "SetPowerWorkingMode", | ||
| 753 | - "Params": [ | ||
| 754 | - "LoadBalancing", | ||
| 755 | - {} | ||
| 756 | - ], | ||
| 757 | - "CallIf": { | ||
| 758 | - "${Statements/GetAllValueParamsValid()}": true, | ||
| 759 | - "${ReqBody/value1}": "0", | ||
| 760 | - "${ReqBody/value2}": "#WITHOUT", | ||
| 761 | - "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 762 | - } | ||
| 763 | - }, | ||
| 764 | - { | ||
| 765 | - "Type": "Method", | ||
| 766 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 767 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 768 | - "Name": "SetPowerWorkingMode", | ||
| 769 | - "Params": [ | ||
| 770 | - "Active/Standby", | ||
| 771 | - [ | ||
| 772 | - "${ReqBody/value2}" | ||
| 773 | - ] | ||
| 774 | - ], | ||
| 775 | - "CallIf": { | ||
| 776 | - "${Statements/GetAllValueParamsValid()}": true, | ||
| 777 | - "${ReqBody/value1}": "1", | ||
| 778 | - "${ReqBody/value2}": "#WITH", | ||
| 779 | - "${ReqBody/value3}": "#WITHOUT", | ||
| 780 | - "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 781 | - } | ||
| 782 | - }, | ||
| 783 | - { | ||
| 784 | - "Type": "Method", | ||
| 785 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 786 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 787 | - "Name": "SetPowerWorkingMode", | ||
| 788 | - "Params": [ | ||
| 789 | - "Active/Standby", | ||
| 790 | - [ | ||
| 791 | - "${ReqBody/value2}", | ||
| 792 | - "${ReqBody/value3}" | ||
| 793 | - ] | ||
| 794 | - ], | ||
| 795 | - "CallIf": { | ||
| 796 | - "${Statements/GetAllValueParamsValid()}": true, | ||
| 797 | - "${ReqBody/value1}": "1", | ||
| 798 | - "${ReqBody/value2}": "#WITH", | ||
| 799 | - "${ReqBody/value3}": "#WITH", | ||
| 800 | - "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 801 | - } | ||
| 802 | - }, | ||
| 803 | - { | ||
| 804 | - "Type": "Property", | ||
| 805 | - "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 806 | - "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 807 | - "Source": { | ||
| 808 | - "DeepSleep": "${Statements/GetDeepSleepStatus()}" | ||
| 809 | - }, | ||
| 810 | - "CallIf": { | ||
| 811 | - "${Statements/GetAllValueParamsValid()}": true, | ||
| 812 | - "${ReqBody/value1}": "2", | ||
| 813 | - "${ReqBody/value2}": "#WITH", | ||
| 814 | - "${ReqBody/value3}": "#WITHOUT" | ||
| 815 | - } | ||
| 816 | - } | ||
| 817 | - ], | ||
| 818 | - "Echoes": [ | ||
| 819 | - "ipmcset/_psuworkmode", | ||
| 820 | - "" | ||
| 821 | - ] | ||
| 822 | - } | ||
| 823 | - ] | ||
| 824 | - }, | ||
| 825 | { | 673 | { |
| 826 | "Uri": "/cli/v1/_/deluser", | 674 | "Uri": "/cli/v1/_/deluser", |
| 827 | "Interfaces": [ | 675 | "Interfaces": [ |
| @@ -134,6 +134,30 @@ | |||
| 134 | } | 134 | } |
| 135 | ] | 135 | ] |
| 136 | }, | 136 | }, |
| 137 | + "NPUScaleUpGroupId": { | ||
| 138 | + "Type": "integer", | ||
| 139 | + "Validator": [ | ||
| 140 | + { | ||
| 141 | + "Type": "Range", | ||
| 142 | + "Formula": [ | ||
| 143 | + 0, | ||
| 144 | + 65535 | ||
| 145 | + ] | ||
| 146 | + } | ||
| 147 | + ] | ||
| 148 | + }, | ||
| 149 | + "NPUScaleOutGroupId": { | ||
| 150 | + "Type": "integer", | ||
| 151 | + "Validator": [ | ||
| 152 | + { | ||
| 153 | + "Type": "Range", | ||
| 154 | + "Formula": [ | ||
| 155 | + 0, | ||
| 156 | + 65535 | ||
| 157 | + ] | ||
| 158 | + } | ||
| 159 | + ] | ||
| 160 | + }, | ||
| 137 | "TopologyType": { | 161 | "TopologyType": { |
| 138 | "Type": "integer" | 162 | "Type": "integer" |
| 139 | }, | 163 | }, |
| @@ -417,6 +441,30 @@ | |||
| 417 | "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/SuperPodSize}": "#WITH" | 441 | "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/SuperPodSize}": "#WITH" |
| 418 | } | 442 | } |
| 419 | }, | 443 | }, |
| 444 | + { | ||
| 445 | + "Type": "Method", | ||
| 446 | + "Path": "/bmc/kepler/Chassis/${Uri/chassisid}/SuperPodLabel", | ||
| 447 | + "Interface": "bmc.kepler.Chassis.SuperPodLabel", | ||
| 448 | + "Name": "SetNPUScaleUpGroupId", | ||
| 449 | + "Params": [ | ||
| 450 | + "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/NPUScaleUpGroupId}" | ||
| 451 | + ], | ||
| 452 | + "CallIf": { | ||
| 453 | + "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/NPUScaleUpGroupId}": "#WITH" | ||
| 454 | + } | ||
| 455 | + }, | ||
| 456 | + { | ||
| 457 | + "Type": "Method", | ||
| 458 | + "Path": "/bmc/kepler/Chassis/${Uri/chassisid}/SuperPodLabel", | ||
| 459 | + "Interface": "bmc.kepler.Chassis.SuperPodLabel", | ||
| 460 | + "Name": "SetNPUScaleOutGroupId", | ||
| 461 | + "Params": [ | ||
| 462 | + "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/NPUScaleOutGroupId}" | ||
| 463 | + ], | ||
| 464 | + "CallIf": { | ||
| 465 | + "${ReqBody/Oem/{{OemIdentifier}}/SuperPodLabel/NPUScaleOutGroupId}": "#WITH" | ||
| 466 | + } | ||
| 467 | + }, | ||
| 420 | { | 468 | { |
| 421 | "Type": "Property", | 469 | "Type": "Property", |
| 422 | "Path": "/bmc/kepler/Chassis/${Uri/chassisid}/Storage", | 470 | "Path": "/bmc/kepler/Chassis/${Uri/chassisid}/Storage", |
| @@ -550,6 +598,8 @@ | |||
| 550 | "SuperPodId": "${ProcessingFlow[20]/Destination/SuperPodId}", | 598 | "SuperPodId": "${ProcessingFlow[20]/Destination/SuperPodId}", |
| 551 | "ServerIndex": "${ProcessingFlow[20]/Destination/ServerIndex}", | 599 | "ServerIndex": "${ProcessingFlow[20]/Destination/ServerIndex}", |
| 552 | "SuperPodSize": "${ProcessingFlow[20]/Destination/SuperPodSize}", | 600 | "SuperPodSize": "${ProcessingFlow[20]/Destination/SuperPodSize}", |
| 601 | + "NPUScaleUpGroupId": "${ProcessingFlow[20]/Destination/NPUScaleUpGroupId}", | ||
| 602 | + "NPUScaleOutGroupId": "${ProcessingFlow[20]/Destination/NPUScaleOutGroupId}", | ||
| 553 | "TopologyType": "${ProcessingFlow[20]/Destination/TopologyType}", | 603 | "TopologyType": "${ProcessingFlow[20]/Destination/TopologyType}", |
| 554 | "UBMDeployMode": "${Statements/GetUBMDeployMode()}", | 604 | "UBMDeployMode": "${Statements/GetUBMDeployMode()}", |
| 555 | "IsUBFabricMode": "${ProcessingFlow[20]/Destination/IsUBFabricMode}", | 605 | "IsUBFabricMode": "${ProcessingFlow[20]/Destination/IsUBFabricMode}", |
| @@ -1202,6 +1252,8 @@ | |||
| 1202 | "SuperPodId": "SuperPodId", | 1252 | "SuperPodId": "SuperPodId", |
| 1203 | "ServerIndex": "ServerIndex", | 1253 | "ServerIndex": "ServerIndex", |
| 1204 | "SuperPodSize": "SuperPodSize", | 1254 | "SuperPodSize": "SuperPodSize", |
| 1255 | + "NPUScaleUpGroupId": "NPUScaleUpGroupId", | ||
| 1256 | + "NPUScaleOutGroupId": "NPUScaleOutGroupId", | ||
| 1205 | "TopologyType": "TopologyType", | 1257 | "TopologyType": "TopologyType", |
| 1206 | "ChassisId": "ChassisId", | 1258 | "ChassisId": "ChassisId", |
| 1207 | "UBMDeployMode": "UBMDeployMode", | 1259 | "UBMDeployMode": "UBMDeployMode", |
| @@ -364,13 +364,21 @@ local function get_fan_reading(sensor_name, fan_obj) | |||
| 364 | if fan_obj.FrontPresence == 0 then | 364 | if fan_obj.FrontPresence == 0 then |
| 365 | return cjson.null | 365 | return cjson.null |
| 366 | else | 366 | else |
| 367 | - return fan_obj.FrontSpeed | 367 | + if not fan_obj.FrontSpeed or not fan_obj.Coefficient then |
| 368 | + return cjson.null | ||
| 369 | + else | ||
| 370 | + return fan_obj.FrontSpeed * fan_obj.Coefficient | ||
| 371 | + end | ||
| 368 | end | 372 | end |
| 369 | else | 373 | else |
| 370 | if fan_obj.RearPresence == 0 then | 374 | if fan_obj.RearPresence == 0 then |
| 371 | return cjson.null | 375 | return cjson.null |
| 372 | else | 376 | else |
| 373 | - return fan_obj.RearSpeed | 377 | + if not fan_obj.RearSpeed or not fan_obj.Coefficient then |
| 378 | + return cjson.null | ||
| 379 | + else | ||
| 380 | + return fan_obj.RearSpeed * fan_obj.Coefficient | ||
| 381 | + end | ||
| 374 | end | 382 | end |
| 375 | end | 383 | end |
| 376 | end | 384 | end |
| @@ -118,7 +118,7 @@ end | |||
| 118 | local NET_DEV_FUNC_TYPE_FC <const> = 2 | 118 | local NET_DEV_FUNC_TYPE_FC <const> = 2 |
| 119 | local fc_id = cjson.null | 119 | local fc_id = cjson.null |
| 120 | local speed_bps = cjson.null | 120 | local speed_bps = cjson.null |
| 121 | -if ProcessingFlow[5].NetDevFuncCapabilities == NET_DEV_FUNC_TYPE_FC then | 121 | +if ProcessingFlow[5].Destination.NetDevFuncCapabilities == NET_DEV_FUNC_TYPE_FC then |
| 122 | fc_id = ProcessingFlow[6].Destination.FCId | 122 | fc_id = ProcessingFlow[6].Destination.FCId |
| 123 | speed_bps = ProcessingFlow[6].Destination.SpeedGbps | 123 | speed_bps = ProcessingFlow[6].Destination.SpeedGbps |
| 124 | end | 124 | end |
| @@ -26,6 +26,13 @@ local function get_fan_presence(presence) | |||
| 26 | return presence + 1 | 26 | return presence + 1 |
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | +local function get_fan_speed(speed, coefficient) | ||
| 30 | + if not speed or not coefficient then | ||
| 31 | + return nil | ||
| 32 | + end | ||
| 33 | + return speed * coefficient | ||
| 34 | +end | ||
| 35 | + | ||
| 29 | -- 获取风扇状态 | 36 | -- 获取风扇状态 |
| 30 | local function get_fan_status(presence, status) | 37 | local function get_fan_status(presence, status) |
| 31 | if presence ~= 1 then | 38 | if presence ~= 1 then |
| @@ -48,7 +55,7 @@ for _, value in pairs(fans) do | |||
| 48 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio | 55 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio |
| 49 | fan_list[#fan_list + 1] = { | 56 | fan_list[#fan_list + 1] = { |
| 50 | fanIndex = index, | 57 | fanIndex = index, |
| 51 | - fanSpeed = value.FrontSpeed, | 58 | + fanSpeed = get_fan_speed(value.FrontSpeed, value.Coefficient), |
| 52 | fanPresence = get_fan_presence(value.FrontPresence), | 59 | fanPresence = get_fan_presence(value.FrontPresence), |
| 53 | fanStatus = get_fan_status(value.FrontPresence, value.FrontStatus), | 60 | fanStatus = get_fan_status(value.FrontPresence, value.FrontStatus), |
| 54 | fanLocation = value.Position, | 61 | fanLocation = value.Position, |
| @@ -61,7 +68,7 @@ for _, value in pairs(fans) do | |||
| 61 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio | 68 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio |
| 62 | fan_list[#fan_list + 1] = { | 69 | fan_list[#fan_list + 1] = { |
| 63 | fanIndex = index, | 70 | fanIndex = index, |
| 64 | - fanSpeed = value.RearSpeed, | 71 | + fanSpeed = get_fan_speed(value.RearSpeed, value.Coefficient), |
| 65 | fanPresence = get_fan_presence(value.RearPresence), | 72 | fanPresence = get_fan_presence(value.RearPresence), |
| 66 | fanStatus = get_fan_status(value.RearPresence, value.RearStatus), | 73 | fanStatus = get_fan_status(value.RearPresence, value.RearStatus), |
| 67 | fanLocation = value.Position, | 74 | fanLocation = value.Position, |
| @@ -74,7 +81,7 @@ for _, value in pairs(fans) do | |||
| 74 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio | 81 | speed_ratio = speed_ratio > FAN_SPEED_RATIO_MAX and FAN_SPEED_RATIO_MAX or speed_ratio |
| 75 | fan_list[#fan_list + 1] = { | 82 | fan_list[#fan_list + 1] = { |
| 76 | fanIndex = index, | 83 | fanIndex = index, |
| 77 | - fanSpeed = value.RearSpeed, | 84 | + fanSpeed = get_fan_speed(value.RearSpeed, value.Coefficient), |
| 78 | fanPresence = get_fan_presence(value.RearPresence), | 85 | fanPresence = get_fan_presence(value.RearPresence), |
| 79 | fanStatus = get_fan_status(value.RearPresence, value.RearStatus), | 86 | fanStatus = get_fan_status(value.RearPresence, value.RearStatus), |
| 80 | fanLocation = value.Position, | 87 | fanLocation = value.Position, |
| @@ -119,6 +119,13 @@ function m.get_speed(front_speed, rear_speed) | |||
| 119 | return 0 | 119 | return 0 |
| 120 | end | 120 | end |
| 121 | 121 | ||
| 122 | +function m.get_fan_speed(speed, coefficient) | ||
| 123 | + if not speed or not coefficient then | ||
| 124 | + return nil | ||
| 125 | + end | ||
| 126 | + return speed * coefficient | ||
| 127 | +end | ||
| 128 | + | ||
| 122 | function m.get_speed_ratio(obj_info) | 129 | function m.get_speed_ratio(obj_info) |
| 123 | local front_rpm = obj_info.FrontSpeed | 130 | local front_rpm = obj_info.FrontSpeed |
| 124 | local rear_rpm = obj_info.RearSpeed | 131 | local rear_rpm = obj_info.RearSpeed |
| @@ -168,7 +175,7 @@ function m.get_sort_fans_info(input) | |||
| 168 | -- 先添加前转子对象 | 175 | -- 先添加前转子对象 |
| 169 | fan_obj.Name = 'Fan' .. temp_obj.FanId .. ' Front' | 176 | fan_obj.Name = 'Fan' .. temp_obj.FanId .. ' Front' |
| 170 | fan_obj.Model = temp_obj.Model | 177 | fan_obj.Model = temp_obj.Model |
| 171 | - fan_obj.Speed = temp_obj.FrontSpeed * temp_obj.Coefficient | 178 | + fan_obj.Speed = m.get_fan_speed(temp_obj.FrontSpeed, temp_obj.Coefficient) |
| 172 | fan_obj.SpeedRatio = m.get_single_speed_ratio(temp_obj.FrontSpeed, temp_obj.FrontMaxSpeed) | 179 | fan_obj.SpeedRatio = m.get_single_speed_ratio(temp_obj.FrontSpeed, temp_obj.FrontMaxSpeed) |
| 173 | fan_obj.PartNumber = temp_obj.PartNumber | 180 | fan_obj.PartNumber = temp_obj.PartNumber |
| 174 | fan_obj.Presence = temp_obj.FrontPresence | 181 | fan_obj.Presence = temp_obj.FrontPresence |
| @@ -182,7 +189,7 @@ function m.get_sort_fans_info(input) | |||
| 182 | fan_obj = {} | 189 | fan_obj = {} |
| 183 | fan_obj.Name = 'Fan' .. temp_obj.FanId .. ' Rear' | 190 | fan_obj.Name = 'Fan' .. temp_obj.FanId .. ' Rear' |
| 184 | fan_obj.Model = temp_obj.Model | 191 | fan_obj.Model = temp_obj.Model |
| 185 | - fan_obj.Speed = temp_obj.RearSpeed * temp_obj.Coefficient | 192 | + fan_obj.Speed = m.get_fan_speed(temp_obj.RearSpeed, temp_obj.Coefficient) |
| 186 | fan_obj.SpeedRatio = m.get_single_speed_ratio(temp_obj.RearSpeed, temp_obj.RearMaxSpeed) | 193 | fan_obj.SpeedRatio = m.get_single_speed_ratio(temp_obj.RearSpeed, temp_obj.RearMaxSpeed) |
| 187 | fan_obj.PartNumber = temp_obj.PartNumber | 194 | fan_obj.PartNumber = temp_obj.PartNumber |
| 188 | fan_obj.Presence = temp_obj.RearPresence | 195 | fan_obj.Presence = temp_obj.RearPresence |
| @@ -197,7 +204,7 @@ function m.get_sort_fans_info(input) | |||
| 197 | else | 204 | else |
| 198 | fan_obj.Name = 'Fan' .. temp_obj.FanId | 205 | fan_obj.Name = 'Fan' .. temp_obj.FanId |
| 199 | fan_obj.Model = temp_obj.Model | 206 | fan_obj.Model = temp_obj.Model |
| 200 | - fan_obj.Speed = m.get_speed(temp_obj.FrontSpeed, temp_obj.RearSpeed) | 207 | + fan_obj.Speed = m.get_fan_speed(m.get_speed(temp_obj.FrontSpeed, temp_obj.RearSpeed), temp_obj.Coefficient) |
| 201 | fan_obj.SpeedRatio = m.get_speed_ratio(temp_obj) | 208 | fan_obj.SpeedRatio = m.get_speed_ratio(temp_obj) |
| 202 | fan_obj.PartNumber = temp_obj.PartNumber | 209 | fan_obj.PartNumber = temp_obj.PartNumber |
| 203 | fan_obj.Presence = temp_obj.RearPresence | 210 | fan_obj.Presence = temp_obj.RearPresence |
| @@ -9,6 +9,10 @@ | |||
| 9 | -- See the Mulan PSL v2 for more details. | 9 | -- See the Mulan PSL v2 for more details. |
| 10 | 10 | ||
| 11 | -- 校验当前网卡是否具备PortConfig接口 | 11 | -- 校验当前网卡是否具备PortConfig接口 |
| 12 | +if not ReqBody or type(ReqBody.PreloadPortCount) ~= 'number' then | ||
| 13 | + return | ||
| 14 | +end | ||
| 15 | + | ||
| 12 | if ProcessingFlow[3].Destination == nil or ProcessingFlow[3].Destination.Path == '' then | 16 | if ProcessingFlow[3].Destination == nil or ProcessingFlow[3].Destination.Path == '' then |
| 13 | error(custom_messages.PropertyModificationNotSupported('PreloadPortCount')) | 17 | error(custom_messages.PropertyModificationNotSupported('PreloadPortCount')) |
| 14 | end | 18 | end |
| @@ -1,7 +1,7 @@ | |||
| 1 | { | 1 | { |
| 2 | "name": "rackmount", | 2 | "name": "rackmount", |
| 3 | "type": "configuration", | 3 | "type": "configuration", |
| 4 | - "version": "1.110.99", | 4 | + "version": "1.110.100", |
| 5 | "author": "Huawei", | 5 | "author": "Huawei", |
| 6 | "license": "Mulan PSL v2", | 6 | "license": "Mulan PSL v2", |
| 7 | "options": { | 7 | "options": { |
| @@ -0,0 +1,51 @@ | |||
| 1 | +{ | ||
| 2 | + "Uri.Actions" : { | ||
| 3 | + "Remove": [], | ||
| 4 | + "Copy": [ | ||
| 5 | + { | ||
| 6 | + "Source": "ipmcset/psuworkmode.json", | ||
| 7 | + "Target": "ipmcset/psuworkmode.json" | ||
| 8 | + } | ||
| 9 | + ] | ||
| 10 | + }, | ||
| 11 | + "Property.Actions" : [ | ||
| 12 | + { | ||
| 13 | + "Target": "ipmcget/target.json", | ||
| 14 | + "Uri": "/cli/v1/_/psuinfo", | ||
| 15 | + "Method": "Get", | ||
| 16 | + "Remove": [ | ||
| 17 | + "RspBody/ActiveStandbySupported", | ||
| 18 | + "RspBody/PowerWorkingMode", | ||
| 19 | + "RspBody/PowerActualWorkingMode", | ||
| 20 | + "RspBody/ExpectedActivePSU", | ||
| 21 | + "RspBody/DeepSleepSupported", | ||
| 22 | + "RspBody/DeepSleep" | ||
| 23 | + ], | ||
| 24 | + "Modify": { | ||
| 25 | + "RspBody": { | ||
| 26 | + "ActiveStandbySupported": "${ProcessingFlow[1]/Destination/ActiveStandbySupported}", | ||
| 27 | + "PowerWorkingMode": "${ProcessingFlow[1]/Destination/PowerWorkingMode}", | ||
| 28 | + "PowerActualWorkingMode": "${ProcessingFlow[1]/Destination/PowerActualWorkingMode}", | ||
| 29 | + "ExpectedActivePSU": "${ProcessingFlow[1]/Destination/ExpectedActivePSU}", | ||
| 30 | + "DeepSleepSupported": "${ProcessingFlow[1]/Destination/DeepSleepSupported}", | ||
| 31 | + "DeepSleep": "${ProcessingFlow[1]/Destination/DeepSleep}" | ||
| 32 | + }, | ||
| 33 | + "ProcessingFlow": [ | ||
| 34 | + { | ||
| 35 | + "Type": "Property", | ||
| 36 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 37 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 38 | + "Destination": { | ||
| 39 | + "ActiveStandbySupported": "ActiveStandbySupported", | ||
| 40 | + "PowerWorkingMode": "PowerWorkingMode", | ||
| 41 | + "PowerActualWorkingMode": "PowerActualWorkingMode", | ||
| 42 | + "ExpectedActivePSU": "ExpectedActivePSU", | ||
| 43 | + "DeepSleepSupported": "DeepSleepSupported", | ||
| 44 | + "DeepSleep": "DeepSleep" | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + ] | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + ] | ||
| 51 | +} | ||
| @@ -0,0 +1,157 @@ | |||
| 1 | +{ | ||
| 2 | + "Resources": [ | ||
| 3 | + { | ||
| 4 | + "Uri": "/cli/v1/_/psuworkmode", | ||
| 5 | + "Interfaces": [ | ||
| 6 | + { | ||
| 7 | + "Type": "Patch", | ||
| 8 | + "Usage": "ipmcset -d psuworkmode -v <option> [active psuid|enabled/disabled]", | ||
| 9 | + "Description": "Set PSU work mode", | ||
| 10 | + "ReqBody": { | ||
| 11 | + "Type": "object", | ||
| 12 | + "Required": true, | ||
| 13 | + "Properties": { | ||
| 14 | + "value1": { | ||
| 15 | + "Required": false | ||
| 16 | + }, | ||
| 17 | + "value2": { | ||
| 18 | + "Required": false | ||
| 19 | + }, | ||
| 20 | + "value3": { | ||
| 21 | + "Required": false | ||
| 22 | + } | ||
| 23 | + } | ||
| 24 | + }, | ||
| 25 | + "RspBody": { | ||
| 26 | + "value1": "${ReqBody/value1}", | ||
| 27 | + "value2": "${ReqBody/value2}", | ||
| 28 | + "value3": "${ReqBody/value3}", | ||
| 29 | + "GetAllValueParamsValid": "${Statements/GetAllValueParamsValid()}", | ||
| 30 | + "DeepSleepSupported": "${ProcessingFlow[1]/Destination/DeepSleepSupported}", | ||
| 31 | + "NormalAndRedundancy": "${ProcessingFlow[1]/Destination/NormalAndRedundancy}", | ||
| 32 | + "OnePowerList": "${ProcessingFlow[2]/Destination/OnePowerList}" | ||
| 33 | + }, | ||
| 34 | + "Statements": { | ||
| 35 | + "GetAllValueParamsValid": { | ||
| 36 | + "Steps": [ | ||
| 37 | + { | ||
| 38 | + "Type": "Script", | ||
| 39 | + "Formula": "check_psuworkmode_params_valid.lua" | ||
| 40 | + } | ||
| 41 | + ] | ||
| 42 | + }, | ||
| 43 | + "GetDeepSleepStatus": { | ||
| 44 | + "Input": "${ReqBody/value2}", | ||
| 45 | + "Steps": [ | ||
| 46 | + { | ||
| 47 | + "Type": "Switch", | ||
| 48 | + "Formula": [ | ||
| 49 | + { | ||
| 50 | + "Case": "enabled", | ||
| 51 | + "To": "Enabled" | ||
| 52 | + }, | ||
| 53 | + { | ||
| 54 | + "Case": "disabled", | ||
| 55 | + "To": "Disabled" | ||
| 56 | + } | ||
| 57 | + ] | ||
| 58 | + } | ||
| 59 | + ] | ||
| 60 | + } | ||
| 61 | + }, | ||
| 62 | + "ProcessingFlow": [ | ||
| 63 | + { | ||
| 64 | + "Type": "Property", | ||
| 65 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 66 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 67 | + "Destination": { | ||
| 68 | + "DeepSleepSupported": "DeepSleepSupported", | ||
| 69 | + "NormalAndRedundancy": "NormalAndRedundancy" | ||
| 70 | + } | ||
| 71 | + }, | ||
| 72 | + { | ||
| 73 | + "Type": "List", | ||
| 74 | + "Path": "/bmc/kepler/Systems/1/PowerMgmt", | ||
| 75 | + "Destination": { | ||
| 76 | + "Members": "OnePowerList" | ||
| 77 | + } | ||
| 78 | + }, | ||
| 79 | + { | ||
| 80 | + "Type": "Method", | ||
| 81 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 82 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 83 | + "Name": "SetPowerWorkingMode", | ||
| 84 | + "Params": [ | ||
| 85 | + "LoadBalancing", | ||
| 86 | + {} | ||
| 87 | + ], | ||
| 88 | + "CallIf": { | ||
| 89 | + "${Statements/GetAllValueParamsValid()}": true, | ||
| 90 | + "${ReqBody/value1}": "0", | ||
| 91 | + "${ReqBody/value2}": "#WITHOUT", | ||
| 92 | + "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 93 | + } | ||
| 94 | + }, | ||
| 95 | + { | ||
| 96 | + "Type": "Method", | ||
| 97 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 98 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 99 | + "Name": "SetPowerWorkingMode", | ||
| 100 | + "Params": [ | ||
| 101 | + "Active/Standby", | ||
| 102 | + [ | ||
| 103 | + "${ReqBody/value2}" | ||
| 104 | + ] | ||
| 105 | + ], | ||
| 106 | + "CallIf": { | ||
| 107 | + "${Statements/GetAllValueParamsValid()}": true, | ||
| 108 | + "${ReqBody/value1}": "1", | ||
| 109 | + "${ReqBody/value2}": "#WITH", | ||
| 110 | + "${ReqBody/value3}": "#WITHOUT", | ||
| 111 | + "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 112 | + } | ||
| 113 | + }, | ||
| 114 | + { | ||
| 115 | + "Type": "Method", | ||
| 116 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 117 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 118 | + "Name": "SetPowerWorkingMode", | ||
| 119 | + "Params": [ | ||
| 120 | + "Active/Standby", | ||
| 121 | + [ | ||
| 122 | + "${ReqBody/value2}", | ||
| 123 | + "${ReqBody/value3}" | ||
| 124 | + ] | ||
| 125 | + ], | ||
| 126 | + "CallIf": { | ||
| 127 | + "${Statements/GetAllValueParamsValid()}": true, | ||
| 128 | + "${ReqBody/value1}": "1", | ||
| 129 | + "${ReqBody/value2}": "#WITH", | ||
| 130 | + "${ReqBody/value3}": "#WITH", | ||
| 131 | + "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled" | ||
| 132 | + } | ||
| 133 | + }, | ||
| 134 | + { | ||
| 135 | + "Type": "Property", | ||
| 136 | + "Path": "/bmc/kepler/Systems/1/PowerStrategy", | ||
| 137 | + "Interface": "bmc.kepler.Systems.PowerStrategy", | ||
| 138 | + "Source": { | ||
| 139 | + "DeepSleep": "${Statements/GetDeepSleepStatus()}" | ||
| 140 | + }, | ||
| 141 | + "CallIf": { | ||
| 142 | + "${Statements/GetAllValueParamsValid()}": true, | ||
| 143 | + "${ReqBody/value1}": "2", | ||
| 144 | + "${ReqBody/value2}": "#WITH", | ||
| 145 | + "${ReqBody/value3}": "#WITHOUT" | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + ], | ||
| 149 | + "Echoes": [ | ||
| 150 | + "ipmcset/_psuworkmode", | ||
| 151 | + "" | ||
| 152 | + ] | ||
| 153 | + } | ||
| 154 | + ] | ||
| 155 | + } | ||
| 156 | + ] | ||
| 157 | +} | ||
🟡 Medium Priority
本 diff 在 Chassis.json 中给 SuperPodLabel 对象新增了
NPUScaleUpGroupId与NPUScaleOutGroupId两个 OEM 属性(PATCH 请求体、GET 响应体、D-Bus 属性映射三处同时加入),但对应的 OEM 元数据/模式文件未同步更新:建议:同步修改 CSDL 元数据与 JSON Schema:在 openubmcchassis_v1.xml 的 SuperPodLabel ComplexType 和 openubmcchassis.v1_0_0.json 的 definitions/SuperPodLabel 中补充 NPUScaleUpGroupId、NPUScaleOutGroupId 两个整数属性(范围 0–65535、ReadWrite/readonly=false),与映射配置保持一致,避免 additionalProperties=false 下响应字段被判定为非法。