Feed on
Posts
Comments

If you’re like me and you sometimes do things rather hastily in your home lab (NEVER IN PRODUCTION THOUGH), then you might have found yourself with an orphaned vCenter Server in your SCVMM 2012 console after moving away from VMware’s vSphere hypervisor (for whatever valid reason – choose from many).  Well, you’re in luck – well, kinda!  If you’re comfortable with SQL Server, then you’re in luck!  Otherwise, I’d recommend you steer clear of this solution and lean on Microsoft for their’s (http://support.microsoft.com/kb/2730029).  If the former, then strap on your SQL Server Management Studio, point it at your SCVMM database, and execute the following query (replacing <servername> with the name of your orphaned vCenter Server):

DECLARE @computername varchar(255)
SET @computername = ‘<servername>
DELETE FROM [tbl_ADHC_VmwResourcePool] WHERE [HostID] = (select top 1 HostID from tbl_ADHC_Host where ComputerName = @computername)
DELETE FROM [tbl_ADHC_AgentServerRelation] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)
DELETE FROM [tbl_ADHC_AgentServer] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)
DELETE FROM [tbl_ADHC_Host] WHERE [HostID] = (select top 1 HostID from tbl_ADHC_Host where ComputerName = @computername)

 

Viola!

Leave a Reply