博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Fixing an incomplete VM that’s stuck in the Creating state
阅读量:5978 次
发布时间:2019-06-20

本文共 3006 字,大约阅读时间需要 10 分钟。

 

 

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:

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:

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:

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

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:

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

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

You should see something like this:

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!

The 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,

转载于:https://www.cnblogs.com/licheng/archive/2013/05/08/3067403.html

你可能感兴趣的文章
Nacos简介及使用
查看>>
怡亚通星链获超1亿元Pre-A轮融资,投资方为中融国际信托
查看>>
时代汹涌,高亚科技如何携8Manage稳站风口?
查看>>
基于Apollo实现.NET Core微服务统一配置(测试环境-单机)
查看>>
Windows中常用文件拷贝工具的评测和对比
查看>>
华为一季度手机发货量超5900万台,折叠屏手机或延期
查看>>
苹果痛下狠手,全面禁止App内部的广告拦截软件
查看>>
百胜软件黄飞:携手阿里云,用双中台驱动新零售
查看>>
Uber 宣布作为金牌会员加入 Linux 基金会
查看>>
实用小技巧
查看>>
使用 JSON JavaScriptSerializer 进行序列化或反序列化时出错
查看>>
.NET以管理员身份运行
查看>>
C#动态系统托盘图标
查看>>
友盟集成
查看>>
Android SpannableString(显示多样式文本)
查看>>
WPF Adorner+附加属性 实现控件友好提示
查看>>
WPF 定时器DispatcherTimer+GetCursorPos 的使用,动态查看屏幕上任一点坐标
查看>>
jQuery宽屏游戏焦点图
查看>>
图片怎样优化的8个小技巧
查看>>
利用Nginx加GeoIP MaxMind数据库获取用户的地理位置
查看>>