sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
25 stars 159 forks source link

thermalctld: Add support for fans on non-CPU modules #555

Open patrickmacarthur opened 3 weeks ago

patrickmacarthur commented 3 weeks ago

Description

This adds support to the show platform fans command to show fans that are on modules.

Motivation and Context

In the current Arista chassis model, the chassis fans are returned by Module.get_all_fans() as opposed to FanDrawer.get_all_fans(), which currently thermalctld makes no provision for. This change allows fans that are under the modules to be listed in the command output.

How Has This Been Tested?

This has been tested internally on a chassis, and the fan output now includes all fans on the chassis as opposed to just PSU fans:

admin@cmp206:~$ show platform fan
  Drawer    LED     FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  ------  -------  -----------  ----------  --------  -----------------
     N/A    off  fan0/1      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan0/2      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/3      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/4      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/5      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/6      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/7      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    red  fan0/8      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/1      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/2      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/3      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/4      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/5      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/6      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/7      29%      exhaust     Present        OK  20241030 15:54:08
     N/A    off  fan1/8      29%      exhaust     Present        OK  20241030 15:54:08
....
     N/A    off  psu2/1      49%       intake     Present        OK  20241030 15:54:08
     N/A    off  psu4/1      44%       intake     Present        OK  20241030 15:54:08
     N/A    off  psu6/1      44%       intake     Present        OK  20241030 15:54:08
     N/A    off  psu8/1      46%       intake     Present        OK  20241030 15:54:09

Additional Information (Optional)

Platform library support change https://github.com/sonic-net/sonic-buildimage/pull/20603 should be merged before this change.

abdosi commented 3 weeks ago

@bmridul and @mlok-nokia can you help check this . does this need sonic change or we should push this into platform implementation.

gechiang commented 1 week ago

Just want to higlight that this change has a dependency of this PR mentioned by Author in the PR description: Platform library support change https://github.com/sonic-net/sonic-buildimage/pull/20603 should be merged before this change.