Thank you. This is very helpful.  I'll give it a try. 

On Wed, Feb 10, 2021, 2:18 AM Benny Zlotnik <bzlotnik@redhat.com> wrote:
You could do this by setting a custom correlation_id with a query
param when invoking the operation, then filter the jobs using the same
correlation id:
https://engine/ovirt-engine/api/jobs?search%3Dmycorrelationid (it's
not a reported field)

We do this in our system tests[1]

[1] https://github.com/oVirt/ovirt-system-tests/blob/b4e156f1ee23c8b7d4338c937fa0a1b708a154f3/basic-suite-master/test-scenarios/test_004_basic_sanity.py#L767

On Tue, Jan 26, 2021 at 3:54 PM Pascal DeMilly <pascal@mantra-soft.com> wrote:
>
> Hello
>
> Any ideas how to retrieve the job Id of an async job at the time of creation or from a job to know which entities (VM, disk, template) Id it was created from
>
> Thanks
>
> On Sat, Jan 23, 2021, 10:04 AM Martin Perina <mperina@redhat.com> wrote:
>>
>> Hi Ori,
>>
>> could you please take a look?
>>
>> Thanks,
>> Martin
>>
>> On Thu, Jan 21, 2021 at 9:52 PM <pascal@butterflyit.com> wrote:
>>>
>>> I am using the rest api to create a VM, because the VM is cloned from the template and it takes a long time, I am also passing the async parameters hoping to receive back a job id, which I could then query
>>>
>>> https://xxxxx/ovirt-engine/api/vms?async=true&clone=true
>>>
>>> however I get the new VM record which is fine but then I have no way of knowing the job id I should query to know when it is finished. And looking at all jobs there is no reference back to the VM execept for the description
>>>
>>>
>>>  <job href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31" id="d17125c7-6668-4b6c-ad22-95121cb66a31">
>>>     <actions>
>>>       <link href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/clear" rel="clear"/>
>>>       <link href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/end" rel="end"/>
>>>     </actions>
>>>     <description>Creating VM DEMO-PCC-4 from Template MASTER-W10-20H2-CDrive in Cluster d1-c2</description>
>>>     <link href="/ovirt-engine/api/jobs/d17125c7-6668-4b6c-ad22-95121cb66a31/steps" rel="steps"/>
>>>     <auto_cleared>true</auto_cleared>
>>>     <external>false</external>
>>>     <last_updated>2021-01-21T12:49:06.700-08:00</last_updated>
>>>     <start_time>2021-01-21T12:48:59.453-08:00</start_time>
>>>     <status>started</status>
>>>     <owner href="/ovirt-engine/api/users/0f2291fa-872a-11e9-b13c-00163e449339" id="0f2291fa-872a-11e9-b13c-00163e449339"/>
>>>   </job>
>>> _______________________________________________
>>> Users mailing list -- users@ovirt.org
>>> To unsubscribe send an email to users-leave@ovirt.org
>>> Privacy Statement: https://www.ovirt.org/privacy-policy.html
>>> oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
>>> List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/TGZQLI55EFZOSEBNEU5CCBDZ2EDXMINQ/
>>
>>
>>
>> --
>> Martin Perina
>> Manager, Software Engineering
>> Red Hat Czech s.r.o.
>> _______________________________________________
>> Users mailing list -- users@ovirt.org
>> To unsubscribe send an email to users-leave@ovirt.org
>> Privacy Statement: https://www.ovirt.org/privacy-policy.html
>> oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
>> List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/SETMGF2ZNYGU6OJKJAY7WRPKTWUQGF7F/
>
> _______________________________________________
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-leave@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
> List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/UVKF5KCOP27VR6UXHXECEQJGWGZSHTWP/