ESXi Scratch Partition – How to Change it?

  • 2018-06_VMware-Scratch-Configuration_Blog-Feature

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

  1. Connect to vCenter Server or the ESXi host using the vSphere Web Client
  2. Select your datastore you want to use.
  3. Right click datastore (local or shared) and select Browse Files
  4. If you are using a shared datastore, use a path that is unique to your host.
  5. Create folder for this ESXi host name, for example “ESXiName-scratch” > close the datastore browser.
  6. Select the host > Manage > Setting  > Advanced System Setting
  7. Search for “scratch”
  8. Change the ScratchConfig.ConfiguredScratchLocation by pressing the pencil icon to the location you created earlier.
  9. Reboot Host
2018-06_VMware-Scratch-Configuration_Blog-Feature

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.

TJ Totland

Todd "TJ" Totland is a computer and network engineer working for IBM. He is certified as a MCSE, MCT, CNE, and CNA with vast experience in many technologies used in businesses today. TJ has designed, built, and managed hundreds of different types of computer and network systems for large and small customers since 1990. He is a subject Matter Expert in Cloud Technologies and has vast knowledge in VMware products.