At one of my clients, I recently came across a datastore that we were unable to delete. We are in the process of migrating from an EMC VNX to a new EMC Unity SAN. Part of this process requires us to clean up the legacy datastores. Unfortunately, this isn’t a small environment and the datastores span across approximately 30+ hosts. Some quick things to check are HA and even VDS configs. In my case, I’ve reviewed everything and the datastore had absolutely nothing on it but the sdd.sf folder which stands for – SCSI device Description system file. This usually can’t be deleted and should’t be an issue. Below, I’ll walk you through a method that I used to delete the datastore. This method should be used as LAST resort as it involved deleting the partition table. You must verify that you have the correct datastore!

Error:

A screenshot of the datastore:

As you can see, there’s nothing on it.. Now let’s prepare to delete it.

1. Locate the datatore device name. You can do this by right clicking the datastore and selecting properties. On the left side there’s a section called ‘Extent’ — Copy that out to notepad.

2. SSH into a host that has the datastore presented.

3. Now that we have our datastore device ID, we will continue to verify we have the correct datastore by running the following (remember to replace naa. with your own device ID) :

6. *Please proceed with caution. This last command will destroy all data on the datastore* The last command we will run removes the only partition. This allows us to right click the datastore and delete it without an error.

7. After deleting the partition table and also completing the removal of the datastore from vCenter, we will now detach the device from each host. This method is preferred when troubleshooting a “datastore is in use” removal. Performing a detach of the device from the host precautions against “paths down” or other storage related events that could cause hosts to become unstable.

8. With an SSH connection to a host, run the following command to retrieve the LUN ID of the device: