[action] [PR:20323] Adding fix to clear logs before reboot for disk out of space issue#20517
Merged
mssonicbld merged 1 commit intosonic-net:202505from Sep 4, 2025
Merged
Conversation
…onic-net#20323) What is the motivation for this PR? To proactively prevent disk space issues by cleaning up unnecessary log files in /host/logs_before_reboot during the disk space freeing step. This is especially useful before upgrades, where disk space can be a concern. How did you do it? Added the following line to the disk cleanup routine (typically found in the free_up_disk_space function): exec_command(module, "rm -rf /host/logs_before_reboot/*", ignore_error=True) This line is placed with other similar cleanup commands for logs, cores, dumps, etc. How did you verify/test it? Tested the updated cleanup routine in a testbed and verified that files in /host/logs_before_reboot are deleted as expected. Confirmed that the upgrade process proceeds with sufficient disk space and no residual log files. Any platform specific information? No platform-specific changes. This cleanup is safe for all platforms supported by SONiC testbed. Supported testbed topology if it's a new test case? Not a new test case. This is a framework/testbed maintenance improvement. Documentation No specific documentation updates are required for this change, as it is a maintenance step within the existing disk cleanup routine.
11 tasks
Collaborator
Author
|
Original PR: #20323 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
…lly (sonic-net#20517) #### Why I did it src/sonic-gnmi ``` * 7fdd5b5 - (HEAD -> 202311, origin/202311) Update all the dbus timeout (sonic-net#301) (sonic-net#307) (26 hours ago) [mssonicbld] * dc79bce - Fix pipeline for 202305 branch (sonic-net#303) (2 days ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of PR
Summary:
This PR adds a cleanup step to remove old log files from the
/host/logs_before_rebootdirectory as part of the disk space freeing routine. This helps ensure sufficient disk space before performing upgrade operations and keeps the testbed environment tidy.Fixes # (No specific issue number; general maintenance and disk space management improvement)
Type of change
Back port request
Approach
What is the motivation for this PR?
To proactively prevent disk space issues by cleaning up unnecessary log files in
/host/logs_before_rebootduring the disk space freeing step. This is especially useful before upgrades, where disk space can be a concern.How did you do it?
Added the following line to the disk cleanup routine (typically found in the
free_up_disk_spacefunction):This line is placed with other similar cleanup commands for logs, cores, dumps, etc.
How did you verify/test it?
Tested the updated cleanup routine in a testbed and verified that files in
/host/logs_before_rebootare deleted as expected. Confirmed that the upgrade process proceeds with sufficient disk space and no residual log files.Any platform specific information?
No platform-specific changes. This cleanup is safe for all platforms supported by SONiC testbed.
Supported testbed topology if it's a new test case?
Not a new test case. This is a framework/testbed maintenance improvement.
Documentation
No specific documentation updates are required for this change, as it is a maintenance step within the existing disk cleanup routine.