Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Virtualization / VMware / Unmounting an NFS Datastore from VMware ESXi

March 12, 2024

Unmounting an NFS Datastore from VMware ESXi

NFS storage can be used in VMware infrastructure to store virtual machine files, disk images, and other files. In this post, we’ll look at how to unmount an NFS datastore from VMware ESXi and what to do if an error occurs when you try to unmount an NFS share or if the NFS storage becomes inactive.

Contents:
  • How to Properly Remove/Unmount NFS Storage on VMware?
  • Removing an Inactive NFS Datastore on VMware ESXi Host

How to Properly Remove/Unmount NFS Storage on VMware?

To unmount an NFS storage on an ESXi host, simply right-click it in the vSphere Client console and select Unmount Datastore. A list of ESXi hosts on which this NFS share is mounted appears in the list.

You must unmount NFS storage on all ESXi hosts to make it disappear in the vSphere interface.

unmount nfs datastore on vmware esxi

An ESXi host can unmount NFS storage if:

  • There are no running or registered virtual machines on the NFS volume. You need to shut down the VMs or move them to another datastore using the Storage vMotion;
  • There are no snapshots, ISO images, or virtual disks (VMDK) on the datastore that are mounted in other VMs;
  • The datastore is not managed by Storage DRS and is s not part of a datastore cluster;
  • vSphere HA heartbeat does not use storage;
  • Storage I/O control for the datastore is disabled;
  • In the advanced system settings of the ESXi host, verify that the NFS datastore is not being used to store log or swap files (check the global.logDir and ScratchConfig.CurrentScratchLocation options under Configure -> Advanced system settings -> Edit;

An error will occur when unmounting the NFS storage if one of these conditions is not met:

The "remove datastore" operation failed.
The resource 'nfs_datastore' is in use.
Learn more about the error ‘The resource is in use’ when the datastore is removed in ESXi.

Or:

Cannot remove datastore 'nfs_datastore' because system swap is enabled on it.

Removing an Inactive NFS Datastore on VMware ESXi Host

If the NFS share was disabled on the NFS server side before it was unmounted on ESXi, or if there are still VMs running on the NFS volume, an error occurs when you try to unmount the NFS datastore from the vSphere Client interface:

Error performing operation:
NFS Error: Unable to Unmount filesystem: Busy

Or:

The object ‘vim.Datastore:ds:///vmfs/volumes/NFS_Store1/’ has already been deleted or has not been completely created

inactive nfs datastore on esxi host

Check that the ESXi firewall rules that allow access to the NFS share on the default port TCP/2049 are enabled.:

$ esxcli network firewall ruleset set --ruleset-id nfs41Client --enabled=true
$ esxcli network firewall ruleset set --ruleset-id nfsClient --enabled=true

If the NFS storage is not available, it becomes inactive (greyed out) in the host’s storage list in the vSphere interface. In my case, an error occurred when I tried to remove an inactive NFS volume from the ESXi host configuration:

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.

Based on the error, the NFS storage cannot be removed due to the Storage I/O control (SIOC) is enabled. Another error occurs when disabling Storage I/O Control for a datastore:

Datastore is not accessible

vmware: disable storage io control

Solution:

In order to properly remove the inactive NFS storage from the ESXi host, you will need to connect to the console of the ESXi host server using SSH (How to enable SSH on VMware ESXi).

View the list of the NFS volumes available on the VMware ESXi host:
# esxcli storage nfs list
esxcli: list nfs storage

If required, you can view detailed information about the NFS storage:

# vim-cmd hostsvc/datastore/info datastore_nfs02

To unmount the NFS volume from the ESXi host, run the command:

# esxcli storage nfs remove –v datastore_nfs02

Note. You must enclose the NFS datastore name in quotation marks if it contains spaces.

remove NFS datastore

Note. This action must be performed on each ESXi host where you want to delete an inactive NFS share.

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

1 comment
6
Facebook Twitter Google + Pinterest
VMware
previous post
How to Integrate Security Updates into Windows Image (ISO/WIM)
next post
Configure Windows LAPS (Local Administrator Passwords Solution) in AD

Related Reading

How to Fix ‘An Operating System Wasn’t Found’...

August 24, 2023

Adding Drivers into VMWare ESXi Installation Image

March 13, 2024

How to Install Free VMware Hypervisor (ESXi)

March 17, 2024

Reset Root Password in VMware ESXi

October 6, 2023

Adding ESXi Host to VMware vCenter Server (vCSA)

March 12, 2024

Using iPerf to Test Network Speed and Bandwidth

March 12, 2024

How to Access VMFS Datastore from Linux, Windows,...

March 11, 2024

VMWare: Virtual Machine Disks Consolidation is Needed

March 12, 2024

1 comment

sav1 August 7, 2015 - 6:38 am

In my case the NFS storage was bisy with one of VM. Via thick vSphere Client I so it in Inventory “Datastores and Datastore Clusters” at “Virtual Machines” tab. Although there was no devices placed there at that moment and in fact of that the VM’s properties didnt content storage in storage list. But earlier there was mounted a CDROM to iso file at (i used this storage for delploy ), and there was a snapshot (i dont use snapshots in my work, but it was autogenerated with clone operation and in unknown reason didnt removed automaticaly). Then I deleted snapshot and occured VM covered from earlier tab, and then I abled to unmount storage.
Clearly, in except of using so hard manipulations (and in commonly, not preferable), in first step we should release storage from any obvious relations.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Adding Drivers into VMWare ESXi Installation Image
  • How to Fix ‘An Operating System Wasn’t Found’ Error on Windows
  • How to Access VMFS Datastore from Linux, Windows, or ESXi
  • Recovering a Deleted VMFS Datastore on VMware ESXi/vSphere
  • Updating VMware ESXi Host from the Command Line (ESXCLI)
  • Using iPerf to Test Network Speed and Bandwidth
  • Windows Cannot Find the Microsoft Software License Terms
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top