Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore

Problem:

How do I enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore

Solution:

This is a solution of the following scenario: data is filled on the datastore and the space used on the VMware datastore matches the space used on the NetApp LUN.  However when items are deleted from the VMware datastore and more space is free this is not reflected on the NetApp LUN.

First identify the datastore with the issue:

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-1

 

On the corresponding LUN run the below command on the NetApp cli to see the status of space reclaim

lun show -vserver crp_svm -volume crp_vol3 -lun crp_vol3 -fields space-allocation

 

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-2

To enable it we will need to take the LUN offline so you will need to shut down or move the VMs to another datastore.  Then run the following:

lun modify -vserver crp_svm -volume crp_vol3 -lun crp_vol3 -state offline

 

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-9

You should see the datastore go offline in VMware

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-4

 

Run the below command to enable space reclaim:

lun modify -vserver crp_svm -volume crp_vol3 -lun crp_vol3 -space-allocation enabled

 

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-7

You can now bring the LUN online again:

lun modify -vserver crp_svm -volume crp_vol3 -lun crp_vol3 -state online

 

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-5a

The last step is to force VMware to map the space used in the datastore with the space used on the LUN.  Open the esxcli and run:

esxcli storage vmfs unmap -l crp_vol3

 

Enable Space Reclaim on a NetApp FAS or AFF LUN to reflect space used in VMware Datastore-6

Leave a Reply

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