Today I run in to the problem where I could not remove a Hyper-V Hosts from System Center Virtual Machine Manager. The Hyper-V host was reinstalled before he was removed from SCVMM and the host was showing has HOSTNAME (pending) in the SCVMM Management Console. If you did a right click to remove the host, the Remove option was greyed out.
But don’t worry Windows PowerShell came to the rescue, with the following command you can remove the Hyper-V host from Virtual Machine Manager.
Get-SCVMHost <HOSTNAME> | Remove-SCVMHost -force
I wish it was as simple when it comes to removing a vCenter server that no longer exists.
I never had problems, do you have any issues?
When I ran the get host I get an error “no such host is known”. I evicted the node from the cluster but I am unable to remove it from VMM 2012. The host just has a pending status.
Well I had another scenario where I could only remove the Hyper-V Server in the SCVMM DB directly. I would recommend calling Microsoft support for this :)
Any news on that? We have also the need to directly remove a Hyper-V Server in the SCVMM 2012 SP1 UR3 database. Did you get a how to for removing the Hyper-V Server?
I think I found a solution for your problem.
Open the Powershell Command Promot as Administrator (not from SCVMM)
Import the Virtual Machine Manager Module
Import-Module virtualmachinemanager
try again the command I posted in this blog post.
Had this exact issue today, script worked great. Thanks.
Hi,
unfortunately it doesn’t work always. In my case I getting the error that the ‘Machine is not associated with this VMM management server’.
Associate-VMHost associate successfully, but if i than try to delete the host again, the same message comes up.
Any other ideas?
Hi..
i want to remove fail host too, but the host is the member of hyper-v cluster. can i safely remove the failed host without affecting the cluster?
Thanks
Hi Ichwanzo,
Is that host still a real member of the cluster?
If yes, I would try to remove the cluster from VMM. Check if the VMM agent is removed from the host and than add it again.
Sven
btw
I was able to remove a node out of VMM. That didn’t effect the cluster, the cluster was still fine. But you will need to use PowerShell to bring the Node back into VMM again without removing the whole cluster from VMM.
To add the node via PowerShell to VMM and the cluster use this:
$cl = Get-SCVMHostCluster
$credentials = Get-Credential
add-scvmhost -Credential $credentials -VMHostCluster $cl
Sven
I think in the most cases you can also use the UI to add it back to VMM. The wording is kind of strange but with “Add host to cluster” it just installs the agent on the Hyper-V Host
I have a VM host that I was trying to remove from VMM 2012. The VMM service crashed while host was in process of removal, and now the host is in “pending” status. I have tried using the GUI and Powershell commands such as in this article. Every time, no matter what method, the VMM service crashes when attempting to remove now.
I am guessing at this point my only option is to delete from SQL DB manually, but I am not sure which tables to look and which fields to delete so that nothing else is affected.
Any help would be appreciated.
Hello,
I has a similar problem : I re install my host from scratch without having removed it from SCVMM. after the re installation I was not able to do any actions on my host from VMM. I tried to remove it with CMD line but there were always errors.
I realized that I was not able to do any actions on my host because the VMM local agent was not installed…I guess this agent is usually set up when the host is add to a cluster.
Having add this agent my host is working properly and I can remove it from my cluster if I want to.
Get-SCVMHost <HOSTNAME> | Remove-SCVMHost -force
The above command does not work it getting me errors
I used Get-SCVMHost HOSTNAME | Remove-SCVMHost -force
and it works fine
thanks,