If you write a custom job that uses the scheduleSweep() JDL function to schedule joblets and that are either 1) marked as restartable in a High Availability failover situation or 2) scheduled through the Job Scheduler to run at server startup, the job might fail to schedule any joblets and is easily noticeable with a 0 second run time. This is because scheduleSweep(), by default, creates joblets only for online nodes.
If the Job runs during failover, resources might not be immediately available, so the job ends immediately.
To keep the Job from running until a resource is online, you can use a start constraint. For example, you could add the following to the job policy:
<constraint type="start" > <gt fact="jobinstance.matchingresources" value="0" /> </constraint>
If you implement this constraint, the Job is queued (not started) until at least one resource matches the policy resource constraint.
As alternatives to using the constraint approach, you can:
Code in a waiting interval for the required Agents in your Job
Avoid using the scheduleSweep()function, using instead the schedule() API for creating Joblets
Choose an alternative set of resources to consider for the scheduleSweep(). For more information, see the
For more information about using constraints, see Novell ZENworks Orchestrator 1.3 Developer Guide and Reference.