Skip to content
Menu
  • Home
  • vSAN
    • vSAN 7
  • vSphere
    • ESXi
    • vCenter
    • Generic vSphere Commands
  • Cloud Management
    • VCF (VMware Cloud Foundation)
    • vCloud Director
    • vRO
    • Cloud on AWS
    • VMware vRealize Suite Lifecycle Manager – 8.0
    • vRealize Log Insight
    • vRealize Network Insight
    • Hybrid Cloud Extension (HCX)
    • VMware Site Recovery Manager (SRM)
  • NSX
  • Nutanix
  • Power CLI
    • PowerCLI Snippets
  • VMware Horizon
  • Microsoft
    • Azure Cloud
      • Microsoft Azure Cloud and Services
      • Create Azure VMs ( PowerShell )
      • Create Azure VMs (Portal)
  • VOIP
  • Author
  • Contact

Space reclamation of VMFS 5 Datastores by using esxcli

Posted on June 4, 2020

what is VMFS datastore ?

Create VMFS datastore. VMFS datastores are used as repositories for virtual machines’ files. They can be set up on any SCSI-based storage device that the ESXi host discovers, such as Fibre Channel, iSCSI, or local storage devices.

Upgrade VMFS3 Datastore to VMFS5 Datastore | TechCrumble

Space reclamation method

The method can be either priority or fixed. When the method you use is priority, you configure the priority rate. For the fixed method, you must indicate the bandwidth in MB per second.

Space reclamation priority

This parameter defines the rate at which the space reclamation operation is performed when you use the priority reclamation method. Typically, VMFS6 can send the unmap commands either in bursts or sporadically depending on the workload and configuration. For VMFS6, you can specify one of the following options.

It was a bit quiet here in January caused by a new “private project” which has attracted some resources, and will pull more resources in the future.

But this will not stop me from documenting useful stuff. This one is nothing new, but commonly asked by some customers: How do I get my storage capacity back after deleting VMs?!

The outlined steps are all done using esxcli. You need to execute them on a single ESXi host, not on each host in the cluster.

Connect to one of your ESXi hosts using SSH. You can use this small PowerCLI command to enable SSH on a specific host.

Get-VMHost esx1.lab.local | Get-VMHostService | Where Key -EQ “TSM-SSH” | Start-VMHostService

The first step is to identify the datastore(s) from which you want to reclaim storage.

[root@esx1:~] esxcli storage vmfs extent list

Volume Name    VMFS UUID                            Extent Number  Device Name                           Partition

————-  ———————————–  ————-  ————————————  ———

VMDS01         55dc0522-c72eebec-3780-d89d672d7a3c              0  naa.60030d90eca17602ce5c5a54a083e31c          1

We will need the device name, and later the UUID. The next step is to identify if the device is detected as a thin-provisioned disk, and if it is VAAI-capable. I’ve shortened the output of the esxcli output to the necessary output.

[root@esx1:~] esxcli storage core device list -d naa.60030d90eca17602ce5c5a54a083e31c

    Thin Provisioning Status: yes

    VAAI Status: supported

No we have to verify if all necessary VAAI options are supported.

[root@rzb-esx-1:~] esxcli storage core device vaai status get -d naa.60030d90eca17602ce5c5a54a083e31c

naa.60030d90eca17602ce5c5a54a083e31c

    VAAI Plugin Name:

    ATS Status: supported

    Clone Status: supported

    Zero Status: supported

    Delete Status: supported

Important for us is the “Delete” primitive. If this is supported, we can use UNMAP to reclaim storage.

[root@rzb-esx-1:~] esxcli storage vmfs unmap -u 55dc0522-c72eebec-3780-d89d672d7a3c

Note: This process will take some time depending on the amount of storage that has to be reclaimed. And it will put some load on your storage, so you might want to run this in a less productive time.

Thanks hope you like it.

Rajiv Pandey. 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • VRealize Automation 8.2 deployment Step by Step

    VRealize Automation 8.2 deployment Step by Step

  • Desktop Hypervisor

    Desktop Hypervisor

  • How to create Nutanix cluster

    How to create Nutanix cluster

  • How to Generate Data Store Utilization Report Cluster Wise by using Script

    How to Generate Data Store Utilization Report Cluster Wise by using Script

  • vSAN 7 – Native File Services

    vSAN 7 – Native File Services

  • VMware Cloud On AWS (PowerCLI )

    VMware Cloud On AWS (PowerCLI )

  • How to Upgrade VCF (VMware Cloud Foundation)  deployment from 3.5.1 to 3.7

    How to Upgrade VCF (VMware Cloud Foundation) deployment from 3.5.1 to 3.7

  • How to update VCF (VMware Cloud Foundation ) from 3.5 to 3.5.1

    How to update VCF (VMware Cloud Foundation ) from 3.5 to 3.5.1

  • PowerCLI Snippets Tutorial

    PowerCLI Snippets Tutorial

  • Generic vSphere Commands for Troubleshooting .

    Generic vSphere Commands for Troubleshooting .

Search Topic

©2023 | WordPress Theme by Superbthemes.com