Virtualization Technology News and Information
Article
RSS
Code: Using Set and GetConfigValue to extend the VMC file

Ben Armstrong offers yet another use for the Set and GetConfigValue within Virtual Server.  This time, he shows you how to use it to extend the virtual machine configuration files to store arbitrary data.  Here is his script that creates a new custom key and stores a value in it:

Set vs = CreateObject("VirtualServer.Application")
set vm1 = vs.FindVirtualMachine(WScript.Arguments(0))

key = "Bens_Test_Key/Some_Value"

Result = vm1.SetConfigurationValue(key, "Hello World")

Wscript.echo "Fetching custom key: " & key & " value: " & vm1.GetConfigurationValue(key)


He explains, this is useful if you need to store extra information about a virtual machine and is then easy and accessible to get to.  The key cannot contain spaces or invalid file characters such as ( / and \ ).  As usual, thanks Ben!

Read his original article and comment, here.

Published Friday, May 05, 2006 6:37 AM 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!
top25
Calendar
<May 2006>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910