The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
Using vmkfstools to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
ESXi 5.0 Update 1 includes an updated version of
vmkfstoolsthat 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
-yoption 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 naa
VAAI Plugin Name: VMW_VAAIP_NETAPP
ATS Status: supported
Clone Status: supported
Zero Status: supported
Delete Status: supported
In 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.
# cd /vmfs/volumes/volume_name
# vmkfstools -y percentage_of_deleted_blocks_to_reclaim
This 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.
To reclaim 60% of deleted blocks on a datastore named Datastore1 in the current directory:
# cd /vmfs/volumes/Datastore1
# vmkfstools -y 60
If 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/EnableBlockDelete
For 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.