Cloud Assistant is a built-in O&M and deployment service of ECS. You can use Cloud Assistant in the ECS console or by calling API operations. Cloud Assistant can automatically run batch, PowerShell, or Shell scripts on multiple instances at a time to perform various tasks, freeing you from connecting 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, including:

  • Run automated O&M scripts
  • Run existing scripts on instances
  • Manage software lifecycle
  • Deploy code and applications
  • Poll processes
  • Install patches
  • Obtain updates from Object Storage Service (OSS) or YUM Repositories
  • Change 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:
Note Cloud Assistant does not proactively initiate operations. You have full control over all Cloud Assistant operations.
  • Run batch, PowerShell (for Windows instances), or Shell scripts (for Linux instances) on one or more instances that are in the Running state.
  • Run the same script on multiple instances that have the Cloud Assistant client installed. These instances do not affect each other. Have the ECS instances stay in a specific status and obtain their monitoring and log information or daemon.
  • Set custom parameters for a Cloud Assistant script to adapt the script to multiple scenarios.

Billing

Cloud Assistant is free to use.

However, you may be charged for the ECS resources incurred 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.

Table 1. Terms of Cloud Assistant
Term Description
Cloud Assistant A tool provided by Alibaba Cloud to perform batch operations of maintenance tasks on multiple ECS instances or ECS Bare Metal Instances. Cloud Assistant is available in all Alibaba Cloud regions.
Cloud Assistant client A client program that is installed on an ECS instance to run all the scripts in the instance. The process name for this client program in a Windows instance is AliyunService and that in a Linux instance is aliyun.service.
script The specific script to be invoked on an ECS instance, such as a Shell script or a PowerShell script.
custom parameter The variable you set in a script, which is expressed as {{key}}. You can set a custom parameter and its value as {{"key":"value"}} when you invoke a script. You can retain 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 multiple scenarios.
one-time invocation One-time invocation occurs when you invoke one script on one or more instances.
periodic invocation You can specify the time series or period to run a script periodically on one or more instances.
invocation status The status of script invocation. For more information, see Invocation status of scripts.

Limits

  • You can set periodic Cloud Assistant scripts only by using API operations and the specified script execution frequency must be no less than 10 seconds.
  • The 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 is supported only by the following operating systems: Windows Server 2008, 2012, and 2016, Ubuntu 12, 14, and 16, CentOS 5, 6, and 7, Debian 7, 8, and 9, Red Hat 5, 6, and 7, SUSE Linux Enterprise Server 11 and 12, OpenSUSE, Aliyun Linux, and CoreOS.

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

Invocation status of a script

When you invoke one script on one ECS instance (single invocation), invoke one script on multiple instances at the same time (batch invocations), and periodically invoke one script on one instance (periodic invocations), the invocation status of the script varies. This section describes the invocation status of a script in the preceding three scenarios.

A script may have the following status in the single invocation scenario.

Table 2. Invocation status during single invocation
Script status API status Description
Being invoked Running The script is being invoked.
Stopped Stopped The script is stopped during its invocation.
Invocation finished Finished The script invocation is finished. However, this does not indicate the invocation succeeds. You can check whether the invocation succeeds based on the output of the script process.
Invocation failed Failed The script invocation is not completed for any reason when the timeout period expires.

To better manage batch invocations and periodic invocations, you can manage the lifecycle of a script from the perspectives of the overall invocation status, the invocation status on each instance, and the invocation status of each script. The following figure shows the relationship among the three types of invocation status.

Figure 1. Relationship among the three types of invocation status
Relationship among the three types of invocation status
Table 3. Invocation status of a script during batch invocations
Status How the script operates Displayed status
Overall invocation status The invocation status on all instances is Finished. Finished

The invocation status on some instances is Finished

and that on some instances is Stopped.

The invocation status on all instances is Failed. Failed
The invocation status on all instances is Stopped. Stopped
The invocation status on all or some instances is Running. Running
The invocation status on some instances is Failed. Some failed
Invocation status on each instance The invocation status on each instance is the same as that of each script because batch invocations are one-time operations.
Invocation status of each script See the table Invocation status during single invocation

The following figure shows the relationship between the overall invocation status and the invocation status of each instance when batch invocations occur on all three instances.

Figure 2. Invocation status during batch invocations
Lifecycle of a script during batch invocations
Table 4. Invocation status during periodic invocations
Status Description
Overall invocation status The overall invocation status always stays at Running unless you stop the invocation on all instances.
Invocation status on each instance The invocation status on each instance always stays at Running unless you stop the invocation on the instance.
Invocation status of each script See the table Invocation status during single invocation

References

You must install the Cloud Assistant client on the ECS instance before you can use Cloud Assistant. For information about the installation steps, see Install the Cloud Assistant client.

For information about Cloud Assistant practices, see Best practices for using Cloud Assistant for automatic O&M.

API operations: