ESXi

 View Only
Expand all | Collapse all

set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

  • 1.  set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted Apr 12, 2023 03:23 PM

    I am looking for help/guidance on how to do this (Solved: ESXI 6.7 Removing Datastore: Setting Scratch locat... - VMware Technology Network VMTN) in a vsphere7/8 environment. My environment specific caveats - it is a 4-node self-managed vsan cluster (meaning vcenter sits on top of the vsan it manages) where esxi is deployed to an sd card. During deployment, a temporary local datastore is created. In some instances a coredump gets created and recovering from that following instructions linked above do not produce the expected result. The scratch partition gets repointed to the local datastore after every reboot, so the local datastore can never be deleted. I wouuld prefer to permanently disable the coredump (like Permanently disable ESXi coredump file (74537) (vmware.com)) but this no longer works either. So Im looking for a way to keep the scratch partition on /tmp (even when a local datastore is peresent).



  • 2.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Posted Apr 12, 2023 07:53 PM

    ,.

    You could update ScratchConfig.ConfiguredScratchLocation and point to /tmp. This can be changed from ESXi Advanced System Settings on each four of them.

    Have you tried this option already?



  • 3.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted Apr 13, 2023 10:53 AM

    ,

    Thx for the quick response!

    I did update that setting, which requires a reboot to take effect. Upon rebooting, the setting ScratchConfig.CurrentScratchLocation and ConfiguredScratchLocation are set back to the local datastore. This change worked (I think) until 7.x when the ESXi system storage layout changed.

    I am trying to remove the local datastore (is was temporary) but it seems to be in a state where I cannot go back ... unless of course I am missing something ...



  • 4.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x
    Best Answer

    Posted Apr 13, 2023 12:26 PM

    ,

    I was reading a little bit more and testing myself, and it seems that you cannot simply redirect back to /tmp and expect the /scratch to be re-created (Do not know why). Try the following:

    1. mkdir /tmp/scratch

    2. Update ScratchConfig.CurrentScratchLocation with /tmp/scratch

    3. reboot

    Let me know how it goes.

     



  • 5.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted Apr 18, 2023 05:40 PM

    ,

    Thanks for the detail.! I will give it a go ... I opened a tkt with GSS and they agreed with your approach ...

    I will follow up with results (for others) ...

     

    Thx again for the help!!

     



  • 6.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x
    Best Answer

    Posted May 01, 2023 09:38 AM

    Hello  ,

    The partition will always point to a directory so we will need a directory inside the /tmp location. Please follow the below steps.

    1. Take SSH session of Esxi host using root and run the command mkdir /tmp/scratch - This will create a directory named scratch under /tmp folder

    2. Goto Esxi configuration setting and Update ScratchConfig.CurrentScratchLocation with /tmp/scratch

    3. reboot

    Do let me know the results.

     



  • 7.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted May 16, 2023 09:03 PM

     - thx for the information. I finally got the chance to get back to this ... I did confirm that manually creating the /tmp/scratch partition does the trick. 

    What I was trying to shed light on is ... why in previous releases I did not have to do this? I guess it's possible that in 7.x and later the OS partitioning and file system changed on esxi which may now require the added configuration (and it only affects those who have cfg'ed scratch to ramdisk (b/c esxi is installed on sd cards) ...

    In previous versions I never had to specifically create the scratch directory ... as if setting the advanced setting defaulted to (create if doesn't exist) the scratch folder within /tmp ... and maybe it no longer does that ... 

    Oh well ...  now the next hurdle ... figuring out how to tackle this with (Get-Esxcli) - so I can keep it all nice and tidy in the same script block ...

    I thought it was $esxcli.esxcli.command("mkdir /tmp/scratch") ... but it wasn't

    I'll post again when I find the correct line ... 



  • 8.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Posted May 23, 2023 09:53 AM

    Hello  ,

    Generally when we install Esxi the default location is tmp but we need to create a folder manually inside the tmp directory to save the scratch partition.

    The mkdir is not an esxcli command but its a direct command to only create a directory inside tmp location.

     



  • 9.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Posted Jun 12, 2024 03:10 PM

    Did you manage to create the needed folder through PowerCLI?
    We are going to need to go through 74 hosts, and enableing ssh, loging in and doing the mkdir takes quite the time.
    Would save lots of time if we can simplify some stuff




  • 10.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted May 22, 2023 07:35 PM

      I just noticed that you say to change the value of ScratchConfig.CurrentScratchLocation. Did you mean ScratchConfig.ConfiguredScratchLocation?

     



  • 11.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Posted May 23, 2023 09:54 AM

    Hello  ,

     

    Yes the Current Scratch config on Esxi. The changes will take place post reboot.

     



  • 12.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Broadcom Employee
    Posted May 23, 2023 12:48 PM

    That's what I thought the ScratchConfig.ConfiguredScratchLocation option did. When I try to modify the CurrentScratchLocation, an error is thrown ... 



  • 13.  RE: set scratch partition (back) to /tmp for esxi 7.x and esxi8.x

    Posted May 30, 2023 01:52 PM

    Hello  ,

     

    We can only change configured setting.. Post reboot the current and configured setting should show same value.