Hi All,
On 1 of my ESX hosts the /var/log folder has grown to the point its causing me issues creating VM's etc..from looking at the files in this folder some are big in size particularly sercure.1 and secure.2 (both over 200MB) my question is, is it safe to delete these files? I also have lots of vmkernel.* is it also safe to purge these files?
Thanks
The files you see with the .1, .2, ... extensions are archived log files resulting from the log file rotation. Log files are usually rotated based on their size and/or when a host or VM is powered on. You can delete these rotated log files if you want to free up disk space. I don't recommend you delete the ".log" files though, because these are usually the current ones (except for the virtual machine log files).
However, if the logfiles have such a size there's got to be be a reason for it. I'd recommend you first take a look at the log files to find out whether there's an issue which needs to be resolved before deleting them.
André
Hello,
Might this kb can be useful for your problem.
Please, don't forget the awarding points for "helpful" and/or "correct" answers.
Mauro Bonder - Moderator
Hi I did see that post online however doesn't say if I can delete these specific files can you advise?
Thanks
To get a count on the number of vmware-x.log files in the folder, run:
To remove the logs, run:
This deletes all log files, unless there are too many arguments. That is, too many files for the rm command to handle. In this case, try deleting all files beginning with vmware-1:
If there are tens of thousands of files, there may be over a thousand beginning with 1, so again too many arguments. You must be more specific:
If necessary, continue to narrow down the command's deletion candidates until you reach an acceptable file count.
Keep removing the log files until only vmware.log remains. Repeat for any other virtual machines affected.
When I run the first command the count is 3 however from viewing inside this folder I don't have many vmware-* files, the files that are eating my space begin secure.* - these files are rather large in size and its these files specifically I would like to know if they are ok to delete?
Thanks
Authentication log - /var/log/secure - Contains records of connections that require authentication, such as VMware daemons and actions initiated by the xinetd daemon.
go ahead
The files you see with the .1, .2, ... extensions are archived log files resulting from the log file rotation. Log files are usually rotated based on their size and/or when a host or VM is powered on. You can delete these rotated log files if you want to free up disk space. I don't recommend you delete the ".log" files though, because these are usually the current ones (except for the virtual machine log files).
However, if the logfiles have such a size there's got to be be a reason for it. I'd recommend you first take a look at the log files to find out whether there's an issue which needs to be resolved before deleting them.
André
Sound strange that the log files grow so fast.
Check the content to verify if there are some errors.
In any case you can change how logrotate handle those files, and for example reduce the number of version, or increase the frequency.
Andre
To prevent concurrent changes to critical virtual machine files and file systems, ESX hosts establish locks on these files. In certain circumstances these locks may not be released when the virtual machine is powered off. The files cannot be accessed by the servers while locked, and the virtual machine is unable to power on.
There are many log files but you have to decide which one is useful for you and make sure that less important logs do not take much space.
Keep the vmware.log file and the necessary ones to you and delete rest.Also go through the log file as what is the reason of file size is hitting so high limit.
Several ESX host log files are controlled by the Linux logrotate program. With ESX server, logrotate is executed hourly using the /etc/cron.daily/logrotate command. From there, logrotate uses its configuration file /etc/logrotate.conf. By default, that file references the directory /etc/logrotate.d to find out which log files it needs to rotate.