Procedure to delete the VMFS datastore to reclaim the space on storage end
search cancel

Procedure to delete the VMFS datastore to reclaim the space on storage end

book

Article ID: 412192

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides a step-by-step procedure to safely delete a VMFS datastore to reclaim space on the storage array. 

Environment

VMware ESXi 7.x

VMware ESXi 8.x

Resolution

Pre-check:

Before proceeding with the deletion, identify the specific storage identifier and verify space reclamation support.
  • Log in to the ESXi host via SSH.
  • Run the command "esxcli storage vmfs extent list". Note down the naa.ID of the datastore to be deleted. 

    Example:
    esxcli storage vmfs extent list
    Volume Name                                 VMFS UUID                            Extent Number  Device Name                           Partition
    ------------------------------------------  -----------------------------------  -------------  ------------------------------------  ---------
    #######################                     ########-########-####-############              0  naa.################################          1

  • Run the command "esxcli storage core device vaai status get -d <naa.ID>" to confirm if SCSI UNMAP is supported on a LUN.

    Example:

    esxcli storage core device vaai status get -d naa.################################

    You see output similar to:

    naa.################################
    VAAI Plugin Name: VMW_VAAIP_NETAPP
    ATS Status: supported
    Clone Status: supported
    Zero Status: supported
    Delete Status: supported

    SCSI UNMAP is not supported on a local datastore if you see a output similar to:

    naa.<ID>
    VAAI Plugin Name:
    ATS Status: unsupported
    Clone Status: unsupported
    Zero Status: unsupported
    Delete Status: unsupported

    For more information refer, Reclaiming VMFS deleted blocks on Thin Provisioned LUNs.

Procedure:

  1. Disable Storage DRS for the datastore. For more information, see Activate and Deactivate Storage DRS.
    1. Browse to the datastore cluster in the vSphere Client.
    2. Click the Configure tab and click Services.
    3. Select Storage DRS and click Edit.
    4. Select Turn OFF vSphere DRS and click OK.
    5. To deactivate only I/O-related functions of Storage DRS, leaving space-related controls activated, perform the following steps.
      1. Under Storage DRS select Edit.
      2. Deselect the Enable I/O metric for Storage DRS check box and click OK.
  2. Disable Storage I/O Control for the datastore. For more information, see Enable Storage I/O Control.
    1. Browse to the datastore in the vSphere Client.
    2. Click the Configure tab.
    3. Click Settings and click General.
    4. Click Edit for Datastore Capabilities.
    5. Remove Check from the Enable Storage I/O Control check box.
    6. Click OK.
  3. Remove or migrate all virtual machines and templates from the datastore.
    Note: Ensure no orphaned virtual machine files, .vmx configurations, or mounted ISO images remain on the volume. Active file handles or locked resources from unregistered VMs can prevent a successful unmount and deletion. Verify that all CD/DVD drives on VMs within the cluster are disconnected or set to Client Device to release potential locks on ISO files stored on the target datastore.
  4. Make sure that the datastore is not used for vSphere HA heart beating. For more information, see Configure Heartbeat Datastores.
    1. In the vSphere Client, browse to the vSphere HA cluster.
    2. Click the Configure tab.
    3. Select vSphere Availability and click Edit.
    4. Click Heartbeat Datastores to display the configuration options for datastore heart beating.
    5. Verify that this datastore is not being used for heart beating or select a new datastore. 
  5. Unmount the datastore from all hosts:
    1. In the vSphere Client, navigate to the datastore.
    2. Right-click the datastore and select Unmount Datastore.
    3. If the datastore is shared, select the hosts from which to unmount the datastore.
    4. Confirm that you want to unmount the datastore.
  6. Remove VMFS Datastores
    1. In the vSphere Client, navigate to the datastore.
    2. Right-click the datastore to remove, and select Delete Datastore.
    3. Confirm that you want to remove the datastore.

Additional Information

To speak with a customer representative or a Support Engineer, see Contact Support. Scroll to the bottom of the page and click on your respective region.