Computer >> Computer tutorials >  >> Software >> Virtual machine

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

Several times I have come across the situation when the NFS datastore on the VMWare ESXi host becomes unavailable / inactive and greyed out in the host’s storage list. However, the NFS storage stays available on the network level. Usually, it can be solved by removing the NFS storage and then adding it back.

However, it happens that when trying to remove such inactive NFS storage from the ESXi host configuration, it returns an error:

The resource datastore_nfs02 is in use.

Call “HostDatastoreSystem.RemoveDatastore” form object “datastoreSystem-28″ on vCenter Server “xxxx” failed.
CannotRemove datastore ‘datastore_name’ because Storage I/O control is enabled on it. Correct it and re-try the operation

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

Based upon the error, the NFS storage cannot be removed due to the Storage I/O control (SIOC) is enabled. If you disable it, another error appears:

Datastore is not accessible

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

Solution

To properly remove the  NFS storage from the VMWare ESXi host, you must directly connect the ESXi host server via SSH (you can enable SSH from vSphere Client).

Display the list of the NFS storages in the system:

esxcli storage nfs list

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

A similar command in ESXi 4.x looks like this:

esxcfg-nas -l

To unmount the NFS storage:

esxcli storage nfs remove –v datastore_nfs02

In ESXi 4.x command is as follows:

esxcfg-nas -d datastore_nfs02

Note. If the name of the NFS storage contains spaces, it has to be enclosed in quotes.

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

If the NFS datastore isn’t removed from the vSphere Client, click the Refresh button in the ESXi storage section (Configuration -> Storage).

How to Remove an Inactive NFS Datastore on VMWare ESXi Host

Note. This has to be done on every ESXi host, where you need to remove the inactive storage.