2012 R2 2016 Hyper-V Powershell Quick Tips SCVMM Uncategorized Windows Server

Unable to delete duplicate cluster resource for Hyper-V VM

Quick tip: You find yourself with duplicate HA roles for a virtual machine and you’re unable delete the problematic resource…

Symptoms:

Duplicate cluster roles for a virtual machine.

image

When attempting to delete, you get the error:

Error code: 0x8007012f
The file cannot be opened because it is in the process of being deleted.

image

 

Firstly, why does this happen?

<rant>

This can happen if an admin uses Failover Cluster Manager (even after they’ve been specifically instructed many times not too) to enable HA for a VM, then goes to SCVMM and uses the Migrate Virtual Machine and enable HA. Because SCVMM is not aware that the VM was made HA via FOCM, it tries to access the same resources and thus causes this frustrating issue

If the admin had ‘refresh’ the VM in SCVMM prior then VMM would know that the VM is HA and thus not try to duplicate the HA resource.

This is a classic example of why you NEVER use FOCM for any of your cluster management in an environment managed by SCVMM.

</rant>

 

The fix:

Since you’re already in this pickle, telling you the fix is not to use FOCM isn’t overly helpful.. So the workaround is to log on to one of the hosts, ‘Quick Migrate’ the broken workload to the host you are on and the remove will work

image

I was lucky, as this cluster was a 2012 R2 and we have one node with a GUI purely for the use of FOCM and Shared VHDX management.

For other clusters, I use PowerShell with the Get-Cluster and Get-ClusterResource cmdlets.

 

Hope this helps!
Dan

Leave a Reply