All Products
Search
Document Center

Elastic Compute Service:FAQ about O&M and monitoring

Last Updated:Oct 30, 2024

This topic provides answers to some frequently asked questions about O&M and monitoring of Elastic Compute Service (ECS).

FAQ about Cloud Assistant

What operating systems does Cloud Assistant support?

  • Alibaba Cloud Linux

  • CentOS 6, CentOS 7, and CentOS 8 and later

  • CoreOS

  • Debian 8, Debian 9, and Debian 10 and later

  • OpenSUSE

  • Red Hat 5, Red Hat 6, and Red Hat 7 and later

    Note

    For Red Hat instances, you must download the Red Hat Package Manager (RPM) package to install Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

  • 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

Note
  • By default, Cloud Assistant Agent is installed on ECS instances that are created from public images.

  • For ECS instances that are created from custom images or Alibaba Cloud Marketplace images, you must check whether the operating systems support Cloud Assistant before you install Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

How many Cloud Assistant commands can I retain?

The maximum number of Cloud Assistant commands that you can retain in an Alibaba Cloud region varies based on your ECS resource usage. The number can range from 100 to 10,000.

Can I modify a created Cloud Assistant command?

You can modify the name and description of a created Cloud Assistant command, but you cannot modify other information about the command, such as the command content, timeout period, and execution path. If you want to modify the command content or execution path, you can clone the command to create a new command version. For more information, see Clone a command.

Do I need specific permissions to run Cloud Assistant commands on ECS instances?

Yes, you must install and use Cloud Assistant Agent as an administrator or a root user.

  • To run Cloud Assistant commands on ECS instances that run Windows Server operating systems, you must obtain administrator permissions.

  • To run Cloud Assistant commands on Linux instances, you must obtain root user permissions.

Can I run a Cloud Assistant command on multiple ECS instances at a time?

Yes, you can run a Cloud Assistant command on multiple ECS instances at a time.

  • Method 1: In the ECS console, you can select up to 50 instances when you run a command. In an Alibaba Cloud region, you can run Cloud Assistant commands up to 5,000 times per day.

  • Method 2: If you want to run a Cloud Assistant command on a large number of ECS instances at a time, we recommend that you use the OOSACS-ECS-BulkyRunCommand template of CloudOps Orchestration Service (OOS). You can use the Tag parameter to specify multiple ECS instances to run the Cloud Assistant command without the need to enter the InstanceId value for each instance. In a single OOS loop task, you can run Cloud Assistant commands up to 1,000 times. You can divide the executions into batches and control the concurrency.

How do I check whether a Cloud Assistant command is run as expected?

Commands can be run only if all required conditions are met, regardless of whether you run the commands by using Cloud Assistant or after you log on to an ECS instance. To check the execution results, you can use one of the following methods:

FAQ about troubleshooting Cloud Assistant

Why did I fail to install Cloud Assistant Agent on my Linux instance and receive the "No such file or directory" error message? How do I resolve the issue?

You failed to install Cloud Assistant Agent because Cloud Assistant Agent is already installed on the Linux instance. To re-install Cloud Assistant Agent, perform the following operations. For more information, see Install Cloud Assistant Agent.

  • To re-install Cloud Assistant Agent by using an RPM package, run the following command to forcefully overwrite the existing Cloud Assistant Agent:

    sudo rpm -i --force aliyun_x.x.x.rpm
  • To re-install Cloud Assistant Agent by using a Debian package, perform the following steps:

    1. Run the following command to uninstall the existing Cloud Assistant Agent:

      sudo dpkg -r aliyun-assist
    2. Run the following command to re-install Cloud Assistant Agent:

      sudo dpkg -i aliyun_x.x.x.deb

How do I view the operation logs of Cloud Assistant?

To view the operation logs of Cloud Assistant on an ECS instance, you must connect to the instance. The operation logs of Cloud Assistant are stored in the following files:

  • ${install_dir}/${version}/log/aliyun_assist_main.log

  • ${install_dir}/${version}/log/aliyun_assist_update.log

Note

The ${version} variable indicates the version number of Cloud Assistant Agent, such as 1.0.1.368. The ${install_dir} variable indicates the installation path of Cloud Assistant Agent in the instance operating system.

What are the default installation paths of Cloud Assistant Agent in different operating systems?

By default, Cloud Assistant Agent is installed in the following paths:

  • Windows Server: C:\ProgramData\aliyun\assist

  • CoreOS: /opt/local/share/aliyun-assist/

  • Other Linux operating systems such as Alibaba Cloud Linux, CentOS, Debian, openSUSE, SLES, and Ubuntu: /usr/local/share/aliyun-assist/

How do I check the status of Cloud Assistant on an ECS instance?

Connect to the ECS instance.

  • View the status of Cloud Assistant to check whether Cloud Assistant is enabled.

    • Linux:

      Method 1

      sudo systemctl status aliyun

      Method 2

      ps aux | grep aliyun
    • Windows Server:

      Choose Computer Management (Local) > Services and Applications > Services and find Aliyun Service.

  • Search for the log file in the directory in which the log file is stored. Example:

    tail -n 100 /usr/local/share/aliyun-assist/$(/usr/sbin/aliyun-service -v)/log/aliyun_assist_main.log
  • Search for the heartbeat or update log file in the directory in which the log file is stored. Example:

    tail -n 100 /usr/local/share/aliyun-assist/$(/usr/sbin/aliyun-service -v)/log/aliyun_assist_update.log

Why can shell commands be run in CentOS but not in Ubuntu?

