Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] Third Party Tools
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-30-2005, 03: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
  #2  
Old 04-01-2005, 02:29 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
We will be installing Virtual Server 2005 to test this in the near future, but in the meantime, what error do you receive using the VM object in a Run Script step?

For now you can pass parameters to cscript.exe/wscript.exe so you could pass MACRO values as arguments to your script. This will at least make your jscript be more modular and reuseable.

I've attached some simple sample jscript that could be used to provide some exception handling while using cscript.exe to execute your jscript and have Visual Build Professional detect when an exception occurs.
Attached Files
File Type: bld cscript example.bld (1.0 KB, 1596 views)
Reply With Quote
  #3  
Old 04-01-2005, 03:59 PM
bdsst7 bdsst7 is online now
Registered User
 
Join Date: 03-23-2005
Posts: 5
Virtual Server 2005

Thank you for the suggestions. We currently use the workaround you provided. We create a .js script file, and execute it ustilizing cscript.

The error that is returned is Error line 6, Column 1.
Reply With Quote
  #4  
Old 05-31-2005, 08:21 AM
bdsst7 bdsst7 is online now
Registered User
 
Join Date: 03-23-2005
Posts: 5
Kinook support was able to find a resolution for this issue. The issue appears to be due to the Virtual Server COM interfaces requiring the security level be set to Impersonation or higher [1]. By default, COM uses the Identification security level VBP and scripts executed within it will run at the system-wide setting since it doesn't explicitly set a security level. Changing the default security setting to default or higher should resolve any issues.


• Run dcomcnfg from the run dialog
• Navigate to Component Services
• Navigate to My Computer
• Right click on my computer & select properties
• Switch to default Properties tab
• Set Default Impersonation Level to Impersonate.
• Click ok and restart machine.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:58 PM.


Copyright © 1999-2023 Kinook Software, Inc.