Root partition on SDDC is full or almost full.
auth.log and/or message log are not rotating and filling up the root partition.
VMware Cloud Foundation 5.x
Important: If the root partition is full or the /var/log/messages log is over 1GB you should manually clear the messages log and auth.log prior to running these steps.
echo > /var/log/messages
echo > /var/log/audit/audit.log
echo > /var/log/auth.log
echo > /var/log/nginx/error.log
echo > /var/log/nginx/access.log
If the above does not clear out the space you can delete all the compressed log files as well:
rm /var/log/audit/audit.*.gz
rm /var/log/messages.*.gz
rm /var/log/auth.*.gz
rm /var/log/nginx/error.*.gz
rm /var/log/nginx/access.*.gz
To prevent the issue from happening again:
vcf user, login to root with the command su rootcd /etc/logrotate.d
Note: - While copying the file to /etc/logrotate.d the following error may be present: "Permission denied".
To fix this issue, use any of the methods mentioned below:
Method #1 Send the syslog file mention in the KB to the /vcf/home/ directory. Then, move the file to /etc/logrotate/.
mv syslog /etc/logrotate.d/
Method #2 Copy the content of the of syslog file and by using the vi editor, paste the content into the current syslog file. If there isn't a syslog file in the directory, create a new file using the vi editor (vi syslog).
5. Update the permissions on the file.
chown root:root syslog
chmod 644 syslog
6. Initiate the log rotation.
logrotate -f /etc/logrotate.conf
While running the command logrotate -f /etc/logrotate.conf if error came as: -
error: destination /var/log/audit/audit.log-20241203.gz already exists, skipping rotationerror: destination /var/log/nginx/access.log-20241203.gz already exists, skipping rotationerror: destination /var/log/nginx/error.log-20241203.gz already exists, skipping rotation
To resolve the issue manually removed the files from the directory then again try running logrotate -f /etc/logrotate.conf