In this scenario, a job is created to run a script on a
Red Hat Enterprise Linux system.
About this task
By specifying candidate operating systems, you can define
the type of operating system on which a job is to run, in this case Linux. To direct the job to a specific flavor of Linux, you must define a related resource and link it to the
job resources by creating a relationship. To create a job definition
that does this, perform the following steps:
Procedure
- In the Job Brokering Definition Console select and
create a new job definition named rhjob. The job definition opens at the Overview page with the
job name assigned.
- Open the Application page and define the required information
for the application that the job is to run.
- Open the Resources page and specify the operating system
type requirement, as follows:
- Select the Software Requirements tab.
- In the Candidate Operating Systems pane, click Add. The Operating
System Details dialog box is displayed.
- In the Type menu, select LINUX and click OK.
- Open the Related Resources page and create a resource requirement
for the Red Hat flavor of Linux, as follows:
- In the Resource Requirements pane, click Add. The Resource Requirement Details
dialog box is displayed.
- In the ID field, specify a meaningful
ID, in this example, redhat.
- In the Type menu, select Operating System.
- In the Resource Properties pane, click Add
Requirement. The Resource Property details
dialog box is displayed.
- In the Property Name menu, select Display Name.
- In the Property Value , type Red*.
- Switch back to the Resources page to link the resource
requirement to the operating system resource.
- Select the Advanced Requirements tab.
- In the Relationships pane, click Add. The Relationship Details dialog box is displayed.
- In the Type menu, select Contains.
- In the Target menu, select the
Red Hat resource requirement that you created and click OK.
- Select to save the job definition file.
Results
The JSDL file created for this scenario has the following
syntax:
<jsdl:jobDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jsdl="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdl"
xsi:schemaLocation="http://www.abc.com/xmlns/prod/scheduling/1.0/jsdl
JSDL.xsd" description="Job to run on Red Hat Linux" name="rhjob">
<jsdl:application name="executable">
<jsdle:executable path="/opt/myExecutable">
</jsdle:executable>
</jsdl:application>
<jsdl:resources> <jsdl:resources>
<jsdl:candidateOperatingSystems>
<jsdl:operatingSystem type="LINUX"/>
</jsdl:candidateOperatingSystems>
<jsdl:relationship target="redhat" type="Contains"/>
</jsdl:resources>
<jsdl:relatedResources id="redhat" type="OperatingSystem">
<jsdl:properties>
<jsdl:requirement propertyName="DisplayName">
<jsdl:exact>red*</jsdl:exact>
</jsdl:requirement>
</jsdl:properties>
</jsdl:relatedResources>
</jsdl:jobDefinition>