Updated on 2024-11-20 GMT+08:00

Executing a Custom Job

Execute recorded custom jobs.

Scenarios

Execute a custom job on Cloud Operations Center.

Precautions

Before executing a job, ensure that you have the resource permissions of target instances.

Procedure

  1. Log in to COC.
  2. In the navigation pane on the left, choose Resource O&M > Automated O&M. In the Routine O&M area, click Jobs.

    Figure 1 Job Management page

  3. On the Job Management page, click the Custom Jobs tab, locate the job to be executed, and click Execute in the Operation column.

    Figure 2 Clicking Execute

  4. Select a job version number and check whether the job steps meet the expectation.

    Figure 3 Checking the job steps

  5. Select the execution type.

    Execution Type includes Single and Cross Account.
    Figure 4 Execution Type

  6. Select IAM Agency. The IAM agency is used to switch the user role during the runbook execution and execute the job.

    Figure 5 Selecting the IAM agency

  7. If you select Cross Account, you need to set the execution rule.

    • Currently, BMS API call and scripts cannot be executed across accounts.
    • To use this function, you need to add the account to the organization, configure the agency permissions, and enter the agency name in advance. For details, see Cross-Account Management.
    Figure 6 Account and Region

    Parameter description:

    Account: tenant account name, which can be viewed on the My Credentials page.

    Figure 7 Viewing the account name

    Region: region where the target object is located.

    Agency: name of the agency in IAM

    Figure 8 Obtaining the agent name

    Project ID: ID of the project to which the target object belongs.

    Figure 9 Viewing project information
    Figure 10 Obtaining a Project ID

  8. Enter basic execution information, including the execution description and tag. You can create tags by following the instructions provided in Tag Management.

    Figure 11 Entering basic execution information

  9. Select the execution mode of the job on the target instance. The options are Consistent for all steps and Unique for each step.

    Table 1 Target instance mode description

    Target Instance Mode

    Description

    Consistent for all steps

    All steps in this job are performed on the target instance in sequence.

    Unique for each step

    Customized configuration. You can configure that the specified step is executed only on the specified target instance.

    Figure 12 Selecting Consistent for all steps
    Figure 13 Selecting Unique for each step

  10. Click + Add instances. In the displayed dialog box, select the target region, search for the target instances by name or UniAgent status and select them, click OK.

    Figure 14 Selecting the target instance

  11. Select a batch policy.

    • Automatic: The selected instances are divided into multiple batches based on the default rule.
    • Manual: You can manually divide instances into multiple batches as needed.
    • No batch: All target instances are in the same batch.
    Figure 15 Selecting a batch policy

  12. Click Submit to execute the custom job. The Job Ticket Details page is displayed. View the execution status of jobs and each batch on the details page.

    • Click Forcibly End to end all tasks of the job. Currently, the sub-service tickets such as the script service tickets and patch service tickets will not be ended..
    • Click Terminate All to end the tasks of all batches in the current step.
      • If you click Terminate All, the next batch will not be executed. However, the execution of instances in the script will not be terminated.
      • If a script is delivered by the UniAgent and is in the running state, it cannot be stopped. You can stop it until the execution is complete.
      Figure 16 Job ticket details