Hello vComunnity,

As unusual as it might sound, there are times where the scratch partition link gets broken and our ESXi logs won’t be stored persistently, in those situations we’ll have to get a new Scratch partition configured to store the logs persistently once again.

Also, I’ve seen new deployments where (due to companies regulations) logs

CLI way (Tech Support Mode)

You have several options to store the logs, I personally like shared datastores so my logs will be available even in the event of a host failure and this one does not come back, but if you don’t have a share datastore, that won’t be a problem, we can  reconfigure it locally,

To check the configured scratch partition you can run:

vim-cmd hostsvc/advopt/view ScratchConfig.ConfiguredScratchLocation

To check the currently configured scratch partition you can run:

Get the name of the Datastore you want to use to store the logs:

df -h

I’ll use the ds-nfs01 to store the logs

Now that we have the name we can proceed with the new scratch directory creation, but first, make sure to place the node in Maintenance Mode (MM).

MM may vary depending on the services you have enable (VSAN/DRS/VDI/etc)

# Generate a new scratch directory for this host on a Datastore
scratchdir=/vmfs/volumes/ds-nfs01/.locker-$(hostname 2> /dev/null)-$(esxcfg-info -b 2> /dev/null)

# Create the scratch directory
mkdir -p $scratchdir

# Change the advanced configuration option
vim-cmd hostsvc/advopt/update ScratchConfig.ConfiguredScratchLocation string $scratchdir

No outputs will be displayed, if you get the same screen you are good, now reboot your host and wait for it to come back

Once the node is back, login and check if the current location is the one configured before the reboot, we can also confirm that the new location is storing the logs:

Hope this was a cool post for you guys to know,

Do now hesitate in contacting me if you have any comments,

Jorluis

Buy me a coffeeBuy me a coffee