Fixing an incomplete VM that’s stuck in the Creating state

Fixing an incomplete VM that’s stuck in the Creating state

  • Comments 8
  • Likes

Have you ever run into a situation where a failed P2V or other job leaves you with a VM you cannot delete?  I have and it usually ends up looking something like this:

image

Recently we’ve had a couple of cases come in where a VM was stuck in the Creating State in the SCVMM 2008 console due to a P2V or some other failure. When this happens there is no apparent way to resolve this issue using either the Users Interface or a Powershell script. During my last encounter, the first thing we tried was the following Powershell command lines:

Get-VMMServer -ComputerName <vmm server name>

$VM = Get-VM -Name "<name of vm in admin console>"

Remove-VM -VM $VM –Force

But this failed with:

Remove-VM : VMM cannot remove the virtual machine because it is in the Creating

... state. (Error ID: 809, Detailed Error: )

Change the virtual machine's state, and then try the operation again.

To restart the job, run the following command:

PS> Restart-Job -Job (Get-VMMServer ERACHVVMM | Get-Job | where { $_.ID -eq "{b

59780cd-0e6f-40ce-bcb5-01bf8ebf1f6b}"})

At line:1 char:10

+ Remove-VM <<<< -VM $VM –Force

This script had worked great in the past but didn’t work in this situation, and so far the only way we know to remove this type of VM is to implement the procedure below:


First back up the VMM database

1. In Administration view, click General, and then, in the Actions pane, click Back up Virtual Machine Manager:

image

2. In the Virtual Machine Manager Backup dialog box, type the path for a destination folder for the backup file. The folder must not be a root directory and must be accessible to the SQL Server:

image When complete, your SCVMM backup file should look something like this:

image Next we need to edit some tables in the SQL database.  If you are using the SQL Server 2005 Express Edition that comes with the SCVMM 2008 product you will not have a way to access the VirtualManagerDB VMM database tables by default.  If you have SQL Server 2005 you may need to install the SQL Server Management Studio if it was not already installed. In either case you will need the SQL Server Management Studio to access the tables.  If you don’t have it installed you can download it here:

Microsoft SQL Server Management Studio Express

Once you have SQL Server Management Studio installed launch it and drill down to the VirtualManagerDB tables node:

image Once there scroll down and find the tbl_WLC_VObject table, right click on it and choose “ Open Table”:

image

You should see something like this:

image

What we want to do is change the ObjectStateValue from 100 to 1 and hit Enter.  After that just do a refresh on the Hyper-V Host that “Bad Box” is hosted on and notice that its status has changed to Stopped!

imageThe VM should wind up in either the Stopped or Missing state and you should have the option to delete this VM.  Go ahead and delete it now. 

That’s it!

Many thanks to Steve Thomas who did the research which is the foundation of this process and Jason Alanis who duplicated it and ironed out some of the details.

Enjoy,

John Behneman | App-V and SCVMM Support Engineer

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • PingBack from http://www.netdeluxo.com/blog/blogs/system-center-virtual-machine-manager-fixing-an-incomplete-vm/

  • 242 Microsoft Team blogs searched, 116 blogs have new articles in the past 7 days. 298 new articles found

  • Thanks John. Modified slightly to remove a pile of "missing" state VDS's which appeared due to cluster failover errors and my SCVMM console looks much healthier now!

    Steve

  • hi can i useing SQL SERVER 2005 or 2005 Express Edition (sp1,sp2-sp3) for SCVMM 2012 ?

    WITH SQL 2005 I recived Error : Can not Created SQL Database , ....... in the last Step and Installation not complete  ;-(

    NOT GOOD oO Why cant using SQL 2005 ?

    or for SCVMM 2012 , i need sql 2008 full or 2008 Express(sp1) ?

  • this error i recived :

    " The Virtual Machine Manager database was not created.

    The Virtual Machine Manager database was not created. Delete VMDB.mdf and VMDB_log.ldf if they exist at C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ or use a unique name for the database. Also, verify that disk quota management is not enabled for the drive where the database is being created. Then run Setup again. "

  • @Damon Mohammadbagher:

    He Guy, that's not a problem of the SQL-Server 2005. I recived the same error and I use SQL Server 2008 R2. But I have no Idea where is the Problem, too.

  • HI

    ;-)

    I install SQL NATIVE CLIENT + COMMAND LINE CLIENT + SQL (SP2)

    THEN SCVMM 2012 WORKED !!!!!!

    and Complete installed.......

  • " The Virtual Machine Manager database was not created.

    The Virtual Machine Manager database was not created. Delete VMDB.mdf and VMDB_log.ldf if they exist at C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ or use a unique name for the database. Also, verify that disk quota management is not enabled for the drive where the database is being created. Then run Setup again. "

    My Fix is:

    German OS + Engl. VMM 2012 Beta Version + Engl. SQL 2008 /R2 = run

    German OS + Engl. VMM 2012 Beta Version + German SQL 2008 /R2 = doesn't run

    I hope that's help