PowerFlex: Reclaiming VMFS deleted blocks on Thin Provisioned Volumes
Summary: PowerFlex: How to reclaim deleted blocks on PowerFlex ESXi thin volumes.
Instructions
When a PowerFlex thin volume is being used by an ESXi SDC and it has been used to create a VMFS datastore, when deleting VMs or using vmotion to move the VMs off of the datastore, the blocks will still show in use on the backend (PowerFlex). The ESXi host will be able to still use and overwrite those blocks for future use. Customers may ask why it shows like this. Thin volumes need special intervention to release those blocks to be seen as truly free by the backend storage. ESXi (unlike Linux and Windows) does not automatically use the native SCSI UNMAP commands to reclaim those blocks. It requires admin intervention to reclaim those deleted blocks.
Steps
To verify that the thin volume supports this feature, run this from an ssh session to the ESXi host:
esxcli storage core device vaai status get [-d naa.<dev>|eui.<dev>]
If you are not sure of the naa or eui device number, you can leave those off and it enumerates all the devices this host sees.
Look for the device in question and ensure it states Delete Status: supported. This means that SCSI UNMAP commands are supported on this device.
To reclaim unused storage blocks on a VMFS datastore for a thin-provisioned device, run this command:
esxcli storage vmfs unmap [--volume-label=volume_label|--volume-uuid=volume_uuid] --reclaim-unit=number
The command takes these options:
-l|--volume-label=volume_label
The label of the VMFS volume to UNMAP. This is a mandatory argument. If you specify this argument, do not use -u|--volume-uuid=volume_uuid.
-u|--volume-uuid=volume_uuid
The UUID of the VMFS volume to UNMAP. This is a mandatory argument. If you specify this argument, do not use -l|--volume-label=volume_label.
-n|--reclaim-unit=number
The number of VMFS blocks to UNMAP per iteration. This is an optional argument. If it is not specified, the command uses a default value of 200.
For example, for a VMFS volume named MyDatastore with UUID of 509a9f1f-4ffb6678-f1db-001ec9ab780e, run either of these commands:
esxcli storage vmfs unmap -l MyDatastore
Or
esxcli storage vmfs unmap -u 509a9f1f-4ffb6678-f1db-001ec9ab780e
Related articles:
Additional Information
See VMware article Reclaiming VMFS deleted blocks on Thin Provisioned LUNs