The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
Using vmkfstools to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
For this reason, the UNMAP operation is disabled by default in ESXi500-201112001 (ESXi 5.0 Patch 02) and ESXi 5.0 Update 1. This is now a manual process. This means that tasks such as Storage Migration and Snapshot Consolidation do not automatically attempt UNMAP on the back end LUN. If you continue to use an unpatched ESXi 5.0 host, you must manually disable UNMAP on all hosts. For more information, see Disabling VAAI Thin Provisioning Block Space Reclamation (UNMAP) in ESXi 5.0 (2007427).
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. This option also exists on earlier ESXi versions, but does not reclaim the space when run.
Note: When you run
vmkfstools --help, the
-yoption is not displayed in the help output.
In ESXi 5.5,
vmkfstools -yis deprecated and is replaced by the
esxcli storage vmfs unmapcommand. However, issuing UNMAP is still disabled by default and space reclamation can be done manually by running the
esxcli storage vmfs unmapcommand. For more information, see Using esxcli in vSphere 5.5 to reclaim VMFS deleted blocks on thin-provisioned LUNs (2057513).
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.
Confirming if SCSI UNMAP is supported on a LUNTo confirm if SCSI UNMAP is supported on a LUN, open an SSH session to a host and run this command:
# 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 the 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 To use the
vmkfstools -y in vSphere 5.0 U1 or later and vSphere 5.1
vmkfstools,run these commands:
# cd /vmfs/volumes/volume_name
# vmkfstools -y percentage_of_deleted_blocks_to_reclaim
Caution: If a percentage value close or equal to 100 is specified, the temporary balloon file that is created during the reclamation operation might fill up the VMFS volume. Any growth of current VMDK files due to running virtual machines writing to their disks or the creation of new files, such as snapshots, might fail due to unavailable space. Use care when calculating the amount of free space to reclaim.
- 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.
- Calculate reclamation size based upon datastore free space; you cannot reclaim more space than the datastore is able to provide.
- This command creates temporary hidden files at the top level of the datastore with names using the
.vmfsBalloon*pattern (for example,
.vmfsBalloonGdwBBv). These files can be as large as the aggregate size of blocks being reclaimed. If the reclaim operation or storage access is interrupted, these temporary files might not be automatically deleted and you must delete them manually to create free space on the datastore.
To reclaim 60% of the free space on a datastore named
Datastore1in the current directory, run the commands:
# cd /vmfs/volumes/Datastore1
# vmkfstools -y 60
If there is 10 GB of free space on the example VMFS volume
Datastore1, the operation will reclaim 60% of the 10 GB of space; in other words, 6 GB will be reclaimed.
- For more information on enabling/disabling the UNMAP feature, see Disabling VAAI Thin Provisioning Block Space Reclamation (UNMAP) in ESXi 5.0 (2007427).
- For more troubleshooting information, see Thin Provisioning Block Space Reclamation (VAAI UNMAP) does not work (2048466).
- For more information on SCSI UNMAP, see the VMware vSphere Blog post, VAAI Thin Provisioning Block Reclaim/UNMAP In Action.
For translated versions of this article, see:
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.