Cloud Assistant is a native automated operations and maintenance (O&M) tool developed for Elastic Compute Service (ECS). It allows you to batch maintain ECS instances and batch execute scripts on and send files to ECS instances in a password-free, logon-free manner without the use of jumper servers. Typically, you can use Cloud Assistant to install and uninstall software, start and stop services, distribute configuration files, and execute commonly used commands or scripts.

Features

After ECS instances that are installed with the Cloud Assistant client enter the Running (Running) state, you can use Cloud Assistant to perform the following operations on the instances by using the ECS console or by calling API operations:
  • Run batch and PowerShell scripts on Windows instances, or run shell scripts on Linux instances.
  • Upload files to the instances.
  • Run the same command on multiple instances. The execution state and results of one instance do not affect the other instances.
  • Configure custom parameters in Cloud Assistant commands to adapt to different scenarios.
Note Cloud Assistant does not proactively initiate operations. You have full control over all Cloud Assistant operations.

Use 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 the scripts that are already installed 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

Billing

Cloud Assistant is provided free of charge.

However, you may be charged for the ECS resources used by Cloud Assistant to execute deployment and O&M tasks. For more information about the billing of ECS resources, see Billing overview.

Limits

  • Only API operations can be used to configure the recurring executions of a Cloud Assistant command. The interval at which the command is run cannot be less than 10 seconds.
  • For each command, the total size of the Base64-encoded batch, PowerShell, or shell scripts together with the Base64-encoded custom parameters cannot exceed 16 KB.
  • The size of a Base64-encoded file to send cannot exceed 32 KB.
  • Each command can contain a maximum of 20 custom parameters.
  • Cloud Assistant commands can be run only on instances that use the following operating systems:
    • Alibaba Cloud Linux
    • CentOS 6, CentOS 7, and CentOS 8 and later
    • CoreOS
    • Debian 8, Debian 9, and Debian 10 and later
    • OpenSUSE
    • RedHat 5, RedHat 6, and RedHat 7 and later

      For Red Hat instances, you must download the RPM package to install the Cloud Assistant client. For more information, see Install the Cloud Assistant client.

    • SUSE Linux Enterprise Server (SLES) 11, SLES 12, and SLES 15 and later
    • Ubuntu 12, Ubuntu 14, Ubuntu 16, and Ubuntu 18 and later
    • Windows Server 2012, Windows Server 2016, and Windows Server 2019 and later

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

Terms

The following table describes relevant terms in Cloud Assistant.

Term Description
Cloud Assistant A tool provided by Alibaba Cloud that can help you perform routine maintenance tasks on multiple ECS instances and ECS bare metal instances at a time. Cloud Assistant is available in all Alibaba Cloud regions.
Cloud Assistant client A lightweight plug-in that can be installed on ECS instances to run Cloud Assistant commands.
  • On Windows instances, the process of the client program is AliyunService.
  • On Linux instances, the process of the client program is aliyun.service.
Cloud Assistant daemon process A daemon process that is used to monitor the resource consumption of the Cloud Assistant client, report the running state of the client, and restart the client when the client fails.
  • Service name: AssistDaemon
  • Path: /usr/local/share/assist-daemon/assist_daemon
Note The Cloud Assistant daemon process is available only for Linux instances.
task execution path
A path in which Cloud Assistant saves your command as a file on an ECS instance and executes the file. The path varies based on the operating system.
  • Linux: /tmp
  • Windows: <Installation path of Cloud Assistant>/work/script
command A specific command such as a shell script or a PowerShell script that can be run on ECS instances.
custom parameter A variable that is configured in the {{key}} format in a command. You can specify a custom parameter and its value in the {{"<key>":"<value>"}} format when you create a task to run the command. The number of Cloud Assistant commands that you can have within each Alibaba Cloud region is limited. To adapt Cloud Assistant commands to multiple scenarios, we recommend that you configure custom parameters.
one-time execution An execution (Invocation) that runs a command only once on one or more instances.
recurring execution An execution that periodically runs a command on one or more instances based on your specified schedule.
execution state The relationships among different types of execution states. For more information, see Overview.

Execution states

The following table describes the instance-level execution state of a command that is run on a single instance. The InvocationStatus parameter in API indicates the execution state of a command.

Execution state in an API operation Execution state in the ECS console Description
Running Task Running The command is being run.
Stopping Task Stopping The command is being stopped.
Stopped Manually Stopped The command is stopped.
Finished Task Completed The command is run to completion. This does not indicate that the command succeeds. You can check whether the command succeeds based on the output (Output) and the exit code (ExitCode).
Failed Task Failed The command cannot be run or the command process cannot run to completion before the timeout period specified by Timeout expires.

States of batch executions and recurring executions

A batch execution is a one-time execution that runs a command on multiple instances. To better manage batch executions and recurring executions, you can manage the lifecycles of the executions based on the overall execution status, the instance-level execution status, and the record-level execution status. The InvokeStatus parameter in API indicates the execution status of a command. The following figure shows the relationships among the three types of execution states. Relationships among the three types of execution states
  • The following table describes the overall execution states of a command that is run on multiple instances at the same time.
    Execution state in an API operation Execution state in the ECS console Description Priority
    Running Task Running The instance-level execution state is Running on some or all instances. 1
    Stopping Task Stopping The instance-level execution state is Stopping on some or all instances. 2
    Stopped Manually Stopped The instance-level execution state is Stopped on all instances. 3
    Failed Task Failed The instance-level execution state is Failed on all instances, or is Failed on some instances and is Stopped on the other instances. 4
    Finished Task Completed The instance-level execution state is Finished on all instances, or is Finished on some instances and is Stopped on the other instances. 5
    PartialFailed Partially Failed The instance-level execution state is Failed on some instances and is Finished on the other instances. 6
    The following figure shows the relationship between the overall execution states and the instance-level execution states of a one-time execution that runs a command on three instances at the same time. Lifecycle of a one-time execution on multiple instances
  • The following table describes the states of recurring executions of a command.
    State Description
    Overall execution state The overall execution state is always Running (Running) unless you stop the command on all the instances.
    Instance-level execution state For each instance, the instance-level execution state is always Running (Running) unless you stop the command on the instance.
    Record-level execution state For more information, see Overview.

Related operations

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

Business requirement References API operation
The Cloud Assistant client must be installed on an ECS instance before Cloud Assistant can be used on the instance. By default, ECS instances that were created after December 01, 2017 from public images have the Cloud Assistant client pre-installed. You must manually install the Cloud Assistant client on some ECS instances. Install the Cloud Assistant client
You are familiar with using OpenAPI Explorer and this is the first time that you use Cloud Assistant. N/A
Create a Cloud Assistant command. Create a command
Run a created command on ECS instances. Run a command
View the execution states and results of commands. Execution results are the actual outputs generated on the specified instances. Query execution results and fix common problems
Modify a created command. You can modify the name and description of the command. Modify a command N/A
Create a new version of a Cloud Assistant command or modify the properties of the command such as the name, description, type, content, execution path, or timeout period. Clone a command N/A
Stop a running command. Stop a command StopInvocation
Delete Cloud Assistant commands that are no longer needed to free up quotas for new commands. Delete a command DeleteCommand