Skip to content

Update management interface related configuration in MGMT_PORT_TABLE STATE_DB#21813

Merged
rlhui merged 1 commit intosonic-net:masterfrom
SuvarnaMeenakshi:mgmt_state_db
Feb 28, 2025
Merged

Update management interface related configuration in MGMT_PORT_TABLE STATE_DB#21813
rlhui merged 1 commit intosonic-net:masterfrom
SuvarnaMeenakshi:mgmt_state_db

Conversation

@SuvarnaMeenakshi
Copy link
Contributor

…in STATE_DB

Why I did it

Currently Management interface related data is present in CONFIG_DB and 'oper_status' is present in STATE_DB MGMT_PORT_TABLE.
This PR change is made to ensure that all telemetry data related to management interface is present in STATE_DB.

Work item tracking
  • Microsoft ADO 27597775:

How I did it

Update mgmt_oper_status monit script to update all fields from CONFIG_DB MGMT_PORT table.

How to verify it

Unit test added for the change and passed:

/sonic/files/image_config/monit$ pytest-3 tests/test_mgmt_oper_status.py 
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.11.2, pytest-7.2.1, pluggy-1.0.0+repack
rootdir: /sonic/files/image_config/monit
plugins: pyfakefs-5.6.0, cov-4.0.0
collected 4 items                                                                                                                                                                                                 

tests/test_mgmt_oper_status.py ....                                                                                                                                                                         [100%]

================================================================================================ 4 passed in 0.09s ================================================================================================

Before Change:

sonic-db-cli STATE_DB hgetall "MGMT_PORT_TABLE|eth0"
{'oper_status': 'up'}

After change:

sonic-db-cli STATE_DB hgetall "MGMT_PORT_TABLE|eth0"
{'oper_status': 'up', 'admin_status': 'up', 'alias': 'eth0'}
sonic-db-cli CONFIG_DB hgetall "MGMT_PORT|eth0"
{'admin_status': 'up', 'alias': 'eth0'}

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)

Description for the changelog

Link to config_db schema for YANG module changes

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

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rlhui
Copy link
Contributor

rlhui commented Feb 27, 2025

@SuvarnaMeenakshi , can we have a test gap for this?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202405: Azure/sonic-buildimage-msft#728

miatttao pushed a commit to miatttao/sonic-buildimage that referenced this pull request Mar 5, 2025
…in STATE_DB (sonic-net#21813)

Currently Management interface related data is present in CONFIG_DB and 'oper_status' is present in STATE_DB MGMT_PORT_TABLE.
This PR change is made to ensure that all telemetry data related to management interface is present in STATE_DB.

Signed-off-by: Suvarna Meenakshi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants