Removing Hyper-V VMs From a Cluster, in Virtual Server 2005
ASP Developer Network - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com

Menu

ASPDeveloper.Net / VirtualServerFAQ.COM

Make sure you go to our home page for:

* Virtual Server 2005 FAQ
* ASP.Net 2.0 Information
* ASP.Net 2.0 Streaming Tutorials
* ASP.Net 2.0 HTML based Tutorials

Made possible by Business Internet Technology Shop (BitShop)



View :  Show duplicate posts
Virtual Server 2005

Recent Virtual Server 2005 posts

windows 2000 server problem
MSVMM Migration feature does not work
Processor Error when trying to move to a diffrent Host
SVCMM P2V conversion fails with winrm error
Move VHD - SQL Instance Name Changes
Creating a second IDE drive in SCVMM 2007
Events 592, 600, 593 repeat every minute after installing Virtual
Virtual Server clustering: does it fit for test of sql server clus
Permanent Removal of VM from Hper-V on WS 2008?
Self-Service Portal Media using iso
VS 2005 R2SP1 Ent x86 on W2K3 R2SP1 Std x64
Virtual Server 2005 R2 on Vista Business: can"t use Adm Website
Virtual server versus virtual pc - what is the relationship
Bad disk performance on 2008 / virtual pc 2007, anybody know how t
Virtual Server inside Virtual PC
New VMBus Network Adapter not installed Properly
Accidental Snapshot Merge
Windows Server 2008 hosted on Virtual Server 2005 R2 very slow
Hyper-V Integration Services
Developer needs help with Hardware/Software for Virtualization
Add Solution

Latest Topics

Table Of Contents


Post Reply |  This is Spam! | Mark as Spam

Removing Hyper-V VMs From a Cluster

Source: microsoft.public.virtualserver
Sent: 12/03/2008
From: "dln" <(email address - cut out)>
Message:

Hello All,

I want to say up front that this is a programming question and I'm not sure
if this is the correct newsgroup to post this question in, but I can't seem
to find one that fits my question. I figured I would try here first - if
there's a more appropriate group, please let me know.

Our organization has written a VBScript that automates VM deployment. It
exports an existing VM image, re-imports and renames it, syspreps it and
then adds the new VM to a Server 2008 Datacenter Edition 64-bit failover
cluster. This script works fine. There is a second script (VBScript again)
that is _supposed_ to do the reverse - it removes the VM from the cluster
and then cleans up any left over VM directories and files. Unfortunately
trying to delete the cluster resource returns a "generic failure
(-2147217407)". The odd thing is that it does actually remove the VM from
Hyper-V, it just doesn't remove the cluster resource.

A snippet of the "destroy VM" script around where it fails is below:


Set wmiVirt = GetObject("winmgmts:\\.\root\MSCluster")
Set clustVmConfig = wmiVirt.ExecQuery("SELECT * FROM MSCluster_Resource
WHERE Name LIKE '%" & vmName & "%' AND Type = 'Virtual Machine
Configuration'").ItemIndex(0)
Set clustVm = wmiVirt.ExecQuery("SELECT * FROM MSCluster_Resource WHERE Name
LIKE '%" & vmName & "' AND Type = 'Virtual Machine'").ItemIndex(0)

' validation of VM UUID to cluster resource and offlining of VM happens here

clustVmConfig.TakeOffline
clustVmConfig.DeleteResource ' this call removes the VM from Hyper-V and
returns the "generic failure" error
clustVm.DeleteResource ' this call fails as well with the same error message


What we're trying to accomplish via our script is obviously possible - the
Failover Cluster Manager interface does it without issue. Any ideas as to
why invoking the process would fail when called from VBScript? I'm
completely open to the possibility that I've pooched the call somehow, but
if that's the case, could you provide an example of the correct way to
perform the operation (or a reference to an example on-line)?

Thanks,

dln




Post Reply |  This is Spam! | Mark as Spam

Related Messages


Post Reply |  This is Spam! | Mark as Spam


Table Of Contents



Other groups

 
Virtual PC (Mac)(3592) Virtual PC(12844) Virtual PC (French)(496)
Virtual Server 2005(6245)
Search
in:
Our Sponsors
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
rss Wiki rss Blogs rss Articles rss Image galleries rss File galleries rss Forums rss Maps rss Directories
ASP Developer Network (since 1996) - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com
Copyright © 1997-2005 by BitShop, Inc. All Rights Reserved.
No content may be reproduced in any form without written permission from BitShop, Inc.
We will be honored to assist with reproduction rights on our material if you contact us.
We also can provide print articles for your magazine, private training seminars at your site, and conference presentations.

Thank you for visiting. Please bookmark our site if you found it useful!
If you wish to make a donation it will help further the development of these free resources: