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.
Automatic 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.
- I/O performance of other workloads is not impacted by the unmap command.
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.
- 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 reclamation rate in MB per second.
- Space reclamation priority rate
- 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.
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.
Configure Priority Reclamation when Creating a VMFS6 Datastore
Space reclamation settings control how deleted or unmapped blocks are reclaimed on the devices that back the datastore. When you create a VMFS6 datastore in the vSphere Client, the only method for space reclamation you can specify is the priority method. You can also deactivate space reclamation when creating the datastore.
Procedure
Results
After you activate 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.
Configure Fixed Reclamation for the Existing VMFS6 Datastore
To activate the fixed reclamation method, modify the space reclamation settings for the datastore.
Procedure
- In the vSphere Client, navigate to the datastore.
- Select Edit Space Reclamation from the right-click menu.
- Specify the space reclamation setting.
Option Description Enable automatic space reclamation at fixed rate Use the fixed method for space reclamation. Specify reclamation rate in MB per second. Minimum available value is 10 MB per second. Disable automatic space reclamation Deleted or unmapped blocks are not reclaimed. Select this option if you want to deactivate the space reclamation operations for the datastore.
- Click OK to save the new settings.
- Unmount and remount the datastore for the changes to take place.
- Repeat this procedure for all ESXi hosts that access the datastore.
Results
The modified value for the space reclamation priority appears on the General page for the datastore.
Use the ESXCLI Command to Change Space Reclamation on VMFS6
You can change the default space reclamation priority, granularity, and other parameters.
Procedure
Verify Settings for Automatic Space Reclamation on VMFS6
After you configure or edit space reclamation parameters for a VMFS6 datastore, you can review your settings.
Procedure
Results
Example: Obtaining Parameters for VMFS6 Space Reclamation
# esxcli storage vmfs reclaim config get -l my_datastore Reclaim Granularity: 1048576 Bytes Reclaim Priority: low Reclaim Method: priority Reclaim Bandwidth: 26 MB/s Reclaim Maximum Hosts: 128
Manually Reclaim Accumulated Storage Space on VMFS5
On VMFS datastores that do not support automatic space reclamation, such as VMFS5, you can use the esxcli command to reclaim unused storage space manually.
Prerequisites
Install ESXCLI. See Getting Started with ESXCLI. For troubleshooting, run esxcli commands in the ESXi Shell.