Skip to main content

Space reclamation of VMFS 5 Datastores using esxcli





Space reclamation of VMFS 5 Datastores using esxcli
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


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.

Comments

Popular posts from this blog

Dell EMC VxRail – VMware Virtual SAN Stretched Cluster

Logical Diagram of VMware vSAN Stretched Cluster Physical Diagram of VMware vSAN Stretched Cluster Last week I deployed a test environment of VMware vSAN Stretched Cluster which is running on Dell EMC VxRail Appliance. In this post we will describe how to setup VMware vSAN Stretched Cluster on Dell EMC VxRail Appliance. Above figure is the high level of physical system diagram. In site A/B there are six VxRail Appliances and two 10GB Network Switch which are interconnected by two 10GB links, and each VxRail Appliance has one 10GB uplink connects to each Network Switch. In site C, there are one vSAN Witness host and one 10GB Network Switch. For the details of configuration of each hardware equipment in this environment, you can reference the followings. Site A (Preferred Site) 3 x VxRail E460 Appliance Each node includes 1 x SSD and 3 x SAS HDD, 2 x 10GB SFP+ ports 1 x 10GB Network switch Site B (Secondary Site) 3 x VxRail E460 Appliance Each node includes 1 x SSD and...

VxRail 4.0 – Scale Out

The above is the physical diagram of VxRail Cluster (3 nodes). In this post I will show how to add one VxRail Appliance into this VxRail Cluster (From 3 nodes to 4 nodes). NOTE: The model of each VxRail Appliance is E460. Before the node expansion, you need to verify each Appliance is running in health in dashboard of VxRail Manager. The above is the final physical diagram of VxRail Cluster after scale out. Now we start the node expansion. You have just mounted a new VxRail Appliance (E460) and cabled it up to the top of each rack switch. When you power it on you can see a notification appear in the top left corner of VxRail dashboard. Click “ Add Node “. When you initially configured your VxRail Appliance, you specified an IP pool for ESXi, vMotion and vSAN. You can see that there available IP addresses in these pools, so the only additional action is to set an ESXi password. Click the scroll bar, then click the “ ESXi Password “. Enter the  ESXi  and ...

UEFI Secure Boot with ESXi 6.5

UEFI Secure Boot: UEFI, or Unified Extensible Firmware Interface, is a replacement for the traditional BIOS firmware. In UEFI, Secure Boot is a “protocol” of the UEFI firmware. UEFI Secure boot ensures that the boot loaders are not compromised by validating their digital signature against a digital certificate in the firmware. UEFI can store whitelisted digital certificates in a signature database (DB). There is also a blacklist of forbidden certificates (DBX), a Key Exchange Keys (KEK) database and a platform key. These digital certificates are used by the UEFI firmware to validate the boot loader.  Boot loaders are typically cryptographically signed and their digital signature chains to the certificate in the firmware.The default digital certificate in almost every implementation of UEFI firmware is a x509 Microsoft UEFI Public CA cert. Most of the UEFI implementations also allows the installation of additional certificate in the UEFI firmware and UE...