In this article I want to tell how you can remove information about incorrectly remote servers from the VMM console. For example, in my case, they removed the Hyper-V role from one of the former virtualization servers, installed a clean OS and gave it to other tasks, and forgot to disconnect from the VMM console. As a result, when trying to remove regular means it turned out like this:

Actually, now with this server nothing can be done either from the GUI or from PowerShell. The result will be something like this:

')
Since all data about server clusters and other VMM virtual machines is stored in MS SQL database, we will clear it of records about this node. Pre-worth a backup of the VMM database.
For this we need Sql Management Studio. Having started that, we will connect to the VMM database and find the identifier of the host we need by running the query:
use VirtualManagerDB select HostID, computerName from dbo.tbl_ADHC_Host
If we immediately try to delete the host entry:
use VirtualManagerDB delete from dbo.tbl_ADHC_Host where HostID like 'hostid'
Then we get only an error message due to dependencies. To successfully delete this record, we need to first delete everything related to the HostID defined by us in the following tables:
dbo.tbl_NetMan_InstalledVirtualSwitchExtension dbo.tbl_ADHC_HostBusAdapter dbo.tbl_ADHC_VirtualNetwork dbo.tbl_ADHC_HostVolume dbo.tbl_ADHC_HostDisk
dbo.tbl_ADHC_HostBusAdapter - when deleting a record from this table, I had an error referring to dbo.tbl_ADHC_HostInternetSCSIHba.
There is no HostID in the dbo.tbl_ADHC_HostInternetSCSIHba table and therefore you will have to output all the records from it to determine the id of the ISCSIHbaID we need
use VirtualManagerDB select * from dbo.tbl_ADHC_HostInternetSCSIHba
And after that we delete the record:
use VirtualManagerDB delete from dbo.tbl_ADHC_HostInternetSCSIHba like 'ISCIHbaID'
Now the deletion of a record from the dbo.tbl_ADHC_HostBusAdapter table is successful.
Finally, we delete the entry from the host table:
use VirtualManagerDB delete from dbo.tbl_ADHC_Host where HostID like 'hostid'
Now, having restarted the VMM console, we will see that there is no longer a “hung” server.
