Knowledge Base
The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides

|
Using vmkfstools to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
Details
Solution
ESXi 5.0 Update 1 includes an updated version of
vmkfstools that provides an option (-y) to send the UNMAP command to the storage arrays regardless of the ESXi host’s global setting.Note: When you run
vmkfstools --help, the -y option is not displayed in the syntax help output.If your storage vendor has tested this option with storage arrays, you may use it to reclaim deleted blocks resulting from deleting or moving files from VMFS datastores residing on thin-provisioned LUNs.
To confirm if SCSI UNMAP is supported on a LUN:
# esxcli storage core device vaai status get -d naaExample output:
naa.60a98000572d54724a346a6170627a52
VAAI Plugin Name: VMW_VAAIP_NETAPP
ATS Status: supported
Clone Status: supported
Zero Status: supported
Delete Status: supportedIn this example, the device displays Delete Status as supported, meaning that it is capable of sending SCSI UNMAP commands to the array when a space reclaim operation is requested.
Using the
-y option:# cd /vmfs/volumes/volume_name# vmkfstools -y percentage_of_deleted_blocks_to_reclaimThis command creates temporary files at the top level of the datastore. These files can be as large as the aggregate size of blocks being reclaimed.
Note: If the reclaim operation is interrupted, these temporary files may not be deleted automatically and you must delete them manually.
The time that the operation takes to complete varies by storage vendor. As the operation is time consuming, consider running it during a maintenance window because the high I/O generated by the SCSI UNMAP operation may impact storage performance on the array, thus impacting running virtual machines.
For more information on SCSI UNMAP, see the VMware vSphere Blog post, VAAI Thin Provisioning Block Reclaim/UNMAP In Action.
Example
-y option usage:To reclaim 60% of deleted blocks on a datastore named Datastore1 in the current directory:
# cd /vmfs/volumes/Datastore1
# vmkfstools -y 60If you delete 10 GB of files from the example VMFS volume Datastore1 using the example above, the operation will reclaim 60% of the 10 GB of space; in other words, 6 GB will be reclaimed.
Note: If the command succeeds without any visible errors but no space on the storage has been reclaimed, you may need to enable UNMAP support using this command:
esxcli system settings advanced set --int-value 1 --option /VMFS3/EnableBlockDeleteFor more information on enabling/disabling the UNMAP feature, see Disabling VAAI Thin Provisioning Block Space Reclamation (UNMAP) in ESXi 5.0 (2007427).
Request a Product Feature
To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.
Actions
KB:
- Updated:
- Categories:
- Languages:
- Product Family:
- Product(s):
- Product Version(s):

