Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for the procedures for insertion/hot swap of Switch Fabric Module(SFM) by using "config chassis modules shutdown/startup" commands #6

Merged
merged 10 commits into from
May 9, 2024

Conversation

JunhongMao
Copy link
Contributor

@JunhongMao JunhongMao commented Apr 5, 2024

Why I did it

For the Nokia SONiC chassis procedures for insertion/hot swap of Switch Fabric Module(SFM),
the previous solution was using the below commands.

sudo nokia_cmd set shutdown-sfm <SFM-Num/Physical-Slot>

The below 4 PRs intend to add the below commands for the equivalent operations.
sonic-net/sonic-platform-daemons#491
sonic-net/sonic-utilities#3283
#6
sonic-net/sonic-buildimage#18938

sudo config chassis modules shutdown/startup <module name>

The HLD for Shutdown and Startup of the Fabric Module is below:
sonic-net/SONiC#1694

The below PR was replaced.
sonic-net/sonic-buildimage#18578

Work item tracking
  • Microsoft ADO (number only):

How I did it

  1. When the cli command "sudo config chassis modules startup/shutdown" runs, it directly calls config/fabric_module_set_admin_status.py to do the related operations.

How to verify it

The below test was carried out on FABRIC-CARD3 module on the supervisor card.
1. Shutdown
sudo config chassis modules shutdown FABRIC-CARD3

2. Check the status to see if the FABRIC-CARD3 was down.
$ show chassis modules status
        Name             Description    Physical-Slot    Oper-Status    Admin-Status       Serial
------------  ----------------------  ---------------  -------------  --------------  -----------
...
FABRIC-CARD3             Unavailable                4          Empty            down          N/A

sudo tail -f /var/log/syslog | grep "pmon#chassisd:"
May  1 00:07:54.192037 ixre-cpm-chassis15 WARNING pmon#chassisd: Module FABRIC-CARD3 went off-line!
 ...

 
3. Start up the module
sudo config chassis modules startup FABRIC-CARD3


4. Check the status
$ show chassis modules status
        Name             Description    Physical-Slot    Oper-Status    Admin-Status       Serial
------------  ----------------------  ---------------  -------------  --------------  -----------
...
FABRIC-CARD3                    SFM4                4         Online              up  01214400362

sudo tail -f /var/log/syslog | grep "pmon#chassisd:"
May  1 00:26:29.501687 ixre-cpm-chassis15 NOTICE pmon#chassisd: Module FABRIC-CARD3 recovered on-line!


5. To test if the operation is still valid when the system reboot. For example, first shut down, 
then after saving config and reboot, the module should keep shutdown status. 
$ sudo config save
Existing files will be overwritten, continue? [y/N]: y

Then check the status to see if the FABRIC-CARD3 was down.
$ show chassis modules status
        Name             Description    Physical-Slot    Oper-Status    Admin-Status       Serial
------------  ----------------------  ---------------  -------------  --------------  -----------
...
FABRIC-CARD3             Unavailable                4          Empty            down          N/A


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)

  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

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

…ule (SFM)

1. Add chassis_module_config.py and its service.
2. When the cli command "sudo config chassis modules startup/shutdown" runs,
   calls chassis_module_set_admin_state.py to do the ralated operations.
@JunhongMao
Copy link
Contributor Author

These two PRs
sonic-net/sonic-buildimage#18578
#6

have been replaced by the below new two PRS:

sonic-net/sonic-utilities#3283
sonic-net/sonic-platform-daemons#475

chassis/sonic_platform/module.py Outdated Show resolved Hide resolved
chassis/sonic_platform/module.py Outdated Show resolved Hide resolved
chassis/utils/chassis_module_set_admin_state.py Outdated Show resolved Hide resolved
chassis/utils/chassis_module_set_admin_state.py Outdated Show resolved Hide resolved
chassis/sonic_platform/module.py Outdated Show resolved Hide resolved
chassis/sonic_platform/module.py Outdated Show resolved Hide resolved
@mlok-nokia mlok-nokia merged commit 20f82d0 into nokia:main May 9, 2024
mlok-nokia pushed a commit that referenced this pull request May 9, 2024
…ule(SFM) by using "config chassis modules shutdown/startup" commands (#6)

* Update for the Procedures for insertion/hot swap of Switch Fabric Module (SFM)
1. Add chassis_module_config.py and its service.
2. When the cli command "sudo config chassis modules startup/shutdown" runs,
   calls chassis_module_set_admin_state.py to do the ralated operations.

* Fix some issues based on the review comments.

* Fix a issue of syslog setting to enable the logger.log_info output.

* Update for the procedures for insertion/hot swap of Switch Fabric Module(SFM) by using "config chassis modules shutdown/startup" commands

* Revert "Fix a issue of syslog setting to enable the logger.log_info output."

This reverts commit 8b30671.

* Revert "Fix some issues based on the review comments."

This reverts commit 4088912.

* Revert "Update for the Procedures for insertion/hot swap of Switch Fabric Module (SFM)"

This reverts commit f5ce311.

* Update for the procedures for insertion/hot swap of Switch Fabric Module(SFM) by using "config chassis modules shutdown/startup" commands

* Remove some log lines based on review comments.

* Remove some log lines based on review comments.

(cherry picked from commit 20f82d0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants