Workload Policies Reference

Workload Policies enable you to control, manage, and balance the workload on Control-M resources and hosts. A Workload Policy uses filters to group together jobs and applies rules to those jobs to limit their impact on the workload.

To perform Workload Policy Management, use API commands from the Run Service.

Workload Policies are defined in a JSON file that is separate from the definitions of jobs. In this JSON file, each Workload Policy object begins with a "Name" and then a "Type" specifier as the first property. All object names are defined in PascalCase notation with first letters in capital case.

Within each Workload Policy, you can define rules to

  • Limit the number of jobs that can run concurrently at specific time periods.

  • Limit resources available to the jobs at specific time periods.

  • Route jobs from one host to another.

A Workload Policy enforces its rules on all associated jobs in production. This enables you to quickly affect the processing definitions of large numbers of jobs without manually changing the jobs’ definitions individually.

Critical jobs bypass Workload Policy rules that limit Lock Resources, as described in Lock Resources.

To define parameter values for all Workload Policy objects at once, you can use a Defaults object, similar to the Defaults object use in JSON code for jobs.

The following code sample presents the objects and properties that you can use to define a Workload Policy. The rest of this page provides details about these objects and properties.

Copy
"Workload_Policy_1":
{
   "Type": "WorkloadPolicy",
   "Description": "My Workload Policy",
   "Filter":
   {
      "Folder": "Folder5",
      "Server": "LocalControlM",
      "Application": "app3",
      "SubApplication": "subapp7",
      "JobName": "MyJob",
      "Host": "host1"
   },
   "RunningJobs": [
   {
      "Server": "LocalControlM",
      "Quantity": "5",
      "RangeDates":
      {
         "ToDate": "20210711",
         "FromDate": "20210711"
      },
      "SpecificTime"
      {
         "ToTime": "1130",
         "FromTime": "1030"
      }
   },
   {
   "Server": "Global",
   "Quantity": "3",
   "PeriodicDays"
   {
      "DaysOfWeek": ["WED", "FRI"]
   },
   "SpecificTime"
   {
      "ToTime": "1100",
      "FromTime": "1000"
   }
}, ],
"ResourcePools": [
{
   "Server": "LocalControlM",
   "Resource": "pool1",
   "Quantity": "2",
   "PeriodicDays":
   {
      "DaysOfWeek": ["SAT", "SUN", "MON"]
   },
   "SpecificTime"
   {
      "ToTime": "2230",
      "FromTime": "1930"
   }
} ],
"HostMappings": [
{
   "Server": "LocalControlM",
   "Host": "host1",
   "MapTo": "host2"
},
{
   "Server": "LocalControlM",
   "Host": "host3",
   "MapTo": "host4"
} ] }

General Properties

Start your Workload Policy definitions with the following general properties:

