ansible-collections / ibm_zos_core

Red Hat Ansible Certified Content for IBM Z
77 stars 44 forks source link

[Module] [zos_stc] Support started tasks #610

Open ddimatos opened 1 year ago

ddimatos commented 1 year ago

New module description

This could end up being a module possibly but lets describe the components and then the use case/requirement:

Support the ability to start or stop a z/OS Started task. Today the ibm_zos_core collection has no support for started tasks, it only happens that batch jobs and started tasks are JCL and have similarities in that the other modules such as zos_job_query and zos_job_output can access the spool such that it appears there is support. Currently the collection has no test cases that perform any started tasks operations and validate as a result of that.

The request is to have a module (or could be a role) that could START or STOP the z/OS Task and then be instructed to look for a particular message.

Things to consider:

What is a started task:

A started task is a set of JCL that is run immediately as the result of a START command. Started tasks are generally used for critical applications. An advantage offered by started tasks are control over where and when the JCL is run. For example, you could have the JCL started at each IPL of the system.

What is a Batch Job:

Batch applications are processed on the mainframe without user interaction. A batch job is submitted on the computer; the job reads and processes data in bulk— perhaps terabytes of data— and produces output, such as customer billing statements. An equivalent concept can be found in a UNIX® script file or a Windows® command file, but a z/OS® batch job might process millions of records.

Started task vs Batch Job:

When you determine where and when you want specific JCL to run, you will consider using batch jobs or started tasks. Batch jobs are scheduled by a job entry subsystem (JES2 or JES3) and are scheduled to run based on the resources they require and their availability, or based on controls that you place on the batch system. Controlling where and when a batch job runs is more complex than using a started task.

A started task is a set of JCL that is run immediately as the result of a START command. Started tasks are generally used for critical applications. An advantage offered by started tasks are control over where and when the JCL is run. For example, you could have the JCL started at each IPL of the system.

Link to some internal discussion, suffix ending /archives/CSLEJ8VGV/p1673841703935819

User story

The request is to have a module (or could be a role) that could START or STOP the z/OS Task and then be instructed to look for a particular message.

EdwardMcCarthy commented 1 year ago

Most STC's come up fairly quickly, but I am working on an Ansible playbook that creates new started tasks, that take 10 mins or more to initialise ( there is a large VSAM file formatting part that has to happen one time which takes 10 mins ) plus then some further initialisation that takes over 10 mins ( again this is a one off )

It would be good if this module could output progress messages, for example every X retry, show last line of a specified DD name

In this particular case, would want to be able to specify this:

This would let whoever is watching the playbook see progress messages, which for this particular case where startup of the STC will take over 20 mins would be provide reassurance to the watcher that the STC startup is progressing

roded commented 1 month ago

Please also take into considering the fact that multiple STC can be running with the same name. If we have 2 STC with the same name running, we'd have to specify the ASID in the stop command.