Jean Lalonde Support Forum

Full Version: [TIP] How far can you push "Groups"?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Maybe, kind of a fringe case, Jean will hit me on my head if I go overboard.

The Problem:
I have lab setup where I run some virtual machines.
(For those readers not knowing what a virtual machine is, no problem, it is not important here).
I just have a lot of stuff I have to run in a sequence.
All that "stuff" runs on one machine, but I start it remotly from another machine.

Repetitive tasks are boring, so I started thinking if I could use QAP as a very simple "job controller".
Starting those machines (the "stuff") manually, in the same order every time I spin up my lab gets very old, very fast.

The first problem, as I have posted as a feature request to Jean, is the 9999ms lock, ie the maximum 9.9 sec delay in "Groups" between each favourite.
I need to have a longer delay because some of the virtual machines need to be fully up and running before starting some of the other ones.
(An example of this is a machine called an "Active Directory Domain Controller" that controls logons and other functions like DNS).

Create a group with maximum delay:
Create a favourite of type Group.
Click Edit and go to Advanced Settings, under "Delay between favourites to restore" enter 9999 (the maximum value).

Delay script that does nothing:
Create a script that does nothing, that script has a timeout of 3 sec.
Why so short?
Because QAP looks at the trigger of the job, not what the job is doing, so after triggering a favourite QAP immediately starts the 9.9 sec countdown for the next favourite in the Group.

So, the script just displays a short message and exits.
This is a very simple example of such a script, noop.cmd.

REM 3 sec local delay
REM Empty script to utilise the 9999 ms maximum value in Groups
ECHO Running locally on: %COMPUTERNAME%
ECHO Waiting 3 sec

User Variable pointing to the script
Assign that script, that does nothing, to a User Variable, like

In the Group:
Insert that script as favourite of type Application, in the Application path field, enter the UserVar, {noop} in between the favourites that is actually doing something.
Multiply by that 9.9 sec delay in QAP until you get the delay you want.
For every entry, QAP will wait for 9,9 sec.

The Effect:
Because of that 9.9 delay, and the noop (no operation, for us old assembler guys) you get a somewhat controlled start of favourites.

I use ONE Group to trigger all my virtual machines on one host.
Including the "noop", in total I have 35 entries in my Group, I trigger it, get a coffee, and all is good when I come back.

The Drawback:
While the Group is running, QAP is not responding.
You have to wait until the Group/batch is finished.
For me, it is around 4-5 minutes.

But QAP runs like a clock, it just won't talk to you until the Group is finished! Smile

But who cares, trigger QAP, let my PC do the stuff while I get a coffee....

(Edit: This post was initially done in a hurry so I cleaned up the text a bit, and added the delay example)

As always, if anyone can use this, cool.....