On VMFS datastores that do not support automatic space reclamation, you can use the esxcli command to reclaim unused storage space manually.

In the procedure, --server=server_name specifies the target server. The specified target server prompts you for a user name and password. Other connection options, such as a configuration file or session file, are supported. For a list of connection options, see Getting Started with vSphere Command-Line Interfaces.

Prerequisites

Install vCLI or deploy the vSphere Management Assistant (vMA) virtual machine. See Getting Started with vSphere Command-Line Interfaces. For troubleshooting, run esxcli commands in the ESXi Shell.

Procedure

  1. To reclaim unused storage blocks on the thin-provisioned device, run the following command:

    esxcli --server=server_name storage vmfs unmap

    The command takes these options:

    Option

    Description

    -l|--volume-label=volume_label

    The label of the VMFS volume to unmap. 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. A mandatory argument. If you specify this argument, do not use -l|--volume-label=volume_label.

    -n|--reclaim-unit=number

    Number of VMFS blocks to unmap per iteration. An optional argument. If it is not specified, the command uses the default value of 200.

  2. To verify whether the unmap process has finished, search for unmap in the vmkernel.log file.