| 433c9193 | 29-Oct-2025 |
Janet Adkins <janeta@us.ibm.com> |
Sensors: Convert fan_tach sensors to Percent
Redfish 2025.3 clarified the reporting of fan sensors should always be as ReadingType Percent to address issue #6197. [1] The fan_tach sensors on D-Bus a
Sensors: Convert fan_tach sensors to Percent
Redfish 2025.3 clarified the reporting of fan sensors should always be as ReadingType Percent to address issue #6197. [1] The fan_tach sensors on D-Bus are Rotational sensors. Conversion is necessary for these sensor values to reflect Percent instead. [2] This is reflected in a published mockup. [3]
The Redfish update includes an additional sentence for the ReadingType description:
``` "... Services should represent fan speed and pump speed sensors with the `ReadingType` value `Percent`." ```
The ReadingRangeMax and ReadingRangeMin properties also must be converted to percent basis as they are defined to reflect the range of the Reading property.
``` curl -s https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json | jq .definitions.Sensor.properties.ReadingRangeMax.longDescription "This property shall indicate the maximum possible value of the `Reading` property for this sensor. This value is the range of valid readings for this sensor. Values outside this range are discarded as reading errors." ```
A new compile option, redfish-allow-rotational-fans, will maintain the old behavior of reporting fan_tach sensors as Rotational. When the option is disabled they will be reported as Percent. This will allow time for distributions to make adjustments to handle Percent reported fan sensors.
The SpeedRPM Redfish property contains the RPM value for these sensors whether this option is enabled or disabled. Clients wanting to use the RPM value should convert to use the SpeedRPM property instead of the Reading property.
``` curl -s https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json | jq .definitions.Sensor.properties.SpeedRPM { "description": "The rotational speed.", "excerpt": "SensorFan,SensorFanArray,SensorPump", "longDescription": "This property shall contain a reading of the rotational speed of the device in revolutions per minute (RPM) units.", "readonly": true, "type": [ "number", "null" ], "units": "{rev}/min", "versionAdded": "v1_2_0" } ```
With the compile option disabled the following differences will be reflected in the responses for /redfish/v1/Chassis/chassis/Sensors/{}: - ReadingRangeMax/ReadingRangeMin: Converted to percent range, (100,0) - ReadingType: "Percent" - ReadingUnits: "%" - Reading: Computed percent value. The computation is the percent of the RPM Value within the MaxValue to MinValue range as reported by D-Bus for the sensor. - Note: If the percent cannot be computed for any reason the Reading property is set to null. - Note: SpeedRPM: Remains unchanged, it continues to report the RPM value as reported by D-Bus.
Implementation Notes: - The SensorFanExcerpt and SensorFanArrayExcerpt definitions also include the SpeedRPM property. So moved setting of this property to be handled for excerpts as well. - The Sensor schema version has been updated regardless of the compile option setting.
[1] https://github.com/DMTF/Redfish/issues/6197 [2] https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json [3] https://github.com/DMTF/Redfish-Publications/blob/main/mockups/public-rackmount1/Chassis/1U/Sensors/CPUFan1/index.json
Tested: - Added new unit tests for new function getFanPercent() - Adjusted existing unit tests for Sensors to reflect changes for fan_tach sensors. - Redfish Service Validator passes (with option enabled and disabled) - Using hardware simulator hand-edited values for the min/max of the fan_tach sensors: - Option enabled: confirmed Redfish response same before and after code changes. - Option disabled: Confirmed Redfish responses and percent calculation.
Example responses with compile option disabled: ``` // D-Bus: "Value" d 18000 "MaxValue" d 18000 "MinValue" d 0 curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan0_0", "Name": "fan0 0", "Reading": 100, "ReadingRangeMax": 100, "ReadingRangeMin": 0, "ReadingType": "Percent", "ReadingUnits": "%", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } }
// D-Bus: "Value" d 18000 "MaxValue" d 36000 "MinValue" d 0 curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan1_0", "Name": "fan1 0", "Reading": 50, "ReadingRangeMax": 100, "ReadingRangeMin": 0, "ReadingType": "Percent", "ReadingUnits": "%", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } }
// Minimum is non-zero // D-Bus: "Value" d 18000 "MaxValue" d 27000 "MinValue" d 9000 curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan2_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan2_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan2_0", "Name": "fan2 0", "Reading": 50, "ReadingRangeMax": 100, "ReadingRangeMin": 0, "ReadingType": "Percent", "ReadingUnits": "%", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } }
// Minimum is not initialized - Reading is null // D-Bus: "Value" d 18000 "MaxValue" d 18000 "MinValue" d -inf curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan3_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan3_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan3_0", "Name": "fan3 0", "Reading": null, "ReadingRangeMax": 100, "ReadingRangeMin": 0, "ReadingType": "Percent", "ReadingUnits": "%", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } }
// Minimum and Maximum are not initialized - so Reading is null // D-Bus: "Value" d 18000 "MaxValue" d inf "MinValue" d -inf curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan4_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan4_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan4_0", "Name": "fan4 0", "Reading": null, "ReadingRangeMax": 100, "ReadingRangeMin": 0, "ReadingType": "Percent", "ReadingUnits": "%", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } } ```
Example of unchanged response with compile option enabled: ``` curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "fantach_fan0_0", "Name": "fan0 0", "Reading": 18000.0, "ReadingRangeMax": 18000.0, "ReadingRangeMin": 0.0, "ReadingType": "Rotational", "ReadingUnits": "RPM", "SpeedRPM": 18000.0, "Status": { "Health": "OK", "State": "Enabled" } } ```
Change-Id: I8ec1e739bcd5ebce7453a2570569f2edc2284341 Signed-off-by: Janet Adkins <janeta@us.ibm.com>
show more ...
|
| 1aa94df4 | 31-Jul-2025 |
Harshit Aghera <haghera@nvidia.com> |
sensor_utils: Add PeakReading property
Add support for PeakReading and PeakReadingTime for sensors. This enhancement allows sensor readings to include max observed value information in the Redfish A
sensor_utils: Add PeakReading property
Add support for PeakReading and PeakReadingTime for sensors. This enhancement allows sensor readings to include max observed value information in the Redfish API, along with timestamp. It uses PDI xyz.openbmc_project.Telemetry.Report. Property PeakReading is added if OperationType in PDI property ReadingParameters is set to Maximum.
Current Limitation - The ResetMetrics action is currently not supported for sensor URIs. As a result, the ability to clear PeakReading values for GPU Power Sensors has not been implemented.
Future Consideration - If ResetMetrics action support is added in the future, the corresponding functionality will also need to be implemented in the dbus-sensor application to ensure full compatibility.
Schema: https://redfish.dmtf.org/schemas/v1/Sensor.v1_2_0.yaml (PeakReading)
Backend implementation for reference: https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/82479
Tested: Build an image for nvl32-obmc machine with the following patches cherry picked.
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490 https://gerrit.openbmc.org/c/openbmc/bmcweb/+/82449.
The patch cherry-picks the following patches that are currently under review.
``` 1. device tree https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/ 2. mctpd patches https://github.com/CodeConstruct/mctp/pull/85 3. u-boot changes https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t 4. kernel changes as specified in the openbmc patch (for espi) 5. entity-manager changes https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455 6. platform-init changes https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456 7. spi changes https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/ ```
``` > curl -s -k -u 'root:0penBmc' https://10.137.203.137/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0 { "@odata.id": "/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0", "@odata.type": "#Sensor.v1_2_0.Sensor", "Id": "power_NVIDIA_GB200_GPU_0_Power_0", "Name": "NVIDIA GB200 GPU 0 Power 0", "PeakReading": 52.671, "PeakReadingTime": 0, "Reading": 27.214, "ReadingRangeMax": 5000.0, "ReadingRangeMin": 0.0, "ReadingType": "Power", "ReadingUnits": "W", "Status": { "Health": "OK", "State": "Enabled" } }% ````
Change-Id: I8c1ab6ce85f31419db4a1d931bf99722d24afbd7 Signed-off-by: Harshit Aghera <haghera@nvidia.com>
show more ...
|