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, Aliyun Linux, and CoreOS
Note
  • The Cloud Assistant client 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 client. For more information, see Install the Cloud Assistant client.

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 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 Operation 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 client 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 client on my Linux instance and was prompted with the message "No such file or directory"?

You failed to install the Cloud Assistant client because Linux instances are pre-installed with the Cloud Assistant client. To re-install the Cloud Assistant client, perform the following steps: For more information, see Install the Cloud Assistant client.
  • 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 client:
      dpkg -r aliyun-assist
    2. Run the following command to re-install the Cloud Assistant client:
      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 (Aliyun 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 client 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 client. Then enter the region ID (cn-hangzhou, for example) of the instance in the file. For more information, see Install the Cloud Assistant client.

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 client. If multiple processes are running, stop all the processes and then restart the Cloud Assistant client.
      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:

  • Back up disk data on a regular basis. For more information, see Create a snapshot or Apply or disable an automatic snapshot policy.
  • Use SSL Certificate Service to authenticate visitors of your website and encrypt data to be transferred over your website. For more information, see What is SSL Certificates?.
  • Install a malware scan plug-in and Anti-DDoS service, or enable Alibaba Cloud Security. ECS provides free security services. For more information, see Basic security services or Anti-DDoS Basic.
  • Monitor the inbound and outbound traffic of the website to identify the range of abnormal traffic amount. Add the Deny security group rule to temporarily control abnormal requests from a specific point. For more information, see Monitoring and Add security group rules.
  • Monitor the performance of ECS instances and disks and identify the traffic peak period. Familiarize yourself with operations such as configuration upgrade and downgrade, auto scaling, or disk extension, which can help you respond to sudden changes in request volume. For more information, see Overview of instance upgrade and downgrade, What is Auto Scaling? or Overview.
  • Change the password for root and administrator accounts on a regular basis. We recommend that you do this for scenarios where you need to log on to ECS instances as an administrator or root user. For more information, see Reset an instance logon password.
  • Update software patches on a regular basis. Alibaba Cloud regularly provides security patches for public images. We recommend that you create custom images from public images. For more information, see Update a custom image.