The STAX job snippet you provided won't work if vmware_name contains a
list of vmware names because your code is not iterating through
vmware_name. The following command won't work because vmrun.exe doesn't
accept ["c:\\vmware\ReadHat\rhel3.vmx"] as the correct value.
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" start [
"c:\\vmware\RedHat\rhel3.vmx"]
If vmware_name is supposed to contain a list of vmware names where the
first element in the list is to be used in conjunction with the first
element in the machList then you could do something like the following
(note the [i] added to the vmware_name[i] so that it accesses the ith
element in the list).
The paralleliterate's attribute indexvar is defined in the STAX User's Gu
ide as the name of a variable which will contain the index of the current
item in the list being iterated. Note that the index fort he first
elemetn in the list is 0.
<script>
vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
vmware_root = '"c:\\Program Files\VMware\\VMware Workstation\\vmrun.exe"'
machList = ['somemachine']
start = 'start'
</script>
<paralleliterate var="machName" in="machList" indexvar="i">
<process name="'Starting VMware on machine %s.....' % machName">
<location>machName</location>
<command mode="'shell'">'%s %s %s ' % (vmware_root, start, vmware_name
[i])</command>
</process>
</paralleliterate>
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
Sangram Bakshi <san...@gmail.com>
08/20/2009 07:29 AM
To
staf-users@lists.sourceforge.net
cc
Subject
Re: [staf-users] Unable to start vmware through a stax job
Hi ,
I would like to add that , considering the code:
vmware_name would come as list ,i.e it could be multiple vmware names in
the list , so vmware_name is a list.
However , if i have vmware_name = '"c:\\vmware\RedHat\rhel3.vmx"' (as a
single variable )
I am able to start the vmware . If i have the same thing in a list , i am
not able to start the vmware.
Kindly suggest .
<script>
vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
vmware_root = '"c:\\Program Files\VMware\\VMware Workstation\\vmrun.exe"'
machList = ['somemachine']
start = 'start'
</script>
<paralleliterate var="machName" in="machList" indexvar="i">
<process name="'Starting VMware on machine %s.....' % machName">
<location>machName</location>
<command mode="'shell'">'%s %s %s ' % (vmware_root, start,
vmware_name) </command>
</process>
</paralleliterate>
Regards
Sangram
On Thu, Aug 20, 2009 at 5:34 PM, Sangram Bakshi <san...@gmail.com> wrote:
Hi ,
I am trying to start a vmware from a stax job .
>From the command line of a windows machine we can start a vmware by doing
a:
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" start
"C:\vmware\RedHat\rhel3.vmx"
Considering if i want to start the vmware "C:\vmware\RedHat\rhel3.vmx".
Now i want the same to be done from a stax job.
The machine from where i am trying to start the vmware is staf-stax active
i.e staf runs here .
Now the code i use is (I am not using the function which is there in the
STAF faq ,i am simply trying to use the command to start the vmware.)
somemachine = machine where staf and stax is running already.
<script>
vmware_name = ['"c:\\vmware\RedHat\rhel3.vmx"']
vmware_root = '"c:\\Program Files\VMware\\VMware Workstation\\vmrun.exe"'
machList = ['somemachine']
start = 'start'
</script>
<paralleliterate var="machName" in="machList" indexvar="i">
<process name="'Starting VMware on machine %s.....' % machName">
<location>machName</location>
<command mode="'shell'">'%s %s %s ' % (vmware_root, start,
vmware_name) </command>
</process>
</paralleliterate>
Kindly suggest any improvements so that i can start the vmware just by
giving the command.
Regards
Sangram
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users