When attempting to migrate/remove an ESXi host between Datacenters or Clusters within the same vCenter environment, administrators may encounter several blockers:
"The resource '1' is in use" preventing the host from being removed from a Distributed Virtual Switch (DVS).Operation failed!
Task name: Reconfigure vSphere Distributed Switch
cluster-vds01
The resource '1' is in use.Detach" option is greyed out or missing.These blockers are typically caused by:
NOTE: The following steps involve completely removing the host from the vCenter inventory and resetting its configuration. This procedure is not applicable for hosts participating in a vSAN/NSX cluster, as resetting the configuration or removing the host incorrectly can lead to data availability issues or vSAN object errors.
Phase 1: Clear Network Locks
Phase 2: Clear Storage Locks, If datastores remain mounted and the "Detach" option is greyed out:
/etc/init.d/vmware-fdm stop/etc/init.d/storageRM stopesxcli storage vmfs extent list
esxcli storage filesystem unmount -l <Datastore_Label>esxcli storage core device set --state=off -d <NAA_ID>esxcli storage core device detached remove -d <NAA_ID>esxcli storage core adapter rescan --all