Copy
"Workload_Policy_1": {
   "Type": "WorkloadPolicy",
   "Description": "My Workload Policy",

Filter Settings

Under the Filter object, define a combination of job attributes that determine which jobs are included in the Workload Policy, as in the following example:

Copy
"Filter": {
  "Folder": "Folder5",
  "Server": "LocalControlM",
  "Application": "app3",
  "SubApplication": "subapp7",
  "JobName": "MyJob",
  "Host": "host1"
},

You can include the following filters under the Filter object:

Filter

Description

Folder

Name of the folder that contains the jobs.

Server

Name of the Control-M/Server that processes the jobs.

Application

Name of an Application (logical grouping of jobs) that the jobs are associated with.

SubApplication

Name of a Sub-Application (logical sub-grouping of jobs within an Application) that the job is associated with.

JobName

Name of a job.

Host

Name of a Control-M/Agent computer, remote host computer, or host group where jobs are submitted.

RunningJobs Rules

Under a RunningJobs object, you can define multiple rules that limit the number of jobs that can run concurrently. The following example presents two such rules:

Copy
    "RunningJobs": [
      {
        "Server": "LocalControlM",
        "Quantity": "5",
        "RangeDates": {
          "ToDate": "20210711",
          "FromDate": "20210711"
        },
        "SpecificTime": {
          "ToTime": "1130",
          "FromTime": "1030"
        }
      },
      {
        "Server": "Global",
        "Quantity": "3",
        "PeriodicDays": {
          "DaysOfWeek": [
            "WED",
            "FRI"
          ]
        },
        "SpecificTime": {
          "ToTime": "1100",
          "FromTime": "1000"
        }
      },
    ],

Each RunningJobs rule has the following properties:

Property

Description

Server

Name of the Control-M/Server that processes the jobs

Quantity

Maximum number of jobs that are allowed to run concurrently

Scheduling Option

Definitions of a time period when the rules of the Workload Policy are applied to the jobs.

You can define various types of time periods by using any of the following objects:

  • RangeDates, optionally with SpecificTime.

  • PeriodicDays, optionally with SpecificTime.

  • RangeDatesWithTimes

  • DatesList, optionally with SpecificTime.

  • WeekDaysRange

  • SpecificTime (alone).

For more information about these objects and the scheduling parameters under each, see Scheduling Parameters for Job and Resource Pool Rules.

ResourcePools Rules

Under a ResourcePools object, you can define multiple rules that limit the number of resource pools (previously known as quantitative resources) that can be allocated to the jobs. The following example presents such a rule:

Copy
    "ResourcePools": [
      {
        "Server": "LocalControlM",
        "Resource": "pool1",
        "Quantity": "2",
        "PeriodicDays": {
          "DaysOfWeek": [
            "SAT",
            "SUN",
            "MON"
          ]
        },
        "SpecificTime": {
          "ToTime": "2230",
          "FromTime": "1930"
        }
      }
    ],

Each ResourcePools rule has the following properties:

Property

Description

Server

Name of the Control-M/Server that processes the jobs.

Resource

Name of the resource pool, previously known as a quantitative resource.

Max 2048 characters.

Quantity

Maximum number of the specified resource that can be allocated to the jobs.

Scheduling Option

Definitions of a time period when the rules of the Workload Policy are applied to the jobs.

You can define various types of time periods by using any of the following objects:

  • RangeDates, optionally with SpecificTime.

  • PeriodicDays, optionally with SpecificTime.

  • RangeDatesWithTimes

  • DatesList, optionally with SpecificTime .

  • WeekDaysRange

  • SpecificTime (alone).

For more information about these objects and the scheduling parameters under each, see Scheduling Parameters for Job and Resource Pool Rules.

Scheduling Parameters for Job and Resource Pool Rules

The following table describes the various types of time periods that you can define for scheduling job rules or resource pool rules:

Time Period

Description

Example

RangeDates

        +

SpecificTime

The range of days in the time period when the rule is applied.

Specify dates using the yyyymmdd format.

By default (if no dates or days are specified), the rule is applied to all dates/days.

Copy
"RangeDates": {
  "ToDate": "20210711",
  "FromDate": "20210711"
},
"SpecificTime": {
  "ToTime": "1130",
  "FromTime": "1030"
}
Copy
"RangeDates": {  
    "ToDate": "20210711",  
    "FromDate": "20210711"
}

Under SpecificTime, specify the range of hours each day when the rule is applied or not applied. Use the HHMM format, where HH ranges from 00 to 23, and MM is one of the four quarters of the hour (00, 15, 30, or 45).

For example:

  • If FROM TIME is 1000 and UNTIL TIME is 1300, the rule is applied between 10 AM and 1 PM each day.

  • If FROM TIME is 1300 and UNTIL TIME is 1000, the rule is applied during all hours of the day except for between 10 AM and 1 PM each day.

If no SpecificTime is specified, the rule is applied during the full 24 hours of each day.

PeriodicDays

        +

   SpecificTime

The days of the week to apply the rule.

In a DaysOfWeek array, specify individual days (for example: MON or TUE).

By default (if no dates or days are specified), the rule is applied to all dates/days.

Copy
"PeriodicDays": {  
    "DaysOfWeek": [  
        "WED",  
        "FRI"  
    ]
}

Under SpecificTime, specify the range of hours each day when the rule is applied or not applied, in HHMM format. For more information, see the description of SpecificTime above.

If no SpecificTime is specified, the rule is applied during the full 24 hours of each day.

RangeDatesWithTimes

A time period for applying the rule, defined by a start date and (optional) time and an end date and (optional) time.

Specify the date in yyyymmdd format and the time in HHMM format.

Copy
"RangeDatesWithTimes": {  
    "FromDate": "20210711",  
    "FromTime": "1415",  
    "ToDate": "20210714",  
    "ToTime": "1515"
}

DatesList

     +

   SpecificTime

Specific dates on which to apply the rule.

In a Dates array, specify any number of individual dates in yyyymmdd format.

By default (if no dates or days are specified), the rule is applied to all dates/days.

Copy
"DatesList": {  
    "Dates": [  
        "20210708"  
    ]
}

Under SpecificTime, specify the range of hours each day when the rule is applied or not applied, in HHMM format. For more information, see the description of SpecificTime above.

If no SpecificTime is specified, the rule is applied during the full 24 hours of each day.

WeekDaysRange

A time period for applying the rule, defined by a start day of the week and (optional) time and an end day of the week and (optional) time.

Specify the day of the week in the three-letter format and the time in HHMM format.

Copy
"WeekDaysRange": {  
    "FromDay": "Mon",  
    "FromTime": "1415",  
    "ToTime": "1515",  
    "ToDay": "Fri"
}

SpecificTime

If the SpecificTime object is used independently of any object for specifying dates or days (that is, not along with RangeDates, PeriodicDays, or DatesList), the rule is applied during the specified hours on all days.

Copy
"SpecificTime": {  
    "ToTime": "1130",  
    "FromTime": "1030"
}

Host Mapping Rules

Under the HostMappings object, you can define multiple for rules for routing jobs to a new host. The following example shows two mapping rules:

Copy
    "HostMappings": [
      {
        "Server": "LocalControlM",
        "Host": "host1",
        "MapTo": "host2"
      },
      {
        "Server": "LocalControlM",
        "Host": "host3",
        "MapTo": "host4"
      }
    ],

Each HostMappings rule has the following properties:

Property

Description

Server

Name of the Control-M/Server that processes the jobs.

Host

Name of a Control-M/Agent computer, remote host computer, or host group where jobs are submitted.

MapTo

Name of a target host or host group to which to route the jobs.