The vmware.log file contains virtual machine specific logging. The vmware.log file is stored in the same virtual machine directory as the virtual machine configuration file (virtualmachine.vmx). By default the vmware.log file is only rotated when a virtual machine is restarted and 6 old logs are kept.
Generally unless there is an issue with a VM these logs do not become very large nor do they grow very fast so the default should be fine in most cases. If you do want to control the size and number of logs kept (a compliance requirement or what have you) it has to be configured on each virtual machine.
Setting log.rotateSize and log.keepOld
To add or edit these configurations the Virtual machine must be powered off. Using the vSphere client Edit Settings of the virtual machine, select the Options tab, under Advanced select General, and click on the “Configuration Parameters…” button. Select “Add Row” and in the name field type log.rotateSize. In the value field specify the file rotation size, for 1MB enter 1000000.
To change the number of logs to keep click the “Add Row” button again and enter log.keepOld to the name field. In the value field set the number of old logs you want to keep. If you want to keep 3 old logs set this value to 3.
You can also add these options by editing the VM’s .vmx file and add the following lines:
log.rotateSize = “1000000”
log.keepOld = “3”
There is a VMwareKB on Log rotation and logging options for vmware.log but the KB does not reference vSphere 5. The configurations are the same on vSphere 5. The KB references that 3 old log files are kept by default, I am not sure when this changed but with out setting up log.keepOld 6 old log files are being kept. Not sure in what version this may have changed or if there is somewhere else this can be set.
Does anyone know of away to set this globally for all VMs? You can set the options on a template and any VMs deployed using that template will have the options set, but is there a way to set this by default on any VM created?
What about setting it using PowerCLI? Check out this post on Setting/Modifying Advanced VM Options using PowerCLI to set log rotation and number of old logs to keep with PowerCLI.