Adds FSIO R/W sync script for stormond implementation #18927
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
This is part of a larger feature implementation: Storage Monitoring Daemon. It adds a script to sync the FSIO reads and writes from the STATE_DB to the disk, which is called by the various reboot scripts during planned reboot.
Work item tracking
How I did it
Added the sync script to image_config folder
Made changes in sonic_debian_extension.j2 that copies the above file to the appropriate location in the image.
Made changes that instruct the build_template to copy 'fsio-rw-sync' into the appropriate location in the pmon container, so that the script can be called by the daemon from within pmon.
How to verify it
Flash image with these changes onto a DUT
Write sample values of the appropriate fields to STATE_DB
Erase the contents of the fsio-rw-stats.json file and replace with empty JSON
Reboot the device with this sister sonic-utilities change: Modified reboot scripts to sync FSIO reads/writes to disk before OS-level reboot sonic-utilities#3171
On reboot, verify that the values from Step 2 are in the JSON file.
if the sonic-utilities PR is not yet merged, you can verify the presence of the sync script in /usr/local/bin and call it manually, after which you can verify that the empty JSON file has been populated with the contents of the STATE_DB values we previously posted to the database.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Added logic to sync stormond STATE_DB values to disk in planned reboot scenarios
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)