After you create a Cloud Assistant command, you can run it on one or more ECS instances.
The execution status and results of this command on the instances do not affect each
other.
Prerequisites
The instances on which you want to run a Cloud Assistant command meet the following
requirements:
- The instances are in the Running (
Running
) state.
- The instances are installed with the Cloud Assistant client. For more information,
see Install the Cloud Assistant client.
Background information
- You can run a command on a maximum of 50 instances at a time by calling an API operation.
- If you select more than 50 instances to run a command in the ECS console, the system
automatically runs the command on the instances in batches.
- You can run Cloud Assistant commands up to 5,000 times within a region per day. This
quota may increase with your ECS usage.
Note You can also call the DescribeAccountAttributes operation with the AttributeName.N parameter set to max-axt-invocation-daily to query the maximum number of times that you can run Cloud Assistant commands within
in a region per day.
Procedure in the console
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the command that you want to run and click Create Task in the Actions column.
- In the Create Task panel, configure the parameters.
- Optional:Click View to check the command.
If the command is incorrect, modify the command before you run it.
- In the Command Parameters fields, enter values for the custom parameters specified in the command.
No format limits apply to the data types of values for the custom parameters. If the
current task does not require values for these fields, you can leave the fields empty.
Note If you did not select Use Parameters when you create the command, the Command Parameters fields are not displayed in the Create Task panel.
- In the Select Instances section, select one or more instances.
If you have multiple instances, you can enter instance IDs or names to search for
instances, and select tags or client status as filter conditions from the drop-down
list to narrow down the searching results.
- Click Create Task.
Procedure by using CLI
- Optional:Check the status of the instances on which you want to run a command. If the instances
are not in the Running (
Running
) state, call the StartInstance operation to start the instances. aliyun ecs StartInstance --InstanceId i-bp1g6zv0ce8og******p
- Optional:Call the DescribeCloudAssistantStatus operation to check whether the Cloud Assistant client is installed on the instances.
If the value of CloudAssistantStatus
is true in the response, the Cloud Assistant client is installed on the instances.
Otherwise, call the InstallCloudAssistant operation to install the Cloud Assistant client on the instances.
- Call the InvokeCommand operation to run a created Cloud Assistant command on the instances and obtain the
InvokeId response parameter.
aliyun ecs InvokeCommand --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p --InstanceId.2 i-bp1g6zv0ce8og******p --CommandId your-command-id --Timed false --output cols=InvokeId
You can specify the execution cycles of recurring tasks by setting
Timed
to true and specifying the
Frequency parameter. For example,
0 */20 * * * * indicates that the execution cycle is 20 minutes. For more information about cron
expressions, see
Cron expression.