Unable to detach LUNs from the ESXi host
search cancel

Unable to detach LUNs from the ESXi host

book

Article ID: 389186

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:

  • Attempting to detach a LUN from an ESXi host fails. The following error message is displayed:
    An error occurred while communicating with the remote host.



  • The LUN remains attached even after multiple attempts to detach it.

Validation Steps:

  • Ensure that all prerequisites and steps outlined in the article How to detach a LUN device from ESXi hosts have already been performed

  • Verify that the datastore has been successfully unmounted from all ESXi hosts:

    Navigate to vSphere Client → Datastore View.

    Go to Datastore > Configure > Connectivity and Multipathing.

    Confirm that the datastore is no longer connected to any ESXi host.

  • After confirming the datastore is unmounted, attempt to detach the LUN from the ESXi host.

  • If the detach operation fails, the following error is displayed:

    An error occurred while communicating with the remote host.

 

Environment

VMware vSphere ESXi 7.x

VMware vSphere ESXi 8.x

Cause

The ESXi hosts continuously attempts to read the capacity of LUNs that are already disconnected. This causes delays in processing other storage-related commands, leading to timeouts and the error: “An error occurred while communicating with the remote host.”

Cause Validation:

The /var/run/log/vmkernel.log file on the affected ESXi hosts show repeated retry commands (0x25 - READ_CAPACITY) for LUNs that have reported Permanent Device Loss (PDL). 

2025-02-06T15:59:38.1993 cpu0:2098140)WARNING: NMP: nmpCcmpleteRetryForPath: 364: Retry cmd 0x25 (0x45ba5e76a388) to dev "eui.eaa3e8e4a0492fcb6c9ce9005606d6d7" failed on path "vmhba64:C2:TO:L71" H:0x0 D:0x2 P:0x0 Valid sense data: 0x5 0x25 0x0.
2025-02-06T15:59:38.199Z cpu0:2098140)WARNING: NMP: nmp_PathDetermineFailure:3527: Cmd (0x25) PDL error (0x5/0x25/0x0) - path vmhba64:C2:T0:L71 device eui.eaa3e8e4a0492fcb6c9ce9005606d6d7 - triggering path failover
2025-02-06T15:59:38.1993 cpu0:2098140)WARNING: NMP: nmpCompleteRetryForPath:394: Logical device "eui.caa3e8e4a0492fcb6c9ce9005606d6d7": awaiting fast path state update before retrying failed command again ...

The affected device reporting PDL errors is no longer listed under Host > Configure > Storage Devices, confirming that the LUN is already disconnected but still being queried by ESXi.

 

Resolution

Reboot the affected ESXi hosts to clear the PDL (Permanent Device Loss) errors. After the reboot, attempt to detach the LUN from the ESXi host again and this time it should be successful.

Rebooting the ESXi host clears the PDL state and stops continuous retry attempts for READ_CAPACITY commands. This prevents storage command delays and timeouts, allowing the LUN to be successfully detached.