All Products
Search
Document Center

Elastic Compute Service:O&M and monitoring FAQ

Last Updated:Dec 28, 2023

This topic provides answers to commonly asked questions about the operations and maintenance (O&M) and monitoring of ECS instances.

What is Cloud Assistant?

Cloud Assistant is a built-in O&M and deployment service for Alibaba Cloud ECS instances. 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 the same time. This saves you the trouble from individually connecting to each instance to run scripts. For more information, see Cloud Assistant.

How do I use Cloud Assistant?

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

Which operating systems support Cloud Assistant?

The following operating systems support Cloud Assistant:

  • Windows Server: Windows Server 2008, 2012, and 2016

  • Unix-like: Ubuntu 12, Ubuntu 14, Ubuntu 16, CentOS 5, CentOS 6, CentOS 7, Debian 7, Debian 8, Debian 9, SUSE Linux Enterprise Server 11, SUSE Linux Enterprise Server 12, openSUSE, Alibaba Cloud Linux, and CoreOS

Note
  • The Cloud Assistant Agent is installed by default on all ECS instances that are created from public images on and after December 1, 2017.

  • For instances created from custom images or Alibaba Cloud Marketplace images, you must make sure the operating systems on these instances support Cloud Assistant before you install the Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

How many Cloud Assistant scripts can I have in an Alibaba Cloud region?

The maximum number of Cloud Assistant scripts that you can have in an Alibaba Cloud region is based on the use scenarios of ECS instances. The range is from 100 to 10,000 Cloud Assistant scripts.

Can I modify a created Cloud Assistant script?

You can modify the name and description of a script, but other information such as the script content, timeout period, and execution path cannot be modified.

If you want to modify the script content or execution path, you can clone the script to create a new version of it. For more information, see Clone a command.

Do I need any permissions to run Cloud Assistant scripts on ECS instances?

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

  • To run scripts on instances that run Windows Server operating systems, you must have administrator permissions.

  • To run scripts on Linux instances, you must have root user permissions.

Can I run a Cloud Assistant script on multiple instances at the same time?

Yes, you can run a Cloud Assistant script on multiple instances at the same time.

  • Method 1: In the ECS console, you can select a maximum of 50 instances on which to execute a script. You can run a maximum of 5,000 Cloud Assistant scripts each day in an Alibaba Cloud region.

  • Method 2: If you want to run a Cloud Assistant script on more than 50 instances, we recommend that you use an CloudOps Orchestration Service (OOS) template (ACS-ECS-BulkyRunCommand). The template allows you to run a script on multiple ECS instances based on the tags specified by the Tag parameter. This eliminates the need to enter instance IDs one by one for the InstanceId parameter. For information about the template, visit ACS-ECS-BulkyRunCommand. In a single OOS loop task, you can run a Cloud Assistant script a maximum of 1,000 times in batches and control the concurrency of the script.

How do I check the execution results of Cloud Assistant scripts?

Cloud Assistant scripts can be executed only when all required conditions are met, regardless of whether you run scripts on the Cloud Assistant Agent or on an ECS instance. You can use one of the following methods to check the execution results:

Why did I fail to install the Cloud Assistant Agent on my Linux instance and was prompted with the message "No such file or directory"?

You failed to install the Cloud Assistant Agent because Linux instances are pre-installed with the Cloud Assistant Agent. To re-install the Cloud Assistant Agent, perform the following steps: For more information, see Install Cloud Assistant Agent.

  • To re-install the client by using an RPM package, run the following command to forcibly overwrite the existing client:

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

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

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

      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, you must connect to the instance. The operation log files of Cloud Assistant are as follows:

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

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

Note

${version} is the version number of Cloud Assistant, for example, 1.0.1.368. ${install_dir} is the installation directory of Cloud Assistant in the operating system of the ECS instance. The installation directory varies with the operating system of the instance:

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

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

  • Other Linux systems (Alibaba Cloud Linux, Debian, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Ubuntu): /usr/local/share/aliyun-assist/

How do I view the service status of Cloud Assistant?

Connect to the ECS instance.

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

    • Linux systems:

      • Method 1:

        systemctl status aliyun
      • Method 2:

        ps aux | grep aliyun
    • Windows Server systems: Choose Computer Management > Services and Applications > Services, and find AliyunService.

  • Search for the log file in the corresponding directory. For 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 corresponding directory. For example:

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

Why am I unable to run shell scripts in Ubuntu as I do in CentOS?

You cannot run shell scripts in Ubuntu as you do 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 that of bash. You can switch to the default bash shell environment to solve this problem.

  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 bash shell environment:

    dpkg-reconfigure dash

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

Why does a prompt appear indicating that the Cloud Assistant Agent is not installed when I run a script in the ECS console?

The prompt appears because Cloud Assistant does not receive the heartbeat information. You can perform the following steps to solve this problem:

  • If the reason is that the process of the Cloud Assistant service is disabled, you can restart the Cloud Assistant service. If you use a Windows Server system, see How do I view the service status of Cloud Assistant?. If you use a Linux system, perform the following operations:

    1. Run the following command to restart the Cloud Assistant service:

      systemctl restart aliyun
    2. Run the following command to check the status of Cloud Assistant:

      systemctl status aliyun

      If Cloud Assistant is disabled, run the following command to allow Cloud Assistant to start automatically at startup.

      systemctl enable aliyun 
  • If your instance is located in a classic network, create a file named region-id in the installation directory of the Cloud Assistant Agent. Then enter the region ID (cn-hangzhou, for example) of the instance in the file. For more information, see Install Cloud Assistant Agent.

What can I do if the operation log contains the following message: "Failed to open gshell: Device or resource busy"?

  • Problem description: The operation log of Cloud Assistant contains 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
  • Solution:

    • Method 1: Run the following command to check whether multiple processes are running on the Cloud Assistant Agent. If multiple processes are running, stop all the processes and then restart the 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 suggestions do you have for the routine O&M tasks of users who host a small website on an ECS instance?

You can refer to the following website O&M suggestions: