VMware recommends that ESXi has a persistent scratch location available for storing temporary data including logs, diagnostic information, and system swap. (This is not a requirement, however.) Persistent scratch space may be provisioned on a FAT 16, VMFS, or NFS partition accessible by the ESXi host.
Note: Scratch space is configured automatically during installation or first boot of an ESXi host, and does not usually need to be manually configured. ESXi Installable creates a 4 GB Fat16 partition on the target device during installation if there is sufficient space, and if the device is considered Local.
If persistent scratch space is not available, ESXi stores this temporary data on a ramdisk, which is constrained in space. This might be problematic in low-memory situations, but is not critical to the operation of ESXi. Information stored on a ramdisk does not persist across reboots, so troubleshooting information such as logs and core files could be lost. If a persistent scratch location on the host is not configured properly, you may experience intermittent issues due to lack of space for temporary files and the log files will not be updated.
Configuring a persistent scratch location using PowerCLI
To configure persistent scratch space for ESXi using the vSphere PowerCLI interface:
- Before proceeding, ensure that
/tmp/scratchexists. If it does not exist, use the command
mkdir /tmp/scratchto create it.
- For more information on vSphere PowerCLI usage, see the vSphere PowerCLI documentation.
- Open a command prompt where the PowerCLI is installed.
- Connect to the ESXi host using the command:
- Obtain a list of datastores reachable from this ESXi host using the command:
- Mount a datastore read/write as a PSDrive using the command:
New-PSDrive -Name "mounteddatastore" -Root \ -PSProvider VimDatastore -Datastore (Get-Datastore "DatastoreName")
- Access the new PSDrive using the command:
- Create a uniquely-named directory for this ESXi host using the command:
New-Item "DirectoryName" -ItemType directory
New-Item ".locker-ESXHostname" -ItemType directory
- Check the current value of the
ScratchConfig.ConfiguredScratchLocationconfiguration option using the command:
Get-VMHostAdvancedConfiguration -Name "ScratchConfig.ConfiguredScratchLocation"
VMHostAdvancedConfigurationhas been deprecated in PowerCLI 5.1 and replaced with
AdvancedSetting. For more information, see the vSphere PowerCLI documentation.
- Change the
ScratchConfig.ConfiguredScratchLocationconfiguration option, specifying the full path to the directory created in step 6, using the command:
Set-VMHostAdvancedConfiguration -Name "ScratchConfig.ConfiguredScratchLocation" -Value "/vmfs/volumes/DatastoreName/DirectoryName"
Set-VMHostAdvancedConfiguration -Name "ScratchConfig.ConfiguredScratchLocation" -Value "/vmfs/volumes/Datastore1/.locker-ESXHostname"
- Put the ESXi host into maintenance mode and reboot for the configuration change to take effect.