In vSphere 5.5 and 6.0 a new command was given to esxcli. With this command you can reclaim deleted blocks on thin-provisoned LUNs.
You could run the mechanism in production time. This might sound good…. Our maintainance windows gets smaller and smaller with every new service and if you could do maintainance when everybody could work is that great.
BUT one moment!
The ESXi host which runs the reclaim would get very high cpu usage and might costops VMs within the host. Especially the first run will take a lot of time.
The VMware KB article 2057513 describes the command which reclaims the deleted blocks on an thin-provisioned LUN in vSphere 5.5
Using esxcli in vSphere 5.5 and 6.0 to reclaim VMFS deleted blocks on thin-provisioned LUNs (2057513)
In the older versions of ESXi (5.0 und 5.1) you have to follow the VMware KB article 2014849 to reclaim the deleted blocks.
Using vmkfstools to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
To recalim the blocks in ESXi 5.5 and ESXi 6.0 you have run the following command
esxcli storage vmfs unmap --volume-label=volume_label | --volume-uuid=volume_uuid (--reclaim-unit=number)
You have the choice to use the volume label or the volume UUID. In this example i use the volume label. The number of reclaimed blocks per iteration is optional (200 per default).
For the first easy run, we only need one information:
You will get this information in the vSphere Client. In this example the deleted blocks of Volume V1005 will be recalimed.
If you want to use the UUID of volume V1005 the following command is necessary:
esxcli storage filesystem list | grep -i v1005
To start the reclaim we build the command as follows:
esxcli storage vmfs unmap --volume-label=V1005
The command will run severall moments and ends unspectacularly.
But those who looks at the storage before and after the reclaim maybe find something like this:
The command has freed up 30GB of deleted blocks which were allocated after their delete in the VMFS volume.