You cannot run shell commands in Ubuntu as you run the shell commands in CentOS because the default shell environment of later versions of Ubuntu is dash, not bash. The shell syntax of dash is not fully compatible with bash. To resolve the preceding issue, change the default shell environment of Ubuntu.

  1. Run the following command to check whether the shell environment is dash:

    ls /bin/sh
  2. If the shell environment is dash, run the following command to switch to the default shell environment:

    dpkg-reconfigure dash

Choose not to specify dash as the default shell environment as prompted.

Can ECS instances in the classic network use Cloud Assistant?

Yes, ECS instances in the classic network can use Cloud Assistant. We recommend that you install the latest version of Cloud Assistant Agent on the ECS instances. For information about the URL for the latest version of Cloud Assistant Agent, see Install Cloud Assistant Agent. If you installed an earlier version of Cloud Assistant Agent on an ECS instance, you must create a file named region-id in the installation path of Cloud Assistant Agent and enter the region ID of the ECS instance in the file. For information about region IDs, see Regions and zones. For example, perform the following steps for a CentOS instance in the China (Hangzhou) region:

  1. Enter the region ID.

    echo 'cn-hangzhou' > /usr/local/share/aliyun-assist/region-id
  2. Restart Cloud Assistant.

Why does a message appear indicating that Cloud Assistant Agent is not installed on an ECS instance when I run a command on the instance by using Cloud Assistant in the ECS console?

The message appears because Cloud Assistant does not receive heartbeat information from Cloud Assistant Agent on the ECS instance. To resolve the preceding issue, you can use the following methods:

  • If the Cloud Assistant process is disabled, you can restart Cloud Assistant. For information about the solution for Windows Server instances, see the How do I view the status of Cloud Assistant? section of this topic. For Linux instances, perform the following steps:

    1. Run the following command to restart Cloud Assistant:

      sudo systemctl restart aliyun
    2. Run the following command to check whether Cloud Assistant starts on system startup:

      sudo systemctl status aliyun

      If Cloud Assistant does not start on system startup, run the following command to allow Cloud Assistant to start on system startup:

      sudo systemctl enable aliyun
  • If the ECS instance resides in the classic network and has an early version of Cloud Assistant Agent installed, you must create a configuration file to specify the region of the instance. For more information, see the Can ECS instances in the classic network use Cloud Assistant? section of this topic.

What do I do if the operation logs contain the "Failed to open gshell: Device or resource busy" message?

  • Problem description: The operation logs of Cloud Assistant contain the following information:

    2019-11-06 03:10:15,993 INFO  [default] /dev/virtio-ports/org.qemu.guest_agent.0:-1
    2019-11-06 03:10:15,993 ERROR [default] Failed to open gshell: Device or resource busy
  • Solutions:

    Method 1

    Run the following command to check whether multiple processes are running on Cloud Assistant Agent. If multiple processes are running, stop all the processes and then restart Cloud Assistant Agent.

    ps aux | grep aliyun

    Method 2

    Run the following command to view which processes are occupying the org.qemu.guest_agent.0 file. All Cloud Assistant processes contain aliyun-** in their names. Stop all non-Cloud Assistant processes.

    lsof /dev/virtio-ports/org.qemu.guest_agent.0

What do I do if specific commands can be run on ECS instances, but the "command not found" error message appears when I run the commands by using Cloud Assistant?

Check whether the environment variables of the Cloud Assistant session contain the commands.

Linux instance

  1. Run the following command to view environment variables:

    export
  2. Run the following command to configure environment variables. The environment variables may vary with ECS instances.

    export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

Windows instance

  1. Run the following command to view environment variables:

    set
  2. Run the following command to configure environment variables. The environment variables may vary with ECS instances.

    set PATH=%PATH%;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Administrator\A

Why does a task enter the Failed state after I execute the task?

To troubleshoot the issue, check the following items:

  • If you use a Windows instance, check whether PowerShell runs as expected on the instance.

  • Check whether the task timed out.

  • Check whether Cloud Assistant runs as expected on the instance. You can call the DescribeCloudAssistantStatus operation to query the status of Cloud Assistant.

  • Check Cloud Assistant logs. By default, Cloud Assistant logs are stored in the following paths:

    • Linux instance: /usr/local/share/aliyun-assist/<Version number of Cloud Assistant Agent>/log/

    • Windows instance: C:\ProgramData\aliyun\assist\<Version number of Cloud Assistant Agent>\log

Why does a task enter the Abort state after I execute the task?

The Abort state indicates that the task was not sent to the destination instance in 1 minute. We recommend that you resend the task.

If the Abort state persists, check Cloud Assistant logs.

When a Cloud Assistant command contains Chinese characters, why is the command output displayed in gibberish?

Standard encoding method: By default, commands in Linux instances are UTF-8 encoded and commands in Windows instances are GBK-encoded.

If a Cloud Assistant command contains Chinese characters, make sure that the command is encoded by using the encoding method supported by your ECS instances.

Common error codes of Cloud Assistant

  • InstanceNotRunning: The ECS instance is not started. Start the instance.

  • ClientNotRunning: Cloud Assistant Agent is not started. Check Cloud Assistant logs to confirm whether Cloud Assistant runs as expected.

  • DeliveryTimeout: The Cloud Assistant task failed to be sent. Check Cloud Assistant logs or update Cloud Assistant Agent to the latest version and try again.

FAQ about application O&M

What suggestions can I obtain for the routine O&M tasks of a small website hosted on an ECS instance?

The following website O&M suggestions are available: