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

CLI support for SmartSwitch PMON

Open rameshraghupathy opened this issue 10 months ago • 12 comments

What I did

Enhanced the following CLIs to support SmartSwitch PMON as described in the PMON HLD documentation "https://github.com/sonic-net/SONiC/blob/d19d8933a43d0a31a4f3b2310f4336f289bca340/doc/smart-switch/pmon/smartswitch-pmon.md"

CLIs: Added new module "DPUX" support for 1 and 2 below 1. "config chassis module startup DPUX" , where X could be 0, to the maximum number of DPUs-1 in the SmartSwitch chassis 2. "config chassis module shutdown DPUX"

Extended the following CLIs to support the new module "DPUX" and also proved a "all" option to display the "SWITCH" and all "DPUX" modules 1. "show reboot-cause" will remain the same and added "show reboot-cause all" 2. "show reboot-cause history" will remain the same and added "show reboot-cause history ", where module name could be DPUX, SWITCH and all.

Extended the following CLIs to support the new module "DPUX" and also proved a "all" option to display the "SWITCH" and all "DPUX" modules 1. "show system-health summary" will remain the same and added sub-command "show system-health summary ", where module name could be DPUX, SWITCH and all. 2. "show system-health monitor-list" will remain the same and added sub-command "show system-health monitor-list ", where module name could be DPUX, SWITCH and all. 3. "show system-health summary" will remain the same and added sub-command "show system-health summary ", where module name could be DPUX, SWITCH and all.etail" will remain the same and added sub-command "show system-health detail ", where module name could be DPUX, SWITCH and all. 4. Added a new sub command "show system-health dpu ", where module name could be DPUX, and all. This new subcommand will provide additional DPU state details as mentioned in the HLD

How I did it

  1. Kept the original CLI output unaltered
  2. Added sub command to support SmartSwitch "DPUs"
  3. Added additional code in chassisd, and in platform modules.py, chassis.py to support it
  4. Updated the DB tables as mentioned in the PMON HLD

How to verify it

  1. Build an image with the required files (refer to the other upstream PRs and the platform PRs) Require files: - This PR including reboot_cause.py, chassis_modules.py, system_health.py) - The other PR including module_base.py, chassis_base.py, docker-pmon.supervisord.conf.j2, chassisd, mock_module_base.py, and the appropriate database_config.json - Platform "platform-cisco-8000" supporting PMON (module.py, chassis.py, inventory.py, pmon_daemon_control.json, and the required grpc and DB changes)
  2. Run the CLIs and see the new output

Previous command output (if the output of a command-line utility has changed)

root@sonic:~# show reboot-cause Unknown

root@sonic:~# show reboot-cause history Name Cause Time User Comment


2023_06_19_11_00_24 Power Loss N/A N/A Unknown (First boot of SONiC version 202311.10869-dirty-2024044)

New command output (if the output of a command-line utility has changed)

root@sonic:~# show reboot-cause history all Device Name Cause Time User Comment


SWITCH 2023_06_19_11_00_24 Power Loss N/A N/A Unknown (First boot of SONiC version 202311.10869-dirty-2024044)

root@sonic:~# show reboot-cause history SWITCH Device Name Cause Time User Comment


SWITCH 2023_06_19_11_00_24 Power Loss N/A N/A Unknown (First boot of SONiC version 202311.10869-dirty-2024044)

root@sonic:~# show reboot-cause history DPU0 Device Name Cause Time User Comment


rameshraghupathy avatar Apr 14 '24 23:04 rameshraghupathy

Can you please add UT for the new functions?

oleksandrivantsiv avatar Apr 26 '24 01:04 oleksandrivantsiv

Can you please add UT for the new functions?

Done

rameshraghupathy avatar Jul 09 '24 21:07 rameshraghupathy