Docker Container Integration
1748182 Members
3389 Online
108759 Solutions
New Discussion

esxcli storage vmfs unmap

 
vmw9
Frequent Advisor

esxcli storage vmfs unmap

I am running esxi 6.0 and would like to reclaim some space by running this command on my nimble luns

is there a specific ocmmand I should run as far as the reclaimable units?

esxcli storage vmfs unmap 4000 ?

what number should i use?

1 REPLY 1
barryram121
HPE Blogger

Re: esxcli storage vmfs unmap

ESXi 5.5 and later:

In ESXi 5.5, VMware have simplified the process by not requiring a lookup of the datastore device code, only a datastore name is required. Also, rather than creating a temporary ‘balloon file’ that processes all the requested unmaps in one swing (that can lead to the volume filling up if a too high a percentage is specified), unmaps are issued to the target volume in a steadier fashion.

  1. Connect to the ESXi hosts CLI via SSH. SSH access may need enabling through the vSphere clients security settings.
  2. Obtain the datastore name as shown in the vSphere client that the space discrepancy issue is seen on, and begin the unmap process using the following command:

    # esxcli storage vmfs unmap -l <datastore-name>

OR: If the array is utilizing a large percentage please consider unmaping a small amount of space     in each iteration using the -n flag.

# esxcli storage vmfs unmap -n <amount of blocks> -l <datastore-name>

Example:

# esxcli storage vmfs unmap -n 20 -l datastore1

  • This command will unmap the entire datastore at 20MB per unmap operation, while the script is running.

By default, the space reservation for the temporary files depends on the block size of the underlying VMFS file system (the default is --reclaim-unit=200):   

  • 200 MB for 1 MB block under VMFS3 / VMFS5
  • 800 MB for 4 MB block under VMFS3
  • 1600 MB for 8 MB block under VMFS3