You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Job management
Creating jobs
Copy page
Download PDF
Creating jobs
You can create jobs in immediate, scheduled, and periodic execution modes. After being created, jobs are automatically executed by the cloud assistant Agent in the specified execution mode.​
Prerequisites​
Before jobs are executed by the cloud assistant, make sure that objects meet the following conditions:​
  • Status is Running (Running).​
Usage notes​
  • The maximum number of concurrent O&M tasks can not exceed 100.​
  • If your cloud assistant Agent version is ≤ v1.6.0 and you execute the systemd daemon-reload command while the cloud assistant Agent is running, jobs or PIDs launched via cloud assistant may have Cgroup drift. This can eventually cause CPU throttling or out-of-memory (OOM) issues for the affected job or process. For detailed upgrade instructions of the cloud assistant Agent, refer to Upgrading cloud assistant Agent.​
Procedure​
  1. Log in to the ECS console. ​
  1. In the left-side navigation pane, select "Maintenance & Monitoring > Cloud Assistant", and then select the "Job management" tab.​
tip​
When you access the cloud assistant for the first time, follow the system instructions and click the "Immediately create" button on the Cross-service access request page. This authorizes the platform official service account to access your ECS instance information. For details of the IAM feature that requires authorization, refer to IAM overview.​
  1. In the top menu bar, select the region where your business is located.​
  1. Click the "Create a job" button to enter the Create a job page.​
  1. Enter the following job information as instructed.​
  • ​
    Parameter​​
    Description​
    Sample value​
    Basic information​
    ​
    ​
    Job name​
    Set the job name.​
    Install the Cloud Monitor plugin​
    Execute command​
    ​
    ​
    Command source​
    Select the type of O&M command that you want to execute, with currently supported types as follows:​
    • Custom commands: If the preset commands do not meet your O&M requirements, you can create custom commands to perform O&M operations. For details, refer to Custom commands.​
    • Manual input: For simple O&M commands that require no dynamic content, you can manually enter the command here and directly create an O&M task for execution.​
    Public commands​
    Command​
    Select the public command or custom command that you need to execute.​
    Install Cloud Monitor Agent on Linux instance​
    Command type​
    When you select the "Manual input" command, you can use commands of the Linux Shell, Python, Windows PowerShell, or Windows Bat type.​
    -​
    Execute path (optional)​
    Enter the command execution path.​
    • For Linux instances, the default execution path is /home.​
    • For Windows instances, the default execution path is C:\Windows\System32.​
    /home​
    Parameter​​
    Specify values for custom parameters when you enter execution commands. For parameter descriptions, refer to Public command summary.​
    tip​
    You are required to specify parameter values only for commands that use custom commands and public commands.​
    -​
    Executing user​
    You can specify an existing user in the target instance to execute commands. We recommend that you avoid using the root user to reduce security risks.​
    tip​
    Specify a user with the permission to execute commands.​
    user1​
    Login password​
    Enter the login password for the execution user.​
    tip​
    You are required to enter the login password only if the command meets one of the following conditions:​
    • When the command source is "Public commands" or "Custom commands", the commands are Windows-related, and the execution user is not "system", you are required to enter the login password.​
    • When the command source is "Manual input", the command type is Windows PowerShell or Windows Bat, and the execution user is not "system", you are required to enter the login password.​
    -​
    Timeout period​
    Set the timeout period for command execution on each instance. If the command execution times out, the cloud assistant will mark the job as failed on the corresponding instance.​
    tip​
    The default timeout period varies by commands, and you can manually adjust it within the range of 30 seconds to 86,400 seconds.​
    60 seconds​
    Execution mode​
    ​
    ​
    Execution mode​
    For the job execution modes, the following options are available:​
    • Execute immediately: After the job is created, it is executed for one time immediately.​
    • Scheduled execution: The job is executed automatically once at the time you specify.​
    tip​
    • The execution time must be accurate to the minute and must not be earlier than the current time.​
    • You can manually stop scheduled jobs in the Waiting for execution or In progress state. For operation details, refer to Stopping jobs.​
    • Periodic execution: The job is executed automatically on a cycle starting from the specified start time, at intervals you specify (in minutes, hours, or days), and stops automatically at the specified end time. You need to configure the following information:​
    • Repeat cycle: Specify the interval at which the job is executed repeatedly. The repeat interval must be longer than the timeout period. Value:​
    • by minute: The minimum interval is 5 minutes.​
    • by hour: The minimum interval is 1 hour.​
    • by day: The minimum interval is 1 day.​
    • Start time: Specify the time when the periodic job is first executed. This time must be later than the current time.​
    • Stop time: Specify the time when the periodic job stops. The job automatically stops at this time. For jobs in the periodic execution mode, you can manually stop those in the Waiting for execution or Executing periodically state. For operation details, refer to Stopping jobs.​
    • If the job is not being executed at the stop time, it automatically stops and will never be executed again.​
    • If the job is being executed at the stop time, it automatically stops after the execution is complete and will never be executed again.​
    • If the interval between the stop time and the start time is less than one repeat cycle, the job is executed only once.​
    tip​
    The execution interval is independent of the actual execution duration of the job and is calculated based on the "Start time" you specify. For example, if the start time for a job is 2022-12-20 11:00:00, the repeat cycle is 1 hour, and the duration of the first execution is 3 minutes, the second execution starts at 2022-12-20 12:00:00.​
    Execute immediately​
    Execute object​
    ​
    ​
    Object​
    Select ECS instances that meet the requirements for you to execute the job by instance name, project, tag, or other information. You can select multiple instances at one time.​
    tip​
    You can select up to 200 ECS instances.​
    -​
    Advanced configuration​
    ​
    ​
    Project​
    You can add the Cloud assistant to the project and manage it uniformly by project dimension, which helps maintain resource independence and ensure data security. For more project details, refer to Project management.​
    default​
    Tag​
    A tag is a key-value pair used to identify resources. Tags help you categorize resources based on different dimensions, such as purpose, owner, or environment. This allows you to search and aggregate your resources. For more information about tags, refer to Tags.​
    Key1:Value1​
    ​
  1. Click the "Confirm" button to create the job.​
  1. After the job is created, the system automatically redirects you to the Job management page. The new job then executes automatically based on its execution method.​
warning​
The maximum number of concurrent O&M tasks can not exceed 100.​
Subsequent steps​
To learn about job execution results and statuses, refer to Viewing job execution results.​
Related documents​
  • RunCommand: Creates and executes commands on one or more ECS instances.​
  • InvokeCommand: Triggers an O&M assistant command for one or more ECS instances.​
Last updated: 2026.06.18 17:49:49