VMFS Datastore UNMAP using vCenter Orchestrator

Automate All the Things

If you are using thin provisioned block volumes for your VMware vSphere VMFS datastores you will certainly benefit from this new vCenter Orchestrator workflow I created.

VMware introduced VAAI UNMAP capability in vSphere 5.0, and since vSphere 5.0 update 1 UNMAP has been on-demand operation which requires use of CLI on VMware ESXi host. With my Thin-volume UNMAP vCO workflow you can execute VAAI UNMAP using wither vCenter Orchestrator GUI, vSphere Web Client or have it scheduled on vCO to be executed at specified intervals.

This workflow uses SSH to run esxcli storage vmfs unmap on target ESXi host, please make note that this command is only available on ESXi 5.5, so ESXi 5.0 or 5.1 are not supported by this workflow!

Important update on 1st of September!

Please see this VMware KB first if you intent to implement this workflow!

This workflow uses default values for esxcli storage vmfs unmap so you should be safe, but it is always recommended to install latest patches.


  • ESXi 5.5 host fails with a purple diagnostic screen when performing a storage space reclamation
  • When you run the esxcli storage vmfs unmap command for storage space reclamation, the ESXi 5.5.x fails with a purple diagnostic screen.


This issue occurs when a space reclamation is performed on a LUN larger than 2 TB and the Block value is changed from the default value of 200 blocks per iteration.


This issue is resolved in ESX 5.5 P03 release, available at VMware Downloads.
For more information about this version, see the ESXi 5.5 P03 Release Notes.

Workflow logic

  1. Workflow checks SSH service status on target ESXi host, if SSH service is stopped workflow starts it and saves SSH service run status for later use.
  2. Workflow requests UUIDs of remote VMFS datastores present on target ESXi host, all remote datastores are returned regardless if they support VAAI UNMAP or not.
  3. Workflow uses SSH to log in ESXi host CLI and executes “esxcli storage vmfs unmap –u” for each UUID returned by previous step. If target datastore does not support VAAI UNMAP error is logged and workflow proceeds to next datastore.
  4. At workflow end, SSH service is stopped on target ESXi host if it was started by workflow.


Thin-volume UNMAP vCenter Orchestrator workflow schema
Thin-volume UNMAP workflow schema

Input parameters

  • ESXi host
    • Target ESXi host on which VAAI UNMAP operation will be ran, may be any host of a cluster with access to all datastores
  • Use password auth instead of key auth?
    • Yes will use password authentication for SSH, No will use public/private key authentication for SSH
  • Username for SSH login
    • Username used for ESXi host SSH login
  • Password for SSH login
    • Password used for ESXi host SSH login
  • SSH private key path
    • Key path for key private/public key authentication
  • SSH private key passphrase
    • Optional passphrase for private key

You can use username and password for authentication to target ESXi host

Thin-volume UNMAP input parameters with password login
Thin-volume UNMAP input parameters with password login

or you can use public/private key pair for authentication

Thin-volume UNMAP input parameters with key login
Thin-volume UNMAP input parameters with key login


If you use vCenter Orchestrator version 5.5.1 and you wish to schedule workflow to run reputedly at specific times, make sure that you install VCO hot-fix described in this article.

Known behavior and caveats

  • Only VMware ESXi 5.5 and newer are supported.
  • Workflow has been tested only on vCenter Orchestrator Appliance.
  • vCenter Orchestrator must have SSH connectivity to target ESXi host (TCP port 22).
  • If there is a firewall between vCO host and ESXi, make sure that firewall won’t close lingering SSH connections during long UNMAP operations (increase TCP session timeout to 1 hour or more).
  • “esxcli storage vmfs unmap” may be executed against a datastore without VAAI UNMAP support, in this case error is logged within vCenter Orchestrator and next datastore is selected for processing.

Workflow package download

2 Replies to “VMFS Datastore UNMAP using vCenter Orchestrator”

Leave a Reply