Skip to content

[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
mssonicbld:cherry/202505/20323
Sep 4, 2025
Merged

[action] [PR:20323] Adding fix to clear logs before reboot for disk out of space issue#20517
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/20323

Conversation

@mssonicbld
Copy link
Collaborator

Description of PR

Summary:
This PR adds a cleanup step to remove old log files from the /host/logs_before_reboot directory 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

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

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.

…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.
@mssonicbld
Copy link
Collaborator Author

Original PR: #20323

@mssonicbld
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 683c7e6 into sonic-net:202505 Sep 4, 2025
17 checks passed
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
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.

2 participants