Esxcli Storage Vmfs Unmap
Unmap granularity equals the block size which is 1 mb.
Esxcli storage vmfs unmap. To my surprise it wasn t stopping at a 200 block reclaim it just kept cycling running. 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. Specify granularity for the unmap operation. 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.
Esxcli storage vmfs unmap l vmware vswap. Vmfs6 supports the block size of 1 mb. Esxcli storage vmfs unmap l datastore00. Storage sectors of the size smaller than 1 mb are not reclaimed.
Select one of the. Esxcli storage vmfs unmap u 509a9f1f 4ffb6678 f1db 001ec9ab780e. 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. I decided to enable ssh on the host and took a look at the var log hostd log file.
Monitoring vaai unmap commands via esxtop can be done by establishing a remote ssh. 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. 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. They have crawlers that will run unmap to the various datastores intermittently.
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. Also checking on my remote ssh session to the netapp san i can see the used size of the lun is now 30 94mb. The way automatic unmap works is that all esxi 6 5 hosts that see the vmfs 6 datastore participate in the unmap process. They will issue it to the dead space and dead space only.
It will take some time but you should be able to refresh your san periodically to see the available disk space going up. It s really that simple.