Event details:
Description : Log disk usage exceeds limit ######## on controller #####.controller.local from #########. After 2 times of cleanup, the disk size is #######
disk_cleanup_event_details:
controller: ######.controller.local
size_limit: ########
curr_size: ########
cleanup_count: 2
from_time: #############
Avi Load Balancer Version: 30.2.x
Steps to Verify:
Login to Controller SSH (Bash) using admin credentials:
Run "sudo -i" command and enter the admin password as depicted below.
admin@########:~$ sudo -i
[sudo] password for admin:
root@########:~#
Execute the below command. It displays top top 30 folders with disk usage.
Command: sudo du 2> >(grep -v '^du: cannot \(access\|read\)' >&2) -h / | sort -rh | head -n 30
Note:
root@###########:~# sudo du 2> >(grep -v '^du: cannot \(access\|read\)' >&2) -h / | sort -rh | head -n 30
7.0G /var/lib/avi/logs
4.7G /var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx
2.5G /var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx/se-xxxxxxxxxxx
2.2G /var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx/se-xxxxxxxxxxx
5.2G /var/lib/avi/log/ALL-EVENTS/se-########
From the output there are 4 folders consuming more disk space under directory "/var/lib/avi/logs"
Steps to Cleanup:
Navigate to each shortlisted folder from the above steps and check for files older than 30 days by executing below command.
Step-1: Verify the total number of files located within the folder.
Command: ls -ltrh | wc -l
root@#########:/var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx# ls -ltrh | wc -l
Step-2: Check for the files older than 30 days in the same folder
This Command lists all the files older than 30 days
Command: find . -type f -mtime +30 -exec ls -ltrh {} +
root@#########:/var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx# find . -type f -mtime +30 -exec ls -ltrh {} +
This Command will provide count on files older than 30 days
Command: find . -type f -mtime +30 -exec ls -ltrh {} + | wc -l
root@#########:/var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx# find . -type f -mtime +30 -exec ls -ltrh {} + | wc -l
Step-3: If the difference is more between Number of files in Step-1 and Step-2 then run the command to remove files older than 30 days.
If the difference between Number of files in Step-1 and Step-2 is less (Ex: between 10 or 100 files) then try to change the value to higher than 30 days.
Command: find . -type f -mtime +30 -exec rm -f {} +
root@#########:/var/lib/avi/logs/virtualservice-xxxxx-xxxxx-xxxx-xxxx-xxxxxxxx# find . -type f -mtime +30 -exec rm -f {} +
Note: If customer wants to keep data less than or more than 30 days data change the value accordingly.
Conclusion:
We are enhancing log retention and cleanup efficiency in an upcoming Log Manager release 2.0 to better handle these scenarios.
Please reach out to support team before removing these files.