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

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

Comments

  • Harald HeidingerHarald Heidinger Automation Specialist, Knowledge Broker Automic Moderator, Team Automic Posts: 185 mod
    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.

  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    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#


  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    edited December 6
    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.
  • Harald HeidingerHarald Heidinger Automation Specialist, Knowledge Broker Automic Moderator, Team Automic Posts: 185 mod
    edited December 6
    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.
  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    edited December 6
    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.
  • Wolfgang BruecklerWolfgang Brueckler Developer LV3 EXAutomicPosts: 1,352 Innovator ✭✭✭✭✭✭
    Hi Marco,

    here ist the general description of put_att
    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All Guides/help.htm#ucaads.htm?Highlight=put_att

    and here a list of Attributes (for every executable object) to use with put_att or get_att
    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All Guides/help.htm#ucaaal.htm

    Further info: there do exist special pre-defined Agent Variables - possibly they can help too:
    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All Guides/help.htm#ucabkq.htm?Highlight=agent-variables

    Wolfgang Brückler
    Developer Lv. 3
    AE 11.2/ORA11G/Linux
  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    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.

  • Wolfgang BruecklerWolfgang Brueckler Developer LV3 EXAutomicPosts: 1,352 Innovator ✭✭✭✭✭✭
    Do you use a promptset variable or object variable in agent definition somewhere before?
    Wolfgang Brückler
    Developer Lv. 3
    AE 11.2/ORA11G/Linux
  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    The main workflow does when we trigger the job manually.
  • Peter GrundlerPeter Grundler Team Automic Posts: 193 Specialist ✭✭✭✭
    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.
  • Marco TizzoniMarco Tizzoni Posts: 33 Explorer ✭✭
    It's already in the pre-process tab
Sign In or Register to comment.