Pre-checks before unmounting an ESXi datastore

Loading

At a high level, we will go through these steps to unmount a datastore from an ESXi host. The procedure extends to cover how to detach a datastore with an extent attached.

  • Step 1 – Evacuate all the VM’s and files
  • Step 2 – Unmount the datastore
  • Step 3 – Detach the LUNs from ESXi host
  • Step 4 – Remove from vCenter inventory
  • Step 5 – Unmap the LUN from Storage Array
  • Step 5 – Rescan the adapters

Pre-unmount checklist

  1. Verify if the datastore has multiple lun extents ( device backing )
  2. Storage vMotion all objects – Virtual machines, snapshots, and templates
  3. Verify all the files under the datastore – sometimes there will be ISO files in there.
  4. Verify if the hosts have a vSAN configuration enabled on them such as ISCSI or NFS vSAN services.
  5. Verify VM Storage policies,if any on the datastore. If so, remove it
  6. Verify if the datastore is part of a vCloud Director configuration and see if there are tags assigned to it
  7. Verify if datastore is part of a journal repository or being used by Zerto/ vRA / SRM etc
  8. Datastore should not be used as a diagnostic coredump partition.
  9. Datastore should not be used for storing ESXi host logs.
  10. Datastore should not be used as scratch partition.
  11. Ensure the datastore is not used for vSphere HA heartbeat.
  12. Ensure the Datastore is not part of a Datastore cluster and not controlled by Storage DRS.
  13. Storage I/O control should be disabled on the datastore.
  14. Verify If the LUN is being used as an RDM, remove the RDM from the virtual machine. Click Edit Settings, highlight the RDM hard disk, and click Remove.
  15. Select delete from disk if it is not selected and click OK. This destroys the mapping file, but not the LUN content.

Procedure to Remove Datastore

In this example, we are attempting to remove a VMFS datastore that has multiple extents on it.

There are several ways to get this info but the easiest and by far the most efficient way to get host connectivity is via the Storage tab. Under Storage View > Select Datastore -> Go to Connectivity and Multipathing which will show all our hosts and the path selection policy applied. Note down the naa id for that datastore and the lun id

Click the arrow shown which will drop the pull list if any extents are present on the datastore. As seen we have an odd extent on this datastore

Select the Device and we can see the NAA ID of the second disk and its lun number

Make a note of the NAA ID, VM ID of the datastore, lun, and put it into an excel format as shown, we are to use this information later in this procedure.

Datastore NameLUN NameLUN IDSizeNAA-IDMount Point
iSCSI-Datastore-2Datastore-211TBnaa.60003ff44dc75adc88991d9b54245476vmfs/volumes/60e5e790-0adcf977-a66f-00505694fdb8/
iSCSI-Datastore-2Datastore-32100Gnaa.60003ff44dc75adc88991d9b54245476vmfs/volumes/60e5e790-0adcf977-a66f-00505694fdb8/

Verify if there are VM’s in the datastore

Verify if there are files in the data store such as ISO’s etc

Remove the datastore from HA configuration

Remove the datastore from VM Storage policies if any

Remove Storage Tags if any

Select the datastore to remove, place the datastore in maintenance mode

If the datastore wasn’t part of multiple extents you could just go directly to an esx host and Detach the lun but in this case, it will fail as you need to detach on a per datastore basis. Lets give that a try

As expected it fails because the other disk is still part of this datastore

Now right-click the datastore to remove, right-click and select Unmount

Confirm Datastore unmount and click on OK.

Monitor the recent tasks and Wait till the VMFS volume shows as Inaccessible

Select the ESXi host-> Configuration-> Storage-> Devices datastore. Right-click the device and Detach.

As seen we can one disk extent will be showing as Not Consumed so we can Detach both the disk now

Click Detach and Select detach from multiple hosts

Repeat the above action for the second disk as well

Lun with device backing/ extent has thus been detached from the esx hosts

On the storage array, unmap the lun from the ESXi hosts. We aren’t covering it here but this is something we will cover in our SAN topics

Once the luns are unmapped from the storage array, rescan the ESXi host adapter and verify detached LUNs no longer appear in vCenter inventory. The easiest way to do this via the Storage Section and Rescan Storage than going individually to hosts and perform an HBA scan

Select both these options

That’s it – Our datastore is thus removed from esx and vCenter inventory

References

https://kb.vmware.com/s/article/2004605

(Visited 684 times, 1 visits today)

By Ash Thomas

Ash Thomas is a seasoned IT professional with extensive experience as a technical expert, complemented by a keen interest in blockchain technology.

Leave a Reply