Esxcli storage vmfs unmap volume label datastorename reclaim unit 200 the above command runs a manual unmap on a datastore after kicking it off i noticed it wasn t completing as fast as i thought it should be.
Esxcli storage vmfs unmap.
Esxi 5 5 automating vmfs unmap w powercli and powershell posted on december 4 2016by brett sinclair with vsphere 6 5 recently released a nice feature was the automated execution of the unmap command against thin provisioned datastores to reclaim space.
They have crawlers that will run unmap to the various datastores intermittently.
It s really that simple.
It will take some time but you should be able to refresh your san periodically to see the available disk space going up.
In vmfs 6 7 all this is done without your participation which can definitely be considered a breakthrough.
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.
Esxcli storage vmfs unmap l datastore00.
Similar to the previous vmkfstools y method the esxcli storage vmfs unmap command creates temporary hidden files at the top level of the datastore but with names using the asyncunmapfile pattern.
The way automatic unmap works is that all esxi 6 5 hosts that see the vmfs 6 datastore participate in the unmap process.
Refreshing the lun information on my netapp san i can see that the free space has now been released and the available size of the lun is 5 22gb.
If you would like to use the uuid run the following where 509a9f1f 4ffb6678 f1db 001ec9ab780e is your datastores uuid.
Specify granularity for the unmap operation.
Also checking on my remote ssh session to the netapp san i can see the used size of the lun is now 30 94mb.
Esxcli storage vmfs unmap l vmware vswap.
The block size on a vmfs datastore defines the maximum file size and the amount of space the file occupies.
I decided to enable ssh on the host and took a look at the var log hostd log file.
They will issue it to the dead space and dead space only.
Unmap granularity equals the block size which is 1 mb.
Vmfs6 supports the block size of 1 mb.
Esxcli storage vmfs unmap null datastorename null before you run this command make sure that you are connected to a vcenter server using the connect viservercommand.
To my surprise it wasn t stopping at a 200 block reclaim it just kept cycling running.
Storage sectors of the size smaller than 1 mb are not reclaimed.