Log rotate fails for /var/log/vmware on NSX-T Manager and Edge Nodes
search cancel

Log rotate fails for /var/log/vmware on NSX-T Manager and Edge Nodes

book

Article ID: 322441

calendar_today

Updated On:

Products

VMware NSX Networking

Issue/Introduction

Symptoms:
  • You are running NSX-T 3.1.
  • You may see the partition '/var/log/vmware'  grow in size.
  • The following files may grow quite large:
    • integrity_checker.log
    • top-mem.log
    • top-cpu.log
  • You may fail to collect the support bundle.
  • If you run the command: 
    • /usr/sbin/logrotate -d /etc/logrotate.conf 2>&1 | less
    • The following errors are displayed
...
error: appliance-config:3 bad size '12.8'
...
error: appliance-config:17 bad size '51.2'

Note: The command '/usr/sbin/logrotate -d /etc/logrotate.conf 2>&1 | less'  is a debug command and will only read the configuration file to check its correctness.

Cause

This issue is caused due to a extra decimal point in the configuration file.
This converts the number to a float, which the code does not accept.

Resolution

In VMware NSX-T 3.1.1 the issue with top-mem.log and top-cpu.log is resolved.
However the issue with integrity_checker.log is resolved in VMware NSX-T 3.1.2 and VMware NSX-T 3.2.

Workaround:
Log in as root on the impacted NSX-T Manager or Edge node.
Change directory to:
/etc/logrotate.d

Then copy the original file as a backup: 
cp appliance-config /tmp/appliance-config.bak

To edit and replace with correct values, run the following command:
sed -i 's/12.8M/13M/g' appliance-config
sed -i 's/51.2M/52M/g' appliance-config


remove 'su syslog adm' line from integrity_checker.log file rotate config section:
sed -i '/su syslog adm/d' appliance-config

There is no need to restart any services, as there is a cronjob which will read these values the next time it runs.