The steps are the following:
1. Shared two NFS v3 mountpoint from a NAS. In my test the NFS server with IP 172.16.254.2 has two NFS exports called /hybrid/datastores/ds-1 and ds-2. I tested that I can create NFS datastores and create VMs on top of both, and then unmount (delete) both NFS shares from ESXi in preparation for the next steps. I did this to eliminate any connectivity or permissions issues.
2. Mounted the first NFS export as a datastore with the name 'ds-1'
All works as expected until here.
3. Renamed the datastore from 'ds-1' to 'ds-1-x'
All works as expected until here.
4. Attempt to mount the second exported NFS mountpoint as 'ds-1'.
This operations fails with message: Failed to mount NFS datastore ds-1 - Operation failed, diagnostics report: Unable to get console path for mount. After the error message, the datastore 'ds-1-x' becomes not available:
a) The Web UI does not show the datastore as being present (disappears from the list)
b) In /etc/vmware/esx.conf the datastore is present:
/nas/ds-1-x/host = "172.16.254.2"
/nas/ds-1-x/enabled = "true"
/nas/ds-1-x/readOnly = "false"
/nas/ds-1-x/share = "/hybrid/datastores/ds-1"
/nas/ds-1-x/isPE = "false"
c) esxcfg-nas shows datastore as "mounted available", but cannot open the volume
esxcfg-nas -l
VmFileSystem: SlowRefresh() failed: Cannot open volume: /vmfs/volumes/8dc278e8-c3a7351a
ds-1-x is /hybrid/datastores/ds-1 from 172.16.254.2 mounted available
d) esxcli storage filesystem list crashes and no longer shows the rest of the local datastores (like datastore1 or vfat filesystems):
esxcli storage filesystem list
Error getting data for filesystem on '/vmfs/volumes/8dc278e8-c3a7351a': Cannot open volume: /vmfs/volumes/8dc278e8-c3a7351a, skipping.
e) esxcli storage nfs list is blissfully unaware of any problem:
esxcli storage nfs list
Volume Name Host Share Accessible Mounted Read-Only isPE Hardware Acceleration
----------- ------------ ----------------------- ---------- ------- --------- ----- ---------------------
ds-1-x 172.16.254.2 /hybrid/datastores/ds-1 true true false false Not Supported
Things we tried:
1. Reboot between steps 3 and 4 will result in the expected behavior ('ds-1' will be mounted correctly, and 'ds-1-x' will remain mounted)
2. Restarting hostd or services.sh restart did not solve the issue (i.e. it behaved as described above, without the reboot).
I need a way to safely rename a datastores, such that in the future mounting a datastore with the original datastore name will not result in an unmounted datastore.