After you create Cloud Assistant commands, you can run them on one or more ECS instances. The execution status and results on multiple instances do not affect each other.
- The instances are in the Running (
- The instances are installed with the Cloud Assistant client. For more information, see Install the Cloud Assistant client.
- 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 instances in batches.
- You can run Cloud Assistant commands up to 5,000 times within a region per day. The
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 you can run Cloud Assistant commands within in a region per day.
Procedure in the console
- Log on to the ECS console and navigate to the Cloud Assistant page.
- 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 pane that appears, configure the parameters.
- Optional:Click View to check the command content. If the command is incorrect, modify the command before you run it.
- In the Parameters field, enter values for the custom parameters that are specified in the command.
The data type format of values for the custom parameters is not limited. If the current API call does not require values for the custom parameters, you can enter empty strings.Note If you do not select Use Parameters when you create a command, the Parameters field is not displayed in the Create Task pane.
- In the Select Instance section, select one or more instances.If you have multiple instances, you can enter an instance ID or name to search for the instance, and select a specific tag or client status from the drop-down lists to narrow down the searching results.
- Optional:Click View to check the command content.
- Click Create Task.
Procedure by using CLI
- Optional:Check the status of the target instances. If the instances are not in the Running (
Running) state, call the StartInstance operation to run the target instances.
aliyun ecs StartInstance --InstanceId i-bp1g6zv0ce8og******p
- Optional:Call the DescribeCloudAssistantStatus operation to query whether Cloud Assistant clients are installed on the target instances.
CloudAssistantStatus=trueis returned, Cloud Assistant clients are installed. Otherwise, call the InstallCloudAssistant operation to install Cloud Assistant clients on the target instances.
- Call the InvokeCommand operation to run the created Cloud Assistant command on the target instances and
obtain the response parameter InvokeId.
You can specify the execution cycles of recurring tasks by setting the
aliyun ecs InvokeCommand --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p --InstanceId.2 i-bp1g6zv0ce8og******p --CommandId your-command-id --Timed false --output cols=InvokeId
Timedparameter to true and specifying the Frequency parameter. For example, 0 */20 * * * * indicates that the execution cycle is 20 minutes. For more information, see Cron expression.