Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

Using vmkfstools to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)

Details

vSphere 5.0 introduced the VAAI Thin Provisioning Block Space Reclamation (UNMAP) Primitive. This feature was designed to efficiently reclaim deleted space to meet continuing storage needs. ESXi 5.0 issues UNMAP commands for space reclamation during several operations. However, there was varying or slow response time from storage devices in response to these commands.

Solution

VMware has recommended disabling UNMAP on ESXi 5.x hosts with thin-provisioned LUNs. ESXi500-201112001 and ESXi 5.0 Update 1 disable issuing UNMAP commands by default. If you continue to use an unpatched ESXi 5.0 host, you must manually disable UNMAP on all hosts.

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 naa

Example output:

naa.60a98000572d54724a346a6170627a52
      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.

Using the -y option:

# 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.

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 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.

Feedback

  • 6 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (4000 or fewer characters)
  • 6 Ratings
Actions
KB: