VMware Cloud Community
cojaxx8
Enthusiast
Enthusiast

Unable to delete datastore because it is in use

Hello,

I took delivery of a brand new Dell T430 server today. It came with 2 x SD Cards and a pre-configured RAID 6 (5 x 1.2TB drives).

ESXi had already been installed on the SD Card, so when I booted the server I logged into the web interface and added in my datastore. After creating the datastore and rebooting the server, I decided I wanted to change the partition layout of the datastore so decided to delete it. However when doing so, it said the datastore was in use.

From what i've read online, probably what happened is, when my datastore got created and the server rebooted, the scratch location changed from ramdisk to the datastore.

ESXi selects one of these scratch locations during startup in this order of preference:

    The location configured in the /etc/vmware/locker.conf configuration file, set by the ScratchConfig.ConfiguredScratchLocation configuration option, as in this article.
1    A Fat16 filesystem of at least 4 GB on the Local Boot device.
2   A Fat16 filesystem of at least 4 GB on a Local device.
3    A VMFS datastore on a Local device, in a .locker/ directory.
4    A ramdisk at /tmp/scratch/.

I attempted to change the location of the datastore back to my SD card so I could temporarily delete the datastore and recreate, but every time I set the  "ScratchConfig.ConfiguredScratchLocation" to either a path I created on the SD card (/scratch2) or "reset to default", after rebooting the server ESXi changed it back to the datastore location.

So I was wondering, in this scenario, how is it actually possible to change the scratch location and actually delete the datastore? Ideally there would be a way to tell esxi to use a RAMdisk again but I don't think this is possible.

What I ended up doing was initializing the RAID array again which deleted the datastore... but there has to be an easier way!

Cheers

Peter

Reply
0 Kudos
3 Replies
Sreejesh_D
Virtuoso
Virtuoso

hi Peter,

whats the esxi version? if its 6.5 try using host client to change scratch locaiton.

Creating a persistent scratch location for ESXi 4.x/5.x/6.x (1033696) | VMware KB

Reply
0 Kudos
cojaxx8
Enthusiast
Enthusiast

Yeah I am using 6.5.

I tried using the host client but it kept on reverting back.

Reply
0 Kudos
Sreejesh_D
Virtuoso
Virtuoso

ok,

since the ESXi is installed on SD card we can do this.

1. Reboot the host and from RAID controller delete the logical disk which represents the datastore which you want to re-partition

2. reboot the host.

3. set the scratch partition to Ramdisk.

4. reboot and ensure the scrath settings are consistent.

5. reboot and create the logical disk from RAID cotroller firmware.

6. reboot the host.

7. create datastore using new logical disk.

Reply
0 Kudos