Virtualization Technology News and Information
Article
RSS
CODE: Setting the VMUndoAction under Virtual Server

Here is the latest code snippet released from everyone's virtualization friend, Ben Armstrong. 

In his latest blog post, he writes that he stumbled across an attribute that he was unaware of (hard to imagine that Ben could be unaware of something in Virtual Server or Virtual PC, I suppose anything is possible).  Under Virtual PC, if the guest operating system shuts down and undo disks are enabled, the user will get prompted how they want to handle the undo - do they want to keep, commit, or discard the undo disks.  Unfortunately, with Virtual Server, we cannot assume the user is available to present an answer to the question.  So, we need to choose a default action.  Normally under Virtual Server, we will always want to keep the undo disks, however, you can change this behavior if you want.

Each Virtual Server virtual machine has an attribute called "UndoAction".  This is normally set to "1" for "keep", but it can also be set to "0" for discard or "2" for commit.  Below is a sample script that checks and sets a virtual machine's UndoAction attribute.

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("The name of the virtual machine")

WScript.Echo "VM Name: " & objVM.Name
WScript.Echo "Undo action: " & objVM.UndoAction

'Set the undo action to discard
objVM.UndoAction = 0

'Confirm that the settings change stuck
WScript.Echo "New Undo action: " & objVM.UndoAction

Check out and comment on the original post on Ben's Blog, here.

Published Sunday, July 30, 2006 7:01 PM by David Marshall
Filed under:
Comments
There are no comments for this post.
To post a comment, you must be a registered user. Registration is free and easy! Sign up now!
Calendar
<July 2006>
SuMoTuWeThFrSa
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345