Deleting or removing files from a VMFS datastore frees space within the file system. This free space is mapped to a storage device until the file system releases or unmaps it. ESXi supports reclamation of free space, which is also called the unmap operation.
The operation helps the storage array to reclaim unused free space. Unmapped space can be then used for other storage allocation requests and needs.
Asynchronous Reclamation of Free Space on VMFS6 Datastore
On VMFS6 datastores, ESXi supports the automatic asynchronous reclamation of free space. VMFS6 can run the unmap command to release free storage space in the background on thin-provisioned storage arrays that support unmap operations.
Asynchronous unmap processing has several advantages:
Unmap requests are sent at a constant rate, which helps to avoid any instant load on the backing array.
Freed regions are batched and unmapped together.
Unmap processing and truncate I/O paths are disconnected, so I/O performance is not impacted.
For VMFS6 datastores, you can configure the following space reclamation parameters at datastore creation time.
Space reclamation granularity
Granularity defines the minimum size of a released space sector that underlying storage can reclaim. Storage cannot reclaim those sectors that are smaller in size than the specified granularity.
For VMFS6, reclamation granularity equals the block size. When you specify the block size as 1 MB, the granularity is also 1 MB. Storage sectors of the size smaller than 1 MB are not reclaimed.Note:
Certain storage arrays recommend an optimal unmap granularity. If the recommended unmap granularity is greater than 1 MB, for example 16 MB, ESXi does not support automatic unmap processing on these arrays. On the arrays with the optimal granularity of 1 MB and less, the unmap operation is supported if the granularity is a factor of 1 MB. For example, 1 MB is divisible by 512 bytes, 4 K, 64 K, and so on.
Space reclamation priority
This parameter defines the rate at which the space reclamation operation is performed. Typically, VMFS6 can send the unmap commands either in bursts or sporadically depending on the workload and configuration. When you create a VMFS6 datastore, you can specify one of the following options.
None. Disables the unmap operations for the datastore. The option is configurable through the vSphere Web Client.
Low (default). Sends the unmap command at a less frequent rate. The option is configurable through the vSphere Web Client.
After you enable space reclamation, the VMFS6 datastore can start releasing the blocks of unused space only when it has at least one open file. This condition can be fulfilled when, for example, you power on one of the VMs on the datastore.
Manual Reclamation of Free Space on VMFS5 Datastore
VMFS5 and earlier file systems do not unmap free space automatically, but you can use the esxcli storage vmfs unmap command to reclaim space manually. When you use the command, keep in mind that it might send many unmap requests at a time. This action can lock some of the resources during the operation.