I want to delete the role (virtual machine) of the failover cluster, but I can't.

福本 大志 20 Reputation points
2026-04-03T05:37:01.5+00:00

An inconsistency occurs between the failover cluster and Hyper-V regarding roles (virtual machines), and the status of the target machine cannot be updated on the Failover Cluster Manager.

Tried to delete the role (virtual machine), but cannot.

Error code '0x2' 'The specified file cannot be found'

Cannot remove it even with a PowerShell command.

I want to forcibly delete the role (virtual machine) that remains as garbage in the role (virtual machine), so please tell me how to do it.

Windows for business | Windows Server | Storage high availability | Virtualization and Hyper-V
0 comments No comments

Answer accepted by question author

Chen Tran 12,750 Reputation points Independent Advisor
2026-04-03T07:05:31.7+00:00

Hello,

Thank you for posting question on Microsoft Windows Forum!

Based on the issue description as well as the provided error code 0x2 which indicates "The specified file cannot be found". Because the cluster manager is looking for the configuration file to clean it up, but since it is already gone, it throws its hands up and refuses to do anything.

The suggestion here is to create dummy file. You can first check the properties of the stuck VM in Failover Cluster Manager to see what folder path it is expecting. This is usually on a Cluster Shared Volume (something like C:\ClusterStorage\Volume1\YourVMName). Navigate to that folder path. If the folder does not exist anymore, recreate it. Inside that folder, create a blank text file and rename it to have the exact name and file extension of the configuration file the cluster is missing (usually .xml on older servers or .vmcx on newer ones). Once that dummy file is in place, go back to Failover Cluster Manager, right-click the role, and try to delete it.

Another point worth mentioning here is that if the cluster refuses to let go of the role because it is locked in an "OnlinePending" or "Deleting" state, restarting the host services might clear the lock. Look in Failover Cluster Manager to see which node is the current Owner Node of that stuck VM role. Log into that specific node and open PowerShell as Administrator. You can consider to restart the Hyper-V Virtual Machine Management service and the Cluster service.

Please note: Restarting these services will temporarily lose management connection for minutes. If you want to be extra safe, live-migrate your active VMs off that node first.

You can consult the following articles for more information regarding your concerns.

Hope the above information is helpful! If it is. Free feel to hit "Accepted" for benefitting others in community having the same issue too.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-04-03T05:37:13.7533333+00:00

    Use Failover Cluster Manager and the FailoverClusters PowerShell module to clean up the orphaned clustered VM role and resynchronize cluster metadata.

    1. Use Failover Cluster Manager for VM operations
      • Open Failover Cluster Manager on a cluster node.
      • Under Roles, locate the problematic virtual machine role.
      • If it still shows but operations fail with 0x2 (file not found), do not try to manage it from Hyper‑V Manager; use only Failover Cluster Manager for this clustered VM, as recommended.
    2. Force-remove the clustered VM role with PowerShell
      • Open an elevated PowerShell session on a cluster node.
      • List cluster resources and roles to identify the exact name:
             Get-ClusterGroup
             Get-ClusterResource
        
      • Attempt to take the role offline, then remove it:
             Stop-ClusterGroup -Name "<ClusteredVMRoleName>" -Force
             Remove-ClusterGroup -Name "<ClusteredVMRoleName>" -Force
        
      • If individual resources remain, remove them directly:
             Remove-ClusterResource -Name "<ResourceName>" -Force
        
    3. Resynchronize cluster metadata using live migration
      • For other healthy clustered VMs, perform a Live Migration between nodes from Failover Cluster Manager.
      • This forces metadata synchronization and can clear residual warnings or stale entries related to VM roles.
    4. Recreate the clustered VM role if needed
      • If the VM still exists and only the cluster role was corrupted, re-add it as a clustered VM role after cleanup:
             Add-ClusterVirtualMachineRole -VirtualMachine "<VMName>"
        
      • Ensure the VM’s VHD/VHDX files are on clustered storage used by the cluster role.
    5. Validate cluster health
      • After cleanup, run cluster validation to ensure there are no remaining configuration issues:
             Test-Cluster
        
      • Resolve any reported issues before creating or moving additional clustered VMs.

    If the VM’s configuration files (.vmcx, .vmrs, .vhdx, .avhdx) are missing or corrupted on disk, rebuild or restore the VM in Hyper‑V Manager after the cluster role has been removed, then add it back to the cluster as needed.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.