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.
- 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.
- 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. ESXi supports automatic unmap processing on arrays with the recommended unmap granularity of 1 MB or greater, for example 16 MB,. 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 KB, 64 KB, and so on.
- Space reclamation method
- The method can be either priority or fixed. When the method you use is priority, you configure the priority rate. For the fixed method, you must indicate the bandwidth in MB per second.
- Space reclamation priority
- This parameter defines the rate at which the space reclamation operation is performed when you use the priority reclamation method. Typically, VMFS6 can send the unmap commands either in bursts or sporadically depending on the workload and configuration. For VMFS6, you can specify one of the following options.
Space Reclamation Priority Description Configuration None Disables the unmap operations for the datastore. vSphere Client
Low (default) Sends the unmap command at a less frequent rate, 25–50 MB per second. vSphere Client
Medium Sends the command at a rate twice faster than the low rate, 50–100 MB per second. esxcli command High Sends the command at a rate three times faster than the low rate, over 100 MB per second. esxcli commandNote: The ESXi host of version 6.5 does not recognize the medium and high priority rates. If you migrate the VMs to the host version 6.5, the rate defaults to low.
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, be aware that it might send many unmap requests at a time. This action can lock some of the resources during the operation.