You can change the number of the log files for all virtual machines on an ESXi host or for individual virtual machines.

This procedure discusses limiting the virtual machine log file number on an individual virtual machine.

To limit the number of log files for all virtual machines on a host, edit the /etc/vmware/config file. If the vmx.log.KeepOld property is not defined in the file, you can add it. For example, to keep ten log files for each virtual machine, add the following to /etc/vmware/config:

vmx.log.keepOld = "10"
You can use a PowerCLI script to change this property on all the virtual machines on a host.

You can use the log.keepOld parameter to affect all log files, not just the virtual machine log files.

Prerequisites

Turn off the virtual machine.

Procedure

  1. Log in to a vCenter Server system using the vSphere Client and find the virtual machine.
    1. In the Navigator, select VMs and Templates.
    2. Find the virtual machine in the hierarchy.
  2. Right-click the virtual machine and click Edit Settings.
  3. Select VM Options.
  4. Click Advanced and click Edit Configuration.
  5. Add or edit the vmx.log.keepOld parameter to the number of files to keep for this virtual machine.
    For example, to keep 20 log files and begin deleting the oldest files as new ones are created, enter 20.
  6. Click OK.