sonic-buildimage icon indicating copy to clipboard operation
sonic-buildimage copied to clipboard

[Mellanox]PSU sensors dynamic configuration

Open yuazhe opened this issue 1 year ago • 3 comments

Why I did it

Previously, the PSU sensor configuration inside sensors.conf is hardcoded for each platform, allowing no flexibility for other PSU combination possibilities. However, there exists a scenario that user has a second source of PSU which has different sensors compared to the original sensors.conf. Thereby it requires the system to have the ability to dynamically detect the PSU model in using and load relevant sensor’s configuration file.

Note: Run-time detect PSU changing and reload relevant sensor configurations is out of scope.

How I did it

This PR involves a new script and a corresponding data file which contains all PSU model’s sensor configuration info. The script reads the hardware PSU information through hw-management and determines its model. Based on that, it searches for the corresponding pre-defined PSU sensor data, integrate them into the sensors.conf, and let PMON copy it for further loading by lm-sensor.

How to verify it

use sensors command and check the psu section is rightly labeled.

Which release branch to backport (provide reason below if selected)

  • [ ] 201811
  • [ ] 201911
  • [ ] 202006
  • [ ] 202012
  • [ ] 202106
  • [ ] 202111
  • [ ] 202205
  • [ ] 202211
  • [ ] 202305

Tested branch (Please provide the tested image version)

  • [x] 202311
  • [ ]

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

yuazhe avatar Apr 02 '24 07:04 yuazhe

/azpw run Azure.sonic-buildimage

yuazhe avatar Apr 15 '24 01:04 yuazhe

/AzurePipelines run Azure.sonic-buildimage

mssonicbld avatar Apr 15 '24 01:04 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Apr 15 '24 01:04 azure-pipelines[bot]

/AzurePipelines run Azure.sonic-buildimage

yuazhe avatar May 15 '24 03:05 yuazhe

Commenter does not have sufficient privileges for PR 18528 in repo sonic-net/sonic-buildimage

azure-pipelines[bot] avatar May 15 '24 03:05 azure-pipelines[bot]

/azpw run Azure.sonic-buildimage

yuazhe avatar May 15 '24 04:05 yuazhe

/AzurePipelines run Azure.sonic-buildimage

mssonicbld avatar May 15 '24 04:05 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 15 '24 04:05 azure-pipelines[bot]

LGTM but you are missing recent new device SN5400. Please add the relevant changes to this device as well

I have updated relevant changes according to SN5400 sensor configuration file.

yuazhe avatar May 17 '24 01:05 yuazhe

/azpw ms_conflict

yuazhe avatar May 22 '24 03:05 yuazhe

/azpw ms_conflict -f

liushilongbuaa avatar May 27 '24 05:05 liushilongbuaa

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-buildimage/pull/19291

mssonicbld avatar Jun 12 '24 22:06 mssonicbld

Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-buildimage/pull/19801

mssonicbld avatar Aug 02 '24 23:08 mssonicbld