Modify Cloud Assistant task execution information

Updated at:
Copy as MD

If a task no longer meets your requirements, you can modify its execution information. You can modify the command content, change the execution schedule, or add ECS instances or managed instances to the task. This topic describes how to modify task execution information in the Cloud Assistant console.

Limitations

To modify a task's execution information, you must meet the following conditions:

  • You can modify a task only if its execution plan is Timing execution, After the next startup of the system, or After each system startup.

  • The task must be in one of the following execution statuses:

    • Pending: The system is verifying or sending the command. The overall execution status is Pending if the command is in this state on at least one instance.

    • Running: The command is running on the instances. The overall execution status is Running if the command is in this state on at least one instance.

    • Scheduled: The scheduled command has been sent and is waiting to run. The overall execution status is Scheduled if the command is in this state on at least one instance.

    • Stopping: The task is being stopped. The overall execution status is Stopping if the command is in this state on at least one instance.

  • To modify information such as command content, custom parameters, and execution frequency, instances that have already run the task must meet the following requirements:

    • The instance is in the Running state.

    • The Cloud Assistant Agent is installed. For more information, see Install the Cloud Assistant Agent.

    • The Cloud Assistant Agent must meet the following minimum version requirements. This requirement does not apply if you are only adding ECS instances or managed instances to the task:

  • When you add ECS instances or managed instances to a scheduled task, the total number of existing and new instances cannot exceed 100.

  • Modifying the command content (CommandContent) for a task created by calling the InvokeCommand or RunCommand operation with the KeepCommand parameter set to true creates a new, permanent command that consumes your Cloud Assistant command quota.

  • In an Alibaba Cloud region, you can save 500 to 50,000 Cloud Assistant commands. Your quota may increase based on your ECS usage. To view your quota or request an increase, see ECS quota management.

  • You cannot modify the command content (CommandContent) of a task that runs a public Cloud Assistant command.

  • A RAM user must have the required permissions to modify the execution information of a task. For more information, see Modify the execution information of a scheduled task.

Procedure

  1. Go to ECS console - Cloud Assistant.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. On the Command execution result tab, find the task and click Modify Execution Information in the Actions column.

  4. In the Modify Execution Information panel, modify the execution parameters.

    1. Configure parameters related to the command content.

      The Modify Command Content option is enabled by default.

      By default, Use Parameters is disabled. If you enable this option, you can use built-in environment variables as custom parameters. When the command runs, Cloud Assistant automatically replaces these variables with their corresponding values, such as the instance ID or region ID.

    2. Select an Execution Schedule and configure its parameters.

      Note

      If the task execution plan is After the next startup of the system or After each system startup, you cannot select an execution schedule.

      Execution schedule

      Description

      Run at Fixed Interval

      Set an Execution Frequency. The interval must be between 60 seconds and 7 days, and must be longer than the task's timeout period. This schedule is based on a rate expression.

      Run Only Once at Specified Time

      Set the execution time and time zone.

      Run on Clock-based Schedule

      Set an Execution Frequency. The interval must be 10 seconds or longer, and must not be shorter than the task's timeout period. This schedule is based on a cron expression.

    3. In the Select Instances and Select Managed Instances sections, select the instances to add to the task.

  5. Click Modify.

    After you save the changes, the task runs based on the new configuration.

References

You can also call the ModifyInvocationAttribute API operation to modify task execution information.