Automic Workload Automation

Expand all | Collapse all

How to start a job on the same agent of the activating job?

MarcoTizzoni604411

MarcoTizzoni604411Dec 07, 2017 06:44 AM

MarcoTizzoni604411

MarcoTizzoni604411Dec 07, 2017 09:11 AM

  • 1.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 08:43 AM
    Hi,
    I have two jobs  (Job 1 and Job 2) that run on a host group, say with two agents: agent A and agent B.

    From time to time Job 1 hangs and it's ended because it exceeded the Maximun Runtime (MRT). Then I need to run Job 2 on the same agent where Job 1 was running and restart Job 1 when Job 2 ends.

    If I configure Job 2 to be activated by Job 1 in the General-> Running -> MRT section it may run on a different agent. The same happens when I activate Job 2 in the post condition of Job 1.

    Any hints on how to do that?

    Best,
    Marco


  • 2.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 09:21 AM
    Marco, basically in that case it would be the best to add a specific host instead of a hostgroup to the job you want to run. There is currently no way to force a hostgroup to assign a follow-up task of a task to run on the same host, but it might be a good idea to place this under ideas.automic.com as a feature request.



  • 3.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 09:27 AM
    I know, but that's not possible, we need parallel processing.

    I actually solved the problem by:
     1. Setting a variable on the first job of the workflow 
    :PSET &ACTUAL_TARGET_AGENT# = &$AGENT#

     2. Using this variable in the pro-process tab of the activated job
    :PUT_ATT HOST = &ACTUAL_TARGET_AGENT#




  • 4.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 09:32 AM
    It gave me a hint this post: https://community.automic.com/discussion/6132/set-agent-group-of-a-job-programmatically

    I wonder where such feature is documented though.


  • 5.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 09:44 AM
    The solution which is given by Michael_Lowry contains a lot of programming, each of the commands and system variable he is using is documented, but the process itself he is sharing here - which is totally awsome programmed - is an individual code he created based on automic script and variables, so it can not be documented within our documentation. But of course, it would solve your issue, and there should be no issue using it for your purpose.


  • 6.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 10:05 AM
    My question was more about the :PUT_ATT HOST thing.
    I could not find where is documented that this variable can be set to fix the agent on which a job will be running. Also, I guess, other variables exist that can be leveraged for different purposes. Do you know where this is in the documentation? It would be an interesting read.
    Thanks in advance.


  • 7.  How to start a job on the same agent of the activating job?

    Posted Dec 06, 2017 02:23 PM


  • 8.  How to start a job on the same agent of the activating job?

    Posted Dec 07, 2017 04:50 AM
    For some reason I do not understand, it works for a test workflow but with the real one. The PUT_ATT fails with this error:
    Changing the Agent is not allowed because the resources of the agent has already been reserved.



  • 9.  How to start a job on the same agent of the activating job?

    Posted Dec 07, 2017 06:04 AM
    Do you use a promptset variable or object variable in agent definition somewhere before?


  • 10.  How to start a job on the same agent of the activating job?

    Posted Dec 07, 2017 06:44 AM
    The main workflow does when we trigger the job manually.


  • 11.  How to start a job on the same agent of the activating job?

    Posted Dec 07, 2017 08:00 AM
    Marco Tizzoni said:
    For some reason I do not understand, it works for a test workflow but with the real one. The PUT_ATT fails with this error:
    Changing the Agent is not allowed because the resources of the agent has already been reserved.

    execute :PUT_ATT from the PreProcess tab. This error message is typical if you do it from the Process tab.


  • 12.  How to start a job on the same agent of the activating job?

    Posted Dec 07, 2017 09:11 AM
    It's already in the pre-process tab