The Problem: Datastore Connectivity Lost
An ESXi host may lose connection to one or more datastores for several reasons:
- Network Configuration Issues (for NFS/iSCSI): Incorrect IP settings or firewalls.
- Storage Array Failures: Issues with the backend SAN or NAS hardware.
- Pathing Problems: Multipath configuration errors or a single-path failure.
- Corrupted Filesystem: Datastore metadata issues on the storage device.
How to Troubleshoot and Resolve
- Verify the Storage Status in vSphere
- Navigate to Storage > Datastores in vSphere Client.
- Check if the affected datastore is listed and its status (e.g., Inactive or Not Connected).
- Validate Physical Connections
- For iSCSI or NFS datastores:
- Ensure the host’s VMkernel NICs are online and configured with the correct IP.
- Test network connectivity to the storage target using ping or vmkping:
vmkping <storage-IP>
- For SAN-based datastores:
- Inspect HBA (Host Bus Adapter) connections and verify the fiber cables or SFPs.
- Rescan Storage Adapters
- Perform a manual rescan to detect any lost paths or devices:
- Go to Host > Storage Adapters > Rescan All in the vSphere Client.
- Alternatively, use SSH:
esxcli storage core adapter rescan –all
- Check Multipath Configuration
Use the command:
esxcli storage nmp device list
Look for any inactive paths and troubleshoot based on the path state.
For active-active arrays, ensure the correct Path Selection Policy (PSP) is set (e.g., Round Robin).
- Validate Storage Array Health
Log in to the storage array management interface to check for:
Controller failures.
Degraded or offline LUNs/volumes.
Restart the affected LUN if needed, ensuring no other hosts are dependent on it.
- Recreate the Datastore Mount (NFS/iSCSI)
If the datastore remains inaccessible:
Unmount the datastore from the ESXi host.
Recreate the connection by adding the NFS or iSCSI target:
esxcli storage nfs add –host=<server-IP> –share=<nfs-path> –volume-name=<name>
Repair Filesystem Corruption (VMFS)
- Use VMware’s built-in recovery tools to fix VMFS issues:
vmkfstools -R /vmfs/devices/disks/<datastore-ID>