When the host logs are exported using the vSphere/Virtual Infrastructure Client, there is a vmsupport.tgz file left behind on the host. On an ESX host, this file resides in /usr/lib/vmware/hostd/docroot/downloads. On an ESXi host, this file resides in /scratch/downloads. There is no automatic mechanism to clean up these files. Given enough time and log exports, these files could fill the file systems on which they reside.
To work around this issue, prevent these file systems from filling up.
To prevent these file systems from filling up, perform one of these two procedures:
- Periodically check for the existence of these files and delete them as appropriate.
- Implement a cron job to call a custom script that cleans these files.
- Use a text editor to create a script in /usr/local/bin on ESX or in /scratch on ESXi.
- Add these lines to the newly created script:
daterange="30"
esxidir="/scratch/downloads"
esxdir="/usr/lib/vmware/hostd/docroot/downloads"
if [ -d $esxidir ]
then
find $esxidir -name \*support-*.tgz -mtime +$daterange -exec rm -f {} \;
else
find $esxdir -name \*support-*.tgz -mtime +$daterange -exec rm -f {} \;
fi
Replace the "30" for the daterange variable with the number of days the vmsupport files should be left on the system.
- Make the script executable, chmod +x /usr/local/bin/