Because one of our VMs had an error while taking a snapshot, i wanted to have a look inside vmware.log. Recognized that it was more than three GB in size. That’s not normal at all.
In vSphere 5.1 VMware changed the way it rotates the vmware.log file. The setting “log.rotateSize” doesn’t exists anymore. It now uses a bandwith/rate limit, which is fine in most cases.
If that happened to one machine, it may also happened to other machines. Because we only have four vSphere hosts which all share the same datastores, i could simply do a one-liner to get the size of the log file of all VMs:
cd /vmfs/volumes/; ls -lhdS [A-Z]*/*/vmware.log | head -10
This shows the 10 biggest logfiles. To prevent that datastores are shown twice, once by name and once by id, i limited it to only show datastores starting with a capital letter (all our datastores start with an upper case letter, you may have to adjust the command to fit our environment).
To manually rotate the log, you can do two things as far i know:
- Shutdown and power off/on the VM
- Simply vMotion the VM (not the datastore) to another host