The Cloud Assistant client is an agent that runs Cloud Assistant scripts on ECS instances. This topic describes how to install the Cloud Assistant client.

Prerequisites

  • You must install and use the Cloud Assistant client as an administrator. The administrator username is "root" for Linux instances and "administrator" for Windows instances.
  • For instances that are created from a custom image or an Alibaba Cloud Marketplace image, make sure that the instance types and operating systems support Cloud Assistant before you install the client. For more information, see the "Limits" section of Cloud Assistant overview.

Background information

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 ECS instances created before December 1, 2017, you must install the Cloud Assistant client manually.
This topic describes three installation methods:

Install the client from the download link for Windows instances

  1. emotely connect to an ECS instance as a system user. For more information
  2. Download the Cloud Assistant client. Download link: Cloud Assistant client.
  3. Run the installation file and follow the instructions to install the client.
    If you select the default installation path, the installation directory of the client in the Windows instance is C:\ProgramData\aliyun\assist\.
  4. (Classic network-type instances) Create a file in the installation directory of Cloud Assistant and name the file region-id, without a filename suffix. Enter the region ID of the ECS instance in the file, such as cn-hangzhou. For more information about the region ID, see Regions and zones.

Install the client from the download link for Linux instances

  1. Remotely connect to an ECS instance as a root user. For more information, see Overview.
  2. Select one of the following installation methods based on your operating system:
    • Install the client by using the RPM package. This installation method is applicable to operating systems such as CentOS, Red Hat Enterprise Linux (RHEL), and SUSE Linux.
      1. Download the RPM package of the Cloud Assistant client.
        wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm"
      2. Install the Cloud Assistant client.
        rpm -ivh --force aliyun_assist_latest.rpm
      3. (Classic network-type instances) Create a file in the installation directory of Cloud Assistant and name the file region-id, without a filename suffix. Enter the region ID of the ECS instance in the file, such as cn-hangzhou. For more information about the region ID, see Regions and zones.
    • Install the client by using the Debian package. This installation method is applicable to operating systems such as Debian and Ubuntu.
      1. Download the Debian package of the Cloud Assistant client.
        wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.deb"
      2. (Optional) Uninstall earlier versions of the Cloud Assistant client.
        dpkg -r aliyun-assist
      3. Install the Cloud Assistant client.
        dpkg -i aliyun_assist_latest.deb
      4. (Classic network-type instances) Create a file in the installation directory of Cloud Assistant and name the file region-id, without a filename suffix. Enter the region ID of the ECS instance in the file, such as cn-hangzhou. For more information about the region ID, see Regions and zones.
    • Install the client by compiling source code.
      1. Download the source code of the Cloud Assistant client.
        git clone https://github.com/aliyun/aliyun_assist_client
      2. Access the source code directory.
      3. Run the cmake . command to generate the compilation file.
        Note If the CMAKE_MINIMUM_REQUIRED error is reported during compilation, go to the official CMake website to update the CMake service to version 3.1 or later.
      4. Run the make command to start compiling.
      5. Run the ./cmake_install.sh command to install the Cloud Assistant client.
      6. (Classic network-type instances) Create a file in the installation directory of Cloud Assistant and name the file region-id, without a filename suffix. Enter the region ID of the ECS instance in the file, such as cn-hangzhou. For more information about the region ID, see Regions and zones.
    If you select the default installation path, the installation directory of the client in Linux instances is:
    • CoreOS: /opt/local/share/aliyun-assist/
    • Other operating systems (Ubuntu, Debian, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, openSUSE, and Aliyun Linux): /usr/local/share/aliyun-assist/

Install the client by using Alibaba Cloud CLI for Windows or Linux instances

  1. Call the DescribeCloudAssistantStatus operation to query whether the Cloud Assistant client has been installed on your ECS instance.
    aliyun ecs DescribeCloudAssistantStatus --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p --output cols=CloudAssistantStatus rows=InstanceCloudAssistantStatusSet.InstanceCloudAssistantStatus[]
    If CloudAssistantStatus=true is returned, the Cloud Assistant client has been installed on the instance. Otherwise, proceed to the next step.
  2. Call the InstallCloudAssistant operation to install the Cloud Assistant client.
    aliyun ecs InstallCloudAssistant --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p
  3. Call the RebootInstance operation to restart the ECS instance.
    aliyun ecs RebootInstance --RegionId TheRegionId --InstanceId i-bp1g6zv0ce8og******p
  4. (Classic network-type instances) Add a region statement within the instances.
    1. Remotely connect to an ECS instance. For more information, see Overview.
    2. Create a file in the installation directory of Cloud Assistant and name the file region-id, without a filename suffix. Enter the region ID of the ECS instance in the file, such as cn-hangzhou. For more information about the region ID, see Regions and zones.