ReClaiming a VMware Datastore using vmkfstools Scheduled Task

When your LUN useage shows useage that does not match your datastore useage you will need to perform a reclaim on the lun. Remember the LUN will need to be Thin provisioned with Space Reservation Disabled on a NetApp. To check you LUN is supported , login to an ESX Host and run

esxcli storage core device vaai status get

On the volume it need to have :

Delete Status: supported

Recalim can be done manually using the putty commands on a VMWare host attached to the datastore


cd /vmfs/volumes/datastorename/
vmkfstools -y %percenttoclear%


It is recommended that the %percenttoclear% increases from say 10% up to 80% in 10% Blocks

There’s a nice script here : to automate the increase

****WARNING**** Do only one reclaim at a time , and it sharpley increases the IOP’s on the San to best to do out of hours

We had to do a few of these out of hours at around 3am , I actually automated this as a scheduled task using putty’s plink.exe which meants it ran in the very early hours of the morning! I couldn’t use the Kallesplaygroup .sh script as this didn’t work sending from plink , the script would have to be on the local esx box which it’s practical to to the multiple hosts our current cluster runs

FYI you will see you have to manually enter the password. A more recommended solution would be to use certificate authentication with putty


plink.exe %esxboxwithsshenabled% -ssh -batch -l root -pw %rootpasswordofesxbox% -m C:\Scripts\ > c:\log.txt


**** Update in 5.5 this has changed to 

storage vmfs unmap -l Datastore name -n unit



1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)