Monday, 28 January 2013

ESXi losing logs after reboot


We recently upgraded from ESX 4.1 (FAT) to ESXi 5 and we were used to having the logs stored on the local disk so that we can do diagnostics when things go wrong. As ESXi can run stateless the logging is stored in memory during runtime by default and if the host was to freeze or you issued a reboot then all the logs would disappear.
VMware gives you options to either create a syslog server to have the host sending information to it, or like me our servers have plenty of local disk space so why not use them to store the logs like before.

Here are the steps to quickly setup using vCentre client:

  •  Log on to vcenter and locate your host or use the vCentre client to connect directly to the host.
  •  Create a new directory on your local datastore e.g. “logs” 

  • Go to “advanced settings”

  •  Select “ScratchConfig” and change “ScratchConfig.ConfiguredScratchLocation” to your new path. e.g. "/vmfs/volumes/vhyp002/logs", Click “OK"
  • If you go back and view the setting again you will see that the path would have changed to disk UUID instead of the name “vhyp002”

  • A quick check on CLI you can you can see the name “vhyp002” has the UUID of “50a6xx” which matches the above
  • Give the host a reboot and now when you browse to the local disk folder you will see the logs are writing there

Here is an VMware article which towards the end tells you how to create the persistent scratch area using PowerCLI, vCLI, Tech support mode, vSphere web client ESXi 5.1, kickstart script during build and GUI method I have described above.





No comments:

Post a Comment

Azure Resource Support for Availability Zone

Over the years, an increasing number of services are consumed in the cloud and as architects one of the key considerations is designing the ...