About ESXcli storage VMFS UNMAP command
Here you will find out:
- what is VMFS UNMAP function
- how does it work
- how DiskInternals can help you
Are you ready? Let's read!
About UNMAP and dead space reclamation
A long-forgotten function called UNMAP, which uses VAAI to restore the virtual machine disk space to the disk array, first debuted in the upgraded versions of VMware vSphere, notably versions 6.5 and 6.7. This feature is comparable to Windows' TRIM command. The manual execution of a number of intricate and perhaps overwhelming commands was necessary in the past for this wonderful feature (even in version 5). Now that this functionality can be managed from the GUI and disk blocks are automatically returned, everything has gotten much simpler.
The dead space reclamation happens not at one but smoothly so there shouldn't happen any issues with the performance. It should be noted that in the case of Snapshot and Storage vMotion the dead space reclamation doesn't perform in automatic mode on the array LUN.
VMware unmap: how it works in VMFS 5 and 6
When erasing information from a VM, the guest OS transmits a VMFS signal in which it offers notification of newly available free space, and subsequently the signal is forwarded to UNMAP. The UNMAP command quickly frees up space in the VMFS data storage, and then the blocks of space are also freed up along the chain.
In VMFS 6.7, all this is done without your participation, which can definitely be considered a breakthrough. There is a VMware SCSI UNMAP function in VMFS 5, but it is not very convenient because practically all commands must be input separately. This is undoubtedly not a problem for administrators with experience, but novices could not fully comprehend what to do.
VMware vSAN and unmap
There is good news: VMware vSAN 6.7 U1 introduces support for automatic space reclamation with SCSI UNMAP support. Here it is also possible to quickly and automatically release and return blocks to storage without entering any commands. VMware vSAN does not require a multiple layers of reclamation, as many are used to because it does not use LUN or VMFS.
About the ESXcli storage VMFS unmap command
To return unused blocks back to the VMFS data storage, you need the main command:
esxcli storage vmfs unmap --volume-label=volume_label|--volume-uuid=volume_uuid --reclaim-unit=number
Note the components of this command:
- 1. -l|--volume-label=volume_label - if this is displayed, the next argument (2) is not worth using.
- 2. -u|--volume-uuid=volume_uuid - in the same way, if applied, the argument above (1) should not be used.
- 3. -n|--reclaim-unit=number - if you don’t specify a specific number, the number will be automatically 200. This number is almost always suitable, but some arrays may have different values.
In case of failure of the UNMAP operation, a temporary file may still exist somewhere in the root of the repository, but if the UNMAP command is successfully completed again, this file will be deleted.
How to perform VMFS Recovery
DiskInternals VMFS Recovery recovers all data (of any type and volume) that can technically be restored in the event of any logical damage to virtual disks. The application provides absolutely every client with 100% free preview of found files and does not oblige you to immediately pay for recovery. A license allows you to export files at a convenient time for you, with possible technical support if necessary. All virtual disks are easily mounted on local drives for easier access to them. You can also return VMDK files stored on disks formatted by the VMware ESX/ESXi server.
DiskInternals VMFS Recovery makes the life of VM and array owners better and easier, so you should have this tool on your desktop!
Good luck, and patience!