MiniKB: Cleaning /var/log/journal on vCenter Server Appliance

DISCLAIMER: all the information in this article is based on my home lab environment and is not advised to be used in production without thorough impact analysis.

Occasionally, you can get alarms in vCenter Server UI about low disk space on some disks. Normally, you would start with accessing VAMI to check which disk is over 78%. In my case it was /var/log and I found plenty of KB articles about potential cause, but none of them was relevant to my issue. After some digging, I found out that

  1. Login through SSH to your vCSA using root account and enable shell
  2. Check the size of /var/log subfolders with this command: du -sh /var/log/* | sort -h
  3. Check the size of journal log files: journalctl –disk-usage
  4. If the size of /var/log/journal is significant, you can purge it with command: journalctl –vacuum-time=10d (or alternatively use vacuum-size=500M switch.

This will delete all the logs older than 10 days.

You can also permanently cap the journal log file with this command:

echo SystemMaxUse=500M | sudo tee -a /etc/systemd/journald.conf

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s