Skip to main content

Resources

JAMS Resources are powerful tools that can help you allocate how batch Jobs are run. Resources let you define the necessary requirements (weight) for all Jobs, allowing JAMS to determine which Jobs can or cannot run concurrently. You can also use Resources to create maintenance windows that will prevent Jobs from running for a specified time. This is helpful during upgrades or maintenance activities, such as moving the JAMS Scheduler or backing up the database.

Resources can be assigned to Folders and Jobs. The Resource is defined by setting a specific quantity. Jobs will then use a portion of this quantity when they run. If you assign the Resource at the Folder level, all Jobs within the Folder will inherit the Resource setting.

Determining the Resource Quantity to Assign​

When manually modifying Resources, how do you know how much or how little to assign to a particular Job? JAMS provides several ways to determine if a Resource is working above or below its effective allocation.

View the Quantity Columns​

Open the Resources screen and compare Quantity Available with Quantity In Use and Quantity Waiting. A Resource whose Quantity In Use is at or near its Quantity Available, or whose Quantity Waiting is above 0, is holding Jobs back. See Scheduler Properties.

Access the Monitor​

Open the Monitor to view the status of all Jobs. If a Job has stalled or displays a ‘Waiting for Resources’ description, consider adjusting the Resource allocation.

Run a Script​

You can run the following PowerShell script to return the quantity of Resources that are currently in use.

#### Report Resource Usage
Import-Module JAMS
$JAMSServer = "localhost"
$JAMSDefaultServer = $JAMSServer
New-PSDrive JD JAMS $JAMSServer -ErrorAction SilentlyContinue

$jamsentries = get-jamsentry -server $JAMSServer
$EntryReport= @()
$ResourceReport= @()

foreach ($jamsentry in $jamsentries){
$entry=get-jamsentry $jamsentry.jamsentry
$resourcerequirements = $entry.Elements | where-object {($_ -is [MVPSI.JAMS.ResourceRequirement])}
foreach ($resourcerequirement in $resourcerequirements){
write-output "$($entry.jamsentry) $($entry.Name) $($entry.CurrentState) $($ResourceRequirement.ResourceName) $($ResourceRequirement.QuantityRequired) $($ResourceRequirement.ElementState)"
$out = New-Object psobject
$out | Add-Member noteproperty Entry-Entry $($entry.jamsentry)
$out | Add-Member noteproperty Entry-Name $($entry.Name)
$out | Add-Member noteproperty Entry-ResourceName $($ResourceRequirement.ResourceName)
$out | Add-Member noteproperty Entry-QuantityRequired $($ResourceRequirement.QuantityRequired)
$out | Add-Member noteproperty Entry-ElementState $($ResourceRequirement.ElementState)
$EntryReport += $out
}
}

$EntryReport | ft

write-output "`n*** Resources ***"
$resources = Get-Childitem -Path JD:\Resources
foreach ($resource in $resources) {
$out = New-Object psobject
$out | Add-Member noteproperty Resource-Name $($resource.Name)
$out | Add-Member noteproperty Resource-QuantityAvailable $($resource.QuantityAvailable)
$out | Add-Member noteproperty Resource-QuantityInUse $($resource.QuantityInUse)
$ResourceReport += $out
}

$ResourceReport | ft

Resource Allocation​

JAMS will automatically control how each Job acquires and releases the Resources assigned to them. Before a Job runs, JAMS compares the available Resource pool with the quantity required by the Job. If the available Resources exceed the required amount by the Job, the Job will execute. When the Job is completed, the Resources are released and added back to the available Resource pool.

The Resource quantity available can be manually increased or decreased at any time. You can make the modifications in one place, the Resource Definition, and it is available to all Jobs that need it.

As your batch processes move from one operating system to another, JAMS continues to enforce the assigned Resources requirements.

Resource Behavior​

Resources have some unique characteristics that are listed below:

  • Jobs inherit the Resources that have been defined in their respective Folders.
  • Jobs can reduce or increase the inherited Resource requirements.
  • Jobs can add their own Resource requirements.
  • Sufficient Resources must be available for a Job to run.
  • Resources can be specific to an Agent or server.
  • Resources can be used on any operating system that is supported by JAMS.
  • The available Resource quantity can be increased or decreased at any time.
  • Requirements for different Resources can be added to the same Folder or Job.

Resources Screen​

The Resources screen lets you view all existing Resources, create new Resources, and modify existing Resources. Each Resource displays the following:

  • Resource Name – The name to identify a Resource.
  • Description – The description to provide more information about the Resource.
  • Quantity Available – The quantity of the Resource defined as available to Jobs.
  • Quantity In Use – The quantity of the Resource currently held by running Jobs, as reported by the Scheduler.
  • Quantity Waiting – The quantity of the Resource requested by Jobs that are waiting for it, as reported by the Scheduler.
  • Agent Specific – A checkmark is displayed if the Resource is tracked separately for each Agent.
  • Last Change UTC – The date and time the Resource was last modified.

Quantity In Use and Quantity Waiting are Scheduler properties. They show the Resource's live usage rather than its saved definition, and they cannot be edited.

To change the row density, or to see which list settings JAMS remembers, see Working with List Views.

Scheduler Properties​

Most Resource properties are part of the Resource definition: JAMS saves them, and they keep their values until someone changes them. Quantity In Use and Quantity Waiting are different. They are Scheduler properties: live values that the Web Client reads from the JAMS Scheduler each time it loads the Resources list or a Resource's Available tab. They show how the Resource is being used at that moment, they are read-only, and they are not saved with the Resource.

For example, Quantity Available is part of the definition and sets how much of the Resource Jobs can hold. Quantity In Use shows how much they hold now.

If the Web Client cannot get a value from the Scheduler, for example because the Scheduler is offline, the property shows a dash (—) instead of a value. A dash means the value is unknown. It does not mean that none of the Resource is in use.

Adding a Resource​

You can create a Resource definition to use with your Jobs. When you create the Resource, you have full access to it. If you want others to be able to modify or create a Job with that resource requirement, ensure the Security settings are configured properly for that user. However, users do not need permissions on a Resource to create/update a Job in a Folder that inherits the Resource requirement from a parent Folder.

  1. Click Environment in the left sidebar.

  2. Click Resources.

  3. Click Add.

  4. In the Resource Name field, enter a name for the Resource.

  5. In the Quantity Available field, enter a quantity for the Resource.

  6. Click Save & Continue.

  7. Click the Security tab to select the access level for the Resource for any other users who will modify the Resource or reference the Resource in their Jobs.

  8. Click the Available tab.

  9. In the Quantity Available field, enter the quantity for this Resource.

  10. To track the Resource separately for each Agent, do the following:

    1. Select the Agent Specific checkbox.
    2. To give an Agent its own quantity, click in the field under Agent Name and select the Agent. Agents with no row use the Resource-level Quantity Available.
    3. In the Qty Available field, enter the Resource quantity for the Agent.
  11. Click Save.

Modifying a Resource​

You can modify a Resource by changing its name, description, quantity available, and security settings. You can also add or remove Resource requirements from an Agent.

  1. Click Environment in the left sidebar.

  2. Click Resources.

  3. Click a Resource and select Properties.

  4. Click the Summary tab to change the name or description of the Resource.

  5. Click the Security tab to select the access level for the Resource for any other users who will modify the Resource or reference the Resource in their Jobs.

  6. Click the Available tab to do the following:

    1. Modify the Quantity Available for the Resource.
    2. Add, delete, or modify the Agent names that will have Resource requirements. See the section below for details.
  7. Click Save.

For a complete listing and description of each Resource property, see the sections below.

Deleting a Resource​

Before deleting a Resource, ensure all Job and Folders that currently use it have been updated to remove references to it. To view where it is referenced, click the Resource, select Properties, and then select the References tab.

  1. Click Environment in the left sidebar.
  2. Click Resources.
  3. Click a Resource and select Delete.
  4. Click Delete.
note

You must have the proper level of access to the Resource Definition to add or delete a Resource.

Resource Requirements for Agents​

Adding a Resource requirement to an Agent is optional. When you add a Resource requirement to an Agent, that Agent gets its own quantity of the Resource, separate from every other Agent. This is useful when you want to restrict the number of Jobs that will run on one Agent as compared to another Agent. If an Agent has a lower load capacity than another Agent, enter a lower quantity on that Agent and a higher quantity on the Agent with a greater load capacity. JAMS will check the available Resources on the Agent before the Job runs.

When Agent Specific is selected, the Resource-level Quantity Available is no longer an overall limit across Agents. It becomes the default quantity for each Agent that has no row under Agent Details, and each of those Agents gets that full quantity for itself. An Agent that has its own row uses that row's quantity instead, even when the Resource-level value is 0.

For example, a Resource has Quantity Available set to 2, Agent Specific selected, and one Agent Details row giving AgentA a quantity of 5. Up to 5 Jobs can hold the Resource on AgentA, and up to 2 on every other Agent.

Adding a Resource Requirement to an Agent​

  1. Click Environment in the left sidebar.
  2. Click Resources.
  3. Click a Resource and select Properties.
  4. Click the Available tab.
  5. Under Agent Details, select the Agent Specific checkbox.
  6. Under Agent Name, click the row to select an Agent.
  7. Under Qty Available, enter the quantity of Resources that are available to that Agent.
  8. Click Save.

Deleting a Resource Requirement from an Agent​

  1. Click Environment in the left sidebar.
  2. Click Resources.
  3. Click a Resource and select Properties.
  4. Click the Available tab.
  5. Under Action, click in the row for the Agent to be removed.
  6. Click Save.

Pausing Jobs with an Agent-Specific Resource​

A common way to create a maintenance window is to set a Resource's Quantity Available to 0 so that no Job requiring it can start. When Agent Specific is selected, this does not pause Jobs on an Agent that has its own non-zero quantity under Agent Details. New Jobs can still start on those Agents.

To pause every Job that uses the Resource, do one of the following:

  • Clear Agent Specific and set Quantity Available to 0. JAMS then tracks one quantity for the Resource across all Agents. Saving the Resource with Agent Specific cleared deletes every row under Agent Details, so record each Agent's quantity first and add the rows again when the maintenance window ends.
  • Set Qty Available to 0 for every Agent listed under Agent Details, and set the Resource-level Quantity Available to 0. This keeps the Agent Details rows. Record each Agent's quantity first so you can restore it when the maintenance window ends.

Jobs that are already running when you change the quantity are not stopped. The change prevents new Jobs from acquiring the Resource.

Resource Properties​

The Last Change UTC timestamp on the right side of the breadcrumb bar, at the top of the page, shows the date and time in UTC that the Resource was last changed.

Summary TabDescription
Resource NameThis property is the unique identifier for the Resource.
DescriptionThe Description property can provide a more detailed explanation for the Resource.
Security TabDescription
Access Control EntriesThe Security tab defines the level of access for this Resource. This is an Access Control List with one-to-many Access Control Entries (ACE). Each ACE can specify the following rights:
  • Acquire: users can obtain a portion or all the Resource's quantity allocation.
  • Change: users can modify this Resource if they have Change access in Resource Definitions.
  • Control: users can modify the Resource’s Access Control List.
  • Delete: users can delete the Resource if they have Delete access for Resource Definitions.
  • Inquire: users can inquire into the Resource if they have Inquire access to Resource Definitions.
Available TabDescription
Quantity AvailableThis property sets the available quantity for the current Resource. When Agent Specific is cleared, this is the overall limit shared by all Jobs that require the Resource, on every Agent. When Agent Specific is selected, this is not an overall limit. It is the default quantity for each Agent that has no row under Agent Details.
Quantity In UseThis read-only Scheduler property, under Scheduler Properties, displays the quantity of the Resource currently held by running Jobs.
Quantity WaitingThis read-only Scheduler property, under Scheduler Properties, displays the quantity of the Resource requested by Jobs that are waiting for it.
Agent SpecificIf this checkbox is selected, JAMS tracks the Resource separately for each Agent. Each Agent has its own quantity: the value in its Agent Details row if it has one, otherwise the Resource-level Quantity Available. Jobs running on one Agent do not consume the quantity of another Agent. If this checkbox is cleared, JAMS tracks one quantity for the Resource and deletes the Agent Details rows when you save.
Agent NameThis property displays the name of the Agent or Agents that have their own quantity for this Resource.
Qty AvailableThis property sets the available Resource quantity for the specific Agent. A value here overrides the Resource-level Quantity Available for that Agent, including when the Resource-level value is 0.
note

When Agent Specific is selected, setting the Resource-level Quantity Available to 0 does not stop Jobs on an Agent that has a non-zero quantity under Agent Details. To pause every Job that uses the Resource, see Pausing Jobs with an Agent-Specific Resource.

References TabDescription
ReferencesThe References tab lets you view where the Resource is referenced within JAMS.