View Single Post
  #1  
Old 03-30-2005, 02:26 PM
bdsst7 bdsst7 is online now
Registered User
 
Join Date: 03-23-2005
Posts: 5
Virtual Server 2005 Script issues

At my company, we use Virtual server 2005 for our build machines. I am currently looking at ways to include our virtual machine code into VBP. Unfortunately, we have run into scripting issues that are causing us to create work arounds that are not pretty.

I have created a step that will start a virtual machine (vm) on our server. If I attempt to run this code throught a script step, I recieve an error utilizing the VM object. (javscript) If I take the same code and execute it with cscript, I recieve no errors. Therefore, we are currently writing our code to a javascript file, and then executing it with cscript. I would like to add some exception handling, and macro definition within my script. Anyone have any thoughts?

Example Script:

var vmServerName = "MYVIRTUALSERVER";
var buildVmMachine = "Test Virtual machine";

var vmServer = new ActiveXObject("VirtualServer.Application", vmServerName);

var oBuildVM = vmServer.FindVirtualMachine(buildVmMachine);

//See if machine is running.
HBeatFlag = oBuildVM.GuestOS.IsHeartbeating;
//Tell user
WScript.echo("HBeatFlag = " + HBeatFlag);
Reply With Quote