Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

April 21, 2023 VMWare

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 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; read more in the post – ESXi system logs are stored on non-persistent storage);

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
5
Facebook Twitter Google + Pinterest
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

Reset Root Password in VMware ESXi

October 12, 2023

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

July 14, 2023

How to Increase Virtual Machine Disk Size in...

April 6, 2023

How to Install Free VMware Hypervisor (ESXi)

January 24, 2023

Using VMware Converter for P2V Migration (Physical to...

October 19, 2022

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

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

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
  • Using iPerf to Test Network Speed and Bandwidth
  • Windows Cannot Find the Microsoft Software License Terms
  • Updating VMware ESXi Host from the Command Line
Footer Logo

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


Back To Top