ESXi persistent scratch location esp. for VSAN nodes
ESXi automatically creates a 4GB FAT filesystem for persistent scratch if there is sufficient space available during installation. However if installation is done on a 16GB Flash (typical for VSAN nodes) then the location is not set automatically. However, if for some reason one of the VSAN disks is used to create a temporary local datastore (VMFS) then ESXi automatically configures that location for persistent scratch and perhaps even for coredump. For disabling coredump refer Disable ESXi coredump and delete coredump file.
But for deleting persistent scratch changing system settings or updating /etc/vmware/locker.conf file does not works. As after reboot VMWare ESXi again automatically configures the local datastore as destination for persistent scratch. Creating a folder /tmp/scratch and setting /tmp/scratch as persistent scratch location on VSAN nodes on top of SD cards also does not helps.
Deleting or disabling persistent scratch is important as without doing this datastore cannot be deleted. Datastore configured (or automatically selected) as persistent scratch destination shows 'datastore is in use' error when we try to delete it.
ESXi selects one of these scratch locations during startup in this order of preference:
- The location configured in the /etc/vmware/locker.conf configuration file, set by the ScratchConfig.ConfiguredScratchLocation configuration option, as in this article.
- A Fat16 filesystem of at least 4 GB on the Local Boot device.
- A Fat16 filesystem of at least 4 GB on a Local device.
- A VMFS datastore on a Local device, in a .locker/ directory.
- A ramdisk at /tmp/scratch/.
Thus, there might be a way of changing datastore persistent scratch location to a 4GB fat16 pen drive. This still needs to be explored.