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 run commands on and send files to ECS instances in a password-free, logon-free manner without the use of jumper servers. These commands can consist of shell, PowerShell, or batch scripts. Typically, you can use Cloud Assistant to install and uninstall software, start and stop services, distribute configuration files, and run commonly used commands (scripts).

Features

After ECS instances that have the Cloud Assistant client installed 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, Python, and Perl 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 other instances.
  • Configure custom parameters in Cloud Assistant commands to adapt to different scenarios.
Note Cloud Assistant does not initiate any operations on its own. 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 scripts that are already uploaded to instances
  • Managing software lifecycle
  • Deploying code or applications
  • Polling processes
  • Installing service-related patches or security updates
  • Obtaining files from Object Storage Service (OSS) or YUM repositories to update applications on ECS instances
  • 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

  • Python or Perl scripts can be run only by using the ECS console.
    Note The instances that you want to run commands on or send files to must have the correct runtime environment.
  • For files or commands that consist of batch, PowerShell, or shell scripts with custom parameters, the following limits apply to their sizes after Base64 encoding:
    • If a command is created not by using the immediate execution feature, the command cannot exceed 18 KB in size after Base64 encoding.
    • If a command is created and run simultaneously by using the immediate execution feature and is saved, the command cannot exceed 18 KB in size after Base64 encoding.
    • If a command is created and run simultaneously by using the immediate execution feature but is not saved, the command cannot exceed 24 KB in size after Base64 encoding.
    • A file that you want to upload cannot exceed 32 KB in size after Base64 encoding.
  • Each command can contain up to 20 custom parameters.
  • Cloud Assistant commands can be run only on instances that use the following operating system versions:
    • Alibaba Cloud Linux
    • CentOS 6, CentOS 7, CentOS 8, and later
    • CoreOS
    • Debian 8, Debian 9, Debian 10, and later
    • OpenSUSE
    • Rocky Linux
    • Red Hat 5, Red Hat 6, Red Hat 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 or later
    • Ubuntu 12, Ubuntu 14, Ubuntu 16, and Ubuntu 18 or later
    • Windows Server 2012, Windows Server 2016, and Windows Server 2019 or later

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

Resources

The Cloud Assistant client uses the resources of the host where the client is installed. The following table describes the used host resources.

Host resourceLinux operating systemWindows operating system
CPUThe average CPU utilization is less than 1%.
Physical memoryAbout 17 MB of physical memory is used.About 10 MB of physical memory is used.
Disk I/OThe Cloud Assistant client involves almost no disk I/O operations when it is working as expected. The Cloud Assistant client involves disk I/O operations only in scenarios such as those in which upgrade packages are downloaded and in which command scripts are saved.
Network I/OA few network I/O operations are performed only to report data such as heartbeat data when the Cloud Assistant client is working as expected.

Terms

The following table describes relevant terms in Cloud Assistant.

TermDescription
Cloud AssistantA tool provided by Alibaba Cloud that can help you perform routine maintenance tasks on multiple ECS instances and ECS bare metal instances. Cloud Assistant is available in all Alibaba Cloud regions.
Cloud Assistant clientA 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 named AliyunService.
  • On Linux instances, the process of the client program is named aliyun.service.
Cloud Assistant daemon processA 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
commandA specific command (such as a command that consists of a shell or PowerShell script) that can be run on ECS instances.
custom parameterA 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. You can also specify built-in environment parameters as custom parameters in a command. Then, when you run the command, the custom parameters can be automatically specified by Cloud Assistant.
one-time executionThe execution (Invocation) of a one-time task. A one-time task runs a command only once on one or more instances.
scheduled executionAn execution of a scheduled task. A scheduled task runs a command on one or more instances based on a specified schedule.
execution statusThe relationships among different types of execution states. For more information, see Execution states.

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 operations indicates the execution state of a command.

Execution state in API operationsExecution state in the ECS consoleDescription
RunningTask RunningThe command is being run.
StoppingStoppingThe command is being stopped.
StoppedManually StoppedThe command is stopped.
FinishedTask CompletedThe command is run to completion. This does not indicate that the command is successful. You can check whether the command is successful based on the command output (Output) and the exit code (ExitCode).
FailedTask FailedThe command cannot be run or the command process cannot be run to completion before the timeout period specified by Timeout expires.

States of batch executions and scheduled executions

A batch execution is a one-time execution in which a command is run on multiple instances. To better manage batch executions and scheduled executions, you can manage the lifecycles of the executions based on the overall execution states, instance-level execution states, and execution-level states. The InvokeStatus parameter in API operations 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 API operationsExecution state in the ECS consoleDescriptionPriority
    RunningTask RunningThe instance-level execution state is Running on some or all instances. 1
    StoppingStoppingThe instance-level execution state is Stopping on some or all instances. 2
    StoppedStoppedThe instance-level execution state is Stopped on all instances. 3
    FailedTask FailedThe instance-level execution state is Failed on all instances, or is Failed on some instances and is Stopped on the other instances. 4
    FinishedTask CompletedThe instance-level execution state is Finished on all instances, or is Finished on some instances and is Stopped on the other instances. 5
    PartialFailedPartially FailedThe 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 in which a command is run on three instances. Lifecycle of a one-time execution on multiple instances
  • The following table describes the states of scheduled executions of a command.
    StateDescription
    Overall execution stateThe overall execution state is always Running (Running) unless you stop the command on all the instances.
    Instance-level execution stateFor each instance, the instance-level execution state is always Running (Running) unless you stop the command on the instance.
    Execution-level stateFor more information, see Execution states.

Related operations

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

ScenarioReferencesAPI 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 from public images after December 01, 2017 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. Check execution results and troubleshoot common issues
Modify a created command. You can modify the name and description of the command. Modify a commandN/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 commandN/A
Stop a running command. Stop a commandStopInvocation
To free up quotas for new commands, you can delete Cloud Assistant commands that are no longer needed. Delete a commandDeleteCommand