You can configure persistent scratch space for ESXi using the vSphere Client:
- Connect to vCenter Server or the ESXi host using the vSphere Client.
- Select the ESXi host in the inventory.
- Click the Configuration tab.
- Click Storage.
- Right-click a datastore and select Browse.
- Create a directory for this ESX host (eg, locker-servername)
- Close the Datastore Browser.
- Click Advanced Settings under Software.
- Select the ScratchConfig section.
- Change the ScratchConfig.ConfiguredScratchLocation configuration option, specifying the full path to the directory.
eg. /vmfs/volumes/DatastoreName/locker-servername - Click OK.
- Put the ESXi host in maintenance mode and reboot for the configuration change to take effect.
You could also use vCLI or PowerCLI to make the change but I found the above procedure easier to use.