VMware Cloud Community
Gr4cchus
Enthusiast
Enthusiast
Jump to solution

ESXI 6.7 Removing Datastore: Setting Scratch location back to non-persistence

Having problems removing a datastore and noticed the vSphere client does not let me set advanced settings such as:

ScratchConfig.ConfiguredScratchLocation

ScratchConfig.CurrentScratchLocation

to

[] /scratch/log/.locker

Any ideas on the solution? I suspect the issue is with vSphere and having to directly go the esxi portal or shell in.

Update

shelled in:

mkdir -p /tmp/scratch

On vSphere I changed the advanced setting ScratchConfig.ConfiguredScratchLocation to /tmp/scratch but anytime I try to set ScratchConfig.CurrentScratchLocation to /tmp/scratch or /tmp/scratch/.locker I get an error message. pastedImage_2.png

I briefly went through VMware Knowledge Base and it mentioned a restart was needed for that setting to be changed so I restarted. But when I went back to the hosts advanced settings those settings were reset back to the original datastore?

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Gr4cchus
Enthusiast
Enthusiast
Jump to solution

The above script may work however for posterity (its been awhile so steps have been missed or are not in a valid sequence guaranteed) what I did to solve this was change the ScratchConfig.ConfiguredScratchLocation, ScratchConfig.CurrentScratchLocation, and maybe even the Syslog.global.logDir to /tmp(or prob anything you want, be aware if an error is thrown your changes may be reverted when editing in groups) however ScratchConfig.CurrentScratchLocation should throw you an error which leads to the next part. SSH into the box, try to remove all contents in the datastore, remove(careful you will have to regernate the symlink back to the same datastore) the symlink for scratch in / (root) directory. Try changing ScratchConfig.CurrentScratchLocation back to /tmp. recreate the symlink to the bad datastore. you have to recreate the .locker???? so ScratchConfig.CurrentScratchLocation can see it again, now try changing ScratchConfig.CurrentScratchLocation again and it should be blank , or actually be set to /tmp or you need to set it to /tmp now. destroy the symlink again and remove all the files in the bad datastore. symlink to the new directory and make sure all your entries are set correct or as most correct as you can now and reboot. Check and it should be pointing to where it needs to be now. Sorry for the unclear procedure but it roughly shows you how to proceed.

View solution in original post

Reply
0 Kudos
2 Replies
ryanrpatel
Enthusiast
Enthusiast
Jump to solution

Take a look at this script and edit for your own purpose. You're basically reversing what this one is doing.

Scripts/Config_Scratch.ps1 at master · vNinjaDFW/Scripts · GitHub

Reply
0 Kudos
Gr4cchus
Enthusiast
Enthusiast
Jump to solution

The above script may work however for posterity (its been awhile so steps have been missed or are not in a valid sequence guaranteed) what I did to solve this was change the ScratchConfig.ConfiguredScratchLocation, ScratchConfig.CurrentScratchLocation, and maybe even the Syslog.global.logDir to /tmp(or prob anything you want, be aware if an error is thrown your changes may be reverted when editing in groups) however ScratchConfig.CurrentScratchLocation should throw you an error which leads to the next part. SSH into the box, try to remove all contents in the datastore, remove(careful you will have to regernate the symlink back to the same datastore) the symlink for scratch in / (root) directory. Try changing ScratchConfig.CurrentScratchLocation back to /tmp. recreate the symlink to the bad datastore. you have to recreate the .locker???? so ScratchConfig.CurrentScratchLocation can see it again, now try changing ScratchConfig.CurrentScratchLocation again and it should be blank , or actually be set to /tmp or you need to set it to /tmp now. destroy the symlink again and remove all the files in the bad datastore. symlink to the new directory and make sure all your entries are set correct or as most correct as you can now and reboot. Check and it should be pointing to where it needs to be now. Sorry for the unclear procedure but it roughly shows you how to proceed.

Reply
0 Kudos