Troubleshooting: DR operation failure with error message cannot change host configuration at VMware detach disk(s) subtask
This scenario is applicable when you recover from an on-premises VMware data center to an on-premises VMware recovery data center using any 3rd party replication technology.
Any disaster recovery (DR) operation such as migrate, take over, or resync fails during the Detach disk sub task with the following error:
Cannot change host configuration
The ESXi host maintains the state information of all detached LUNs in a list or cache. This list has a size limit. When the list reaches its size limit, then at the time of detach disk task the error is displayed.
To resolve this error, you need to remove some of the entries in the list. Use one of the following commands to remove the entries.
To remove all state information data of detach disks from the list, use the following command:
esxcli storage core device detached remove -all
To remove the state information of a single detached disk, use the following command:
esxcli storage core device detached remove -d <lun_name> where <lun_name> is the name of the LUN such as naa.60002ac00000000000014bd90001d094.
To remove the state information of multiple disks that are detached during a certain time period, use the following command:
esxcli storage core device purge -i <interval_in_days>