Skip to content

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

Merged
judyjoseph merged 2 commits intosonic-net:masterfrom
JunhongMao:master
May 29, 2024
Merged

Update for the procedures for insertion/hot swap of Switch Fabric Module (SFM) by using "config chassis modules shutdown/startup" commands#491
judyjoseph merged 2 commits intosonic-net:masterfrom
JunhongMao:master

Conversation

@JunhongMao
Copy link
Copy Markdown
Contributor

@JunhongMao JunhongMao commented May 29, 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.
#491
sonic-net/sonic-utilities#3283
nokia/sonic-platform#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) by using "config chassis modules shutdown/startup" commands
@JunhongMao
Copy link
Copy Markdown
Contributor Author

This PR is to replace the PR:
#475

Because we should raise the PR first in master -- get it merged and later cherry-pick to 202205
The modifications of the two PRs are same. The previous review comments can be found at #475.

@JunhongMao
Copy link
Copy Markdown
Contributor Author

@mlok-nokia , @judyjoseph , please review and approve it. Thanks.

@judyjoseph
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

sonic-chassisd/scripts/chassisd
   python.lang.security.audit.subprocess-shell-true.subprocess-shell-true
	  Found 'subprocess' function 'Popen' with 'shell=True'. This is dangerous because this call will
	  spawn the command using a shell process. Doing so propagates current shell settings and variables,
	  which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead.
	  Details: https://sg.run/J92w
@judyjoseph judyjoseph merged commit 28302d4 into sonic-net:master May 29, 2024
lotus-nexthop pushed a commit to lotus-nexthop/sonic-platform-daemons that referenced this pull request Oct 28, 2025
- Description
Currently, is_flat_memory could return 3 different values:

True when the module is flat memory
False when the module is not flat memory
None when the EEPROM read returns None or empty bytearray
When it returns None, we should not assume that the module is NOT a flat memory. Instead, it would be safer to treat it as a flat memory.

- Motivation and Context
This PR is to make is_flat_memory only returns two state, True or False. And if EEPROM reading returns None or empty bytearray, we should treat the module as a flat memory.

- How Has This Been Tested?
Manual test
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.

2 participants