ESXi Scratch Partition – How to Change it?
As you already know, the default location for your VMware logs are on the ESXi scratch partition. This is temporary space that gets erased after every ESXi reboot and is a poor location to store your log files. This article will show you why and how you should change it and it will only take 5 minutes.
What is the ESXi Scratch Partition?
Many ESXi servers boot off a very small drive and save all storage drives for VM files. Some host servers even remove all internal hard drives and just have an internal thumb drive. My ESXi server have 8-16 GB thumb drives holding just the OS and 1-3 TB SATA drives for VMs. My VM’s are divided between local SATA, iSCSI, and remote NFS volumes.
Given the limited space on a USB drive, the installation partition is not big enough to store your logs or crash dump files. This means it will store your logs on temporary RAM storage. Since this storage gets reinitialized after every reboot (or crash), all past log files disappear after a host reboot. Not ideal when trying to troubleshoot why your server just crashed.
An easy fix to this is to move your ESXi scratch partition to more permanent storage like your local VMFS or SAN/NAS drive. I recommend using SAN or NAS if you can because you will have access to your log files even if your server will not reboot. This is sort of like having a syslog server without the hassle of building one. Be careful when using network attached storage. Make sure your network is fast enough to support the traffic.
How to Change the Location of your ESXi Scratch Partition?
How to configure scratch location for ESXi logs? Follow those steps
- Connect to vCenter Server or the ESXi host using the vSphere Web Client
- Select your datastore you want to use.
- Right click datastore (local or shared) and select Browse Files
- If you are using a shared datastore, use a path that is unique to your host.
- Create folder for this ESXi host name, for example “ESXiName-scratch” > close the datastore browser.
- Select the host > Manage > Setting > Advanced System Setting
- Search for “scratch”
- Change the ScratchConfig.ConfiguredScratchLocation by pressing the pencil icon to the location you created earlier.
- Reboot Host
Remember if you are using a shared drive where multiple ESX servers will write to, you want your path to be unique to your host. Simply add your ESX Host name in your path to make sure each server will not write over the other log files.
That is one of several ways to change your ESXi Scratch Partition. Really Simple.
If you liked this article, please consider signing up for our email list and receive future notices of DevOps technical articles that will teach you something new every month.