Cloud Assistant is a built-in tool for ECS that provides O&M and deployment services. Cloud Assistant can automatically run batch, PowerShell, or shell scripts on multiple instances at a time, allowing you to perform multiple tasks without establishing individual connections to these instances. These tasks include running automated O&M scripts, polling the processes, installing or uninstalling software, updating applications, and installing patches.

Scenarios

Cloud Assistant can help you perform deployment and O&M tasks on ECS instances. The following list provides some examples:

  • Uploading and running automated O&M scripts
  • Running existing scripts on instances
  • Managing software lifecycle
  • Deploying code or applications
  • Polling processes
  • Installing patches or security updates
  • Obtaining updates from Object Storage Service (OSS) or YUM repositories
  • Changing hostnames or user logon passwords

Features

After you install the Cloud Assistant client on ECS instances, you can use Cloud Assistant to perform the following operations on the instances in the ECS console or by calling API operations:
  • Run batch, PowerShell (for Windows instances), or shell (for Linux instances) scripts on one or more instances that are in the Running (Running) state.
  • Run the same script on multiple instances. Executions on these instances do not affect each other.
  • Set custom parameters of a Cloud Assistant script to adapt the script to suit the needs of multiple scenarios.
    Note Cloud Assistant does not proactively initiate operations. You have full control over all Cloud Assistant operations.

Billing method

Cloud Assistant is provided free-of-charge.

However, you may be charged for the ECS resources used by Cloud Assistant to deploy and maintain ECS instances. For more information about the billing of ECS resources, see Billing overview.

Terms

The following table describes relevant terms of Cloud Assistant.

Term Description
Cloud Assistant A tool provided by Alibaba Cloud that can automatically perform routine maintenance tasks on multiple ECS instances or ECS Bare Metal Instances. Cloud Assistant is available in all Alibaba Cloud regions.
Cloud Assistant client A lightweight plug-in that is installed on an ECS instance to run all the scripts on the instance.
  • In Windows instances, the process of the client program is AliyunService.
  • In Linux instances, the process of the client program is aliyun.service.
script The specific script to be run on an ECS instance, such as a shell script or a PowerShell script.
custom parameter The variable value that you set in the script, which is expressed in the {{key}} format. You can set a custom parameter and its value in the {{"key":"value"}} format when you run a script. You can create a limited number of Cloud Assistant scripts in each Alibaba Cloud region. We recommend that you configure custom parameters to adapt Cloud Assistant scripts to suit multiple scenarios.
one-time task A one-time task (invocation) occurs when you run one task on one or more instances.
recurring task A recurring task occurs when you specify the time series or period to run a task periodically on one or more instances.
task status The execution status of a task. For more information, see the Execution status of a task section.

Limits

  • You can use only API operations to set recurring scripts. The recurring interval cannot be less than 10 seconds.
  • The total size of the Base64-encoded batch, PowerShell, or shell script together with custom parameters cannot exceed 16 KB.
  • Each script can contain a maximum of 20 custom parameters.
  • Cloud Assistant scripts can be run only in the following operating systems:
    • Aliyun Linux.
    • CentOS 6, CentOS 7, CentOS 8, and later.
    • CoreOS.
    • Debian 8, Debian 9, Debian 10, and later.
    • openSUSE.
    • RedHat 5, RedHat 6, RedHat 7, and later. However, you need to manually download an RPM package to install the Cloud Assistant client. For more information, see Install the Cloud Assistant client.
    • SUSE Linux Enterprise Server 11, SUSE Linux Enterprise Server 12, SUSE Linux Enterprise Server 15, and later.
    • Ubuntu 12, Ubuntu 14, Ubuntu 16, Ubuntu 18, and later.
    • Windows Server 2012, Windows Server 2016, Windows Server 2019, and later.

For more information about the limits and quotas of Cloud Assistant, see the "Cloud Assistant limits" section in Limits.

References

You can use Cloud Assistant in the ECS console or by calling an API operation.

Business requirement Reference API operation
Install the Cloud Assistant client. An ECS instance must be installed with the Cloud Assistant client before Cloud Assistant can be used. By default, instances created after December 01, 2017 are pre-installed with the Cloud Assistant client. Therefore, you need to manually install the Cloud Assistant client for some ECS instances. Install the Cloud Assistant client
Use Cloud Assistant for the first time and you are comfortable with using OpenAPI Explorer. N/A
Create a Cloud Assistant script. Create a script
Run a created script on the target instances. Run a script
View the execution status and results of tasks. Execution results are the actual outputs generated in the specified instances. View the execution result of a script
Modify a created script. You can modify the name and description of the script. Modify a script N/A
Create a new version of an existing Cloud Assistant script, or modify the properties of a script such as the name, description, type, content, execution path, or timeout period. Clone a script N/A
Stop a running script. Stop a script StopInvocation
Delete unneeded scripts so that you can have sufficient quota to create new scripts. Delete a script DeleteCommand

Execution status of a task

The following table describes the execution status of a task running on an instance. The corresponding API parameter is InvocationStatus.

Status in an API operation Status in the console Description
Running Task Running The task is being run.
Stopping Task Stopping The task is being stopped.
Stopped Manually Stopped The task has been stopped.
Finished Task Completed The task execution is completed. However, this does not indicate that the task succeeds. You can check whether the task succeeds based on the actual output and exitcode returned by the process.
Failed Task Failed The task cannot be run or the execution process exceeds the timeout period.

Execution status during batch execution

To better manage batch executions and recurring executions, you can manage the lifecycle of a task from the perspectives of the overall execution status, the execution status on a single instance, and the execution status of each task. The corresponding API parameter is InvokeStatus. The following figure shows the relationship among the three types of execution status.Relationship among the three types of execution status
  • The following table shows execution status of a task during batch executions.
    Status in an API operation Status in the console Description Priority
    Running Task Running The task is running on some or all instances. 1
    Stopping Task Stopping The task is being stopped on some or all instances. 2
    Stopped Manually Stopped The task has been stopped on all instances. 3
    Failed Task Failed The task has failed on all instances or the task is failed on some instances and has been stopped on the other instances. 4
    Finished Task Completed The task is completed on all instances or the task is completed on some instances and has been stopped on the other instances. 5
    PartialFailed Partially Failed The task has failed on some instances and is completed on the other instances. 6
    The following figure uses a group of three instances as an example to show the relationship between the overall execution status and the execution status on a single instance when the task is run on three instances at the same time.Lifecycle of a task during batch executions
  • The following table shows execution status of a recurring task.
    Status Description
    Overall execution status The overall execution status is always Running (Running) unless you stop the task from running on all the instances.
    Execution status on a single instance The execution status on a single instance is always Running (Running) unless you stop the task from running on a single instance.
    Execution status of each task For more information, see the Execution status of a task table.