3

I followed this vmware guide to remove a storage device and replace with another. Everything worked fine apart from the fact the the datastore still show on the list as inactive. During the procedure I'm supposed to:

  1. unmount the datastore
  2. detach storage device
  3. make sure it detached with esxcli storage core device detached list
  4. permanently remove device config with esxcli storage core device detached remove -d naa.xxxx

I had another one to remove and managed to figure out how to do it correctly by adding another step after 2

2.1 Click inactive datastore -> Actions -> Delete Datastore

Then continue

Does anybody know how to remove this inactive ghost datastore? I actually want to use the same name for the new datastore so can't really turn my blind eye on it.

Any help would be greatly appreciated.

Bart C
  • 201
  • 1
  • 2
  • 7

3 Answers3

0

I just had exactly the same problem. Check if you have VM snapshots.

# list snapshots
get-vm -datastore <dsname> |get-snapshot |select VM,name,created

If the VMs were connected to the datastore when the snapshot was made the VM will be connected to it until you remove the snapshot.

#remove all snapshots
get-vm -datastore <dsname> |get-snapshot |remove-snapshot
Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
  • Hi Gerald, I don't have any snapshots, no related objects, I cleaned up everything and it's still not going away. – Bart C Jan 09 '17 at 13:16
0

I had an issue once with an inaccessible NFS datastore. Command type used: esxcli storage nfs remove -v vol_nfsvol1 where nfsvol1 was the name of the storage.

Ref: https://kb.vmware.com/s/article/2008507

Also look on the individual hosts and see if the data store is mounted. It may be a single file locked to a host causing this.

0

I missed steps to remove a datastore.

In vCenter.

  1. Moved all Vm to another datastore.
  2. [missed Step] Move/delete template.
  3. Unmounted datastore.
  4. [missed step] delete datastore.
  5. Detached LUn from each ESXi.
  6. Unpresented from Storage.

In an attempt to delete the datastore, I tried these steps. In vCenter.

  1. Delete from inventory the missed out template.
  2. Presented back to ESXi with the same LUN number.
  3. Reattached to each ESXi.
  4. failed to delete datastore.

I logged a case with VMware and they helped me by executing these commands in each of the affected ESXi host.

  1. esxcli storage vmfs extent list | grep [datastore]
  2. esxcli storage core device detached list
  3. esxcli storage filesystem unmount -l [datastore]
  4. esxcli storage core device set --state=off -d naa.[datastore id]
  5. partedUtil getptbl /vmfs/devices/disks/naa.[datastore id]
  6. Rescan device at Vcenter - Choose the cluster, Action - Storage - Rescan Storage
  7. Unpresent from storage.
Nash A
  • 1
  • 1