02 February 2011

SCVMM Delete an Error 402 entry form the virtual machine list

I recently ran into this snag.  I attempted to create a virtual machine from a template, but the library was not available.  It then failed to create the vm but left an ugly un-deletable entry in the virtual machines list.

If you check out the Hyper-V console you wont see any reference to this entry because the machine was never created.

I found a few references to how to get rid of this entry but non were informative enough for me to follow them. Until I found Kevin Greene's post http://kevingreeneitblog.blogspot.com/2011/01/scvmm-2008-r2-error-402-library-server.html

This is a very easy to follow article but I still struggled to even get onto the SQL table.  So I am going to start right from the top.

Grant remote connection access to the SQL server

I was trying to connect from a SQL 2008 R2 management console to the SCVMM server.  To connect I had to change the following from the Surface Area Configuration on the SCVMM server.

  • Start - All Programs - Microsoft SQL Server 2005 - Configuration Tools - SQL server Surface Area Configuration.
  • Under Remote Connection I had to select "Using TCP/IP and Named Pipes"

  • I had to change the SQL server browser service from Disabled to Manual and start the service.

  • Restart the SQL database service.

Connect and edit the SQL table

Start up the SQL management studio from your remote machine

  • In the server name field specify the server name\instancename.  By default the SQL instance is called MICROSOFT$VMM$
  • Once connected browse to the "Virtual Manager DB" Database
  • Expand the database and browse to and expand the tables
  • Locate the dbo.tbl_WLC_VObject table
  • Right click and select "Edit Top 200 Rows"

On the right hand site find your VM server name as it appears in the SCVMM console in the "Name" column

  • Change the Object state value for that entry from 101 or 104 to 1
  • Now hit the "Execute SQL" button (The red exclamation one)

Remove the offending entry from the SCVMM console

  • Open the SCVMM console
  • Locate the offending entry.

You should now see that the state of the entry has changed

You can now delete this entry with the normal Right Click, Delete method.

That's it, all done.

This was really a dummy's guide - but I wish I had found this article.  Thanks again to Kevin Greene.

No comments:

Post a Comment