SRM services stop due to unmanaged SRA log files
search cancel

SRM services stop due to unmanaged SRA log files

book

Article ID: 313050

calendar_today

Updated On:

Products

VMware Live Recovery

Issue/Introduction

Symptoms:
  • Site Recovery Manager (SRM) virtual appliance services unexpectedly stop
  • Log bundles cannot be generated.
  • The SRM appliance support partition is full.


Environment

VMware vCenter Site Recovery Manager 8.x

Cause

The SRM appliance has two main disks: system and support.

The support disk contains an lvm ext4 file system.
The support partition stores the logs of VMware-related services.
The mount point of the partition is "/opt/vmware/support"

Storage Replication Adapter(SRA) logs don't currently have restriction for the size of the logs they produce. Having logs that are not managed will cause the support partition of the disk to fill up. This will result in the unplanned failure of the SRM server services due to the lack of any space available on disk for the log files.

Some SRAs lack appropriate safe guards on their log rotation method. This requires a manual clean up of the logs. There is no defined log naming convention or a limit on the number of logs each SRA may generate. In order to achieve clean up for the general case, assume the worst-case scenario, that each SRA logs to one log file and does not rotate it at all.

Resolution

This issue is fixed in: VMware Site Recovery Manager 8.2.0.1 |  13 AUG 2019 | Build 14338491 | Download

Workaround:
A script has been developed which uses the preinstalled logrotate linux utility. This script is attached to this article.
The attached script will do the manual clean up and setup logrotate to monitor the files.
After log rotation, the old logs will be stored in an archive until the next log rotation. The archive will be stored under "/opt/vmware/support/logs/srm/" folder.

How to install the script


1. Download the script "clean-sras-logs.sh" in the "Attachments" section to the right.
2. As root user, place the script in "/opt/vmware/bin" with the name clean-sras-logs.sh

3. Set the script to be executable:

chmod 755 /opt/vmware/bin/clean-sras-logs.sh
4. Manually execute the script to rotate the log files inside the SRAs log partition.
/opt/vmware/bin/clean-sras-logs.sh
 

How to enable cron job to execute SRAs log rotation every day


1. As root user, create an empty file inside "/etc/cron.d/" with the filename sras.cron:
touch /etc/cron.d/sras.cron
 

2. Fill the content with the below text using a text editor :

0 0 * * * root /bin/bash /opt/vmware/bin/clean-sras-logs.sh

3. Restart the crond service:
systemctl restart crond


Additional Information

To uninstall this workaround:

How to disable cron job to execute SRAs log rotation every day


1. As root user, remove the file /etc/cron.d/sras.cron:

cd /etc/cron.d
rm sras.cron

 

Restart the crond service:

systemctl restart crond

Remove the script


1. As root user, remove the file /opt/vmware/bin/clean-sras-logs.sh

cd /opt/vmware/bin
rm clean-sras-logs.sh


Attachments

clean-sras-logs get_app