All Products
Search
Document Center

Elastic Compute Service:Install Cloud Assistant Agent on an ECS instance

Last Updated:Oct 14, 2024

Cloud Assistant Agent is used to run Cloud Assistant commands on Elastic Compute Service (ECS) instances. This topic describes how to install Cloud Assistant Agent on ECS instances.

Prerequisites

The instance types and operating systems of the instances on which you want to install Cloud Assistant Agent support Cloud Assistant. For more information, see the Limits section in the "Overview" topic.

Background information

Cloud Assistant Agent is pre-installed on ECS instances that are created from public images on or after December 1, 2017.

For ECS instances created before December 1, 2017, you must manually install Cloud Assistant Agent.

Note

After you register a server that is not provided by Alibaba Cloud as an Alibaba Cloud managed instance, you can use various online services of Alibaba Cloud, such as Cloud Assistant, CloudOps Orchestration Service (OOS), and Apsara Devops, on the managed instance. For more information, see Alibaba Cloud managed instances.

Install a version of Cloud Assistant Agent based on the features supported by Cloud Assistant. The following table describes the features that are supported by Cloud Assistant and the earliest supported version of Cloud Assistant Agent for each feature.

Feature supported by Cloud Assistant

Earliest supported version of Cloud Assistant Agent for Linux instances

Earliest supported version of Cloud Assistant Agent for Windows instances

References

Report Cloud Assistant heartbeats

1.0.2.458

1.0.0.149

N/A

Send files

1.0.2.569

1.0.0.149

Upload on-premises files to ECS instances

Specify a username to use to run a command

2.2.0.106

2.1.0.50

Configure a command to run on next instance startup

2.2.0.46

2.1.0.50

Configure a command to run on every instance startup

Session Manager

2.2.3.196

2.1.3.196

Connect to an instance by using Session Manager

Use a rate expression or an at expression in the execution plan of a scheduled task

2.2.3.282

2.1.3.282

Specify a cron expression that includes a <Year> field or a <Time zone> field in the execution plan of a scheduled task

2.2.3.282

2.1.3.282

Specify built-in environment parameters

2.2.3.309

2.1.3.309

Use instance names as built-in environment parameters

2.2.3.344

2.1.3.344

Use specific exit codes to stop or restart instances

2.2.3.317

2.1.3.317

Run a Cloud Assistant command to stop or restart instances

Specify the name of a container in which to run a command

2.2.3.344

2.1.3.344

Use Cloud Assistant to run commands in containers

Specify the ID of a container in which to run a command

2.2.3.344

2.1.3.344

The following table describes the methods that you can use to install Cloud Assistant Agent on different operating systems.

Operating system

Installation method

Windows

Linux operating systems such as Alibaba Cloud Linux, CentOS, Red Hat Enterprise Linux (RHEL), and SUSE Linux

Linux operating systems such as Debian and Ubuntu

Note

You cannot use Alibaba Cloud CLI to install Cloud Assistant Agent on RHEL.

Other Linux operating systems

Install Cloud Assistant Agent on a Windows instance

  1. Connect to the instance as an administrator.

    For more information, see Connection method overview.

  2. Download Cloud Assistant Agent.

    You can download a specific version of Cloud Assistant Agent from one of the following URLs:

    • Public URL for the latest version of Cloud Assistant Agent:

    • Public URL for a specific version of Cloud Assistant Agent:

      https://aliyun-client-assist.oss-accelerate.aliyuncs.com/windows/aliyun_agent_{version}_setup.exe
    • Internal URL for the latest version of Cloud Assistant Agent:

      https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/windows/aliyun_agent_latest_setup.exe
    • Internal URL for a specific version of Cloud Assistant Agent:

      https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/windows/aliyun_agent_{version}_setup.exe
    Note
    • {version} indicates the version number of Cloud Assistant Agent.

    • {regionId} indicates the region ID of the instance on which you want to install Cloud Assistant Agent.

      To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

    • You can specify the following version numbers of Cloud Assistant Agent to download Cloud Assistant Agent from public or internal URLs:

      • Version numbers that can be specified in public URLs: 1.0.0.128, 2.1.2.181, 2.1.3.187, 2.1.3.221, 2.1.3.247, 2.1.3.256, 2.1.3.269, 2.1.3.282, 2.1.3.289, 2.1.3.326, 2.1.3.349, 2.1.3.372, and 2.1.3.398

      • Version numbers that can be specified in internal URLs: 1.0.0.128, 2.1.3.221, 2.1.3.247, 2.1.3.256, 2.1.3.265, 2.1.3.269, 2.1.3.282, 2.1.3.289, 2.1.3.326, 2.1.3.349, 2.1.3.372, and 2.1.3.398

    For example, to download version 1.0.0.128 of Cloud Assistant Agent in the China (Hangzhou) region, access the following internal URL:

    https://aliyun-client-assist-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/windows/aliyun_agent_1.0.0.128_setup.exe
  3. Double-click the installation file of Cloud Assistant Agent. Then, install Cloud Assistant Agent as instructed.

    For Windows instances, the default installation directory of Cloud Assistant Agent is C:\ProgramData\aliyun\assist\.

    You can also integrate the above download and installation steps into a PowerShell script. The following script uses the internal URL for the latest version as an example. Replace the {regionId} with the Region ID of your instance.

    curl -UseBasicParsing -Uri https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/windows/aliyun_agent_latest_setup.exe -OutFile 'C:\\aliyun_agent_latest_setup.exe'
    &"C:\\aliyun_agent_latest_setup.exe" '/S' 
  4. (Optional) Perform the following operations if the network type of the ECS instance is classic network:

    1. In the directory where Cloud Assistant Agent is installed, create a file named region-id. Do not add an extension, such as .txt or .conf, to the file name.

      Important

      In Windows, you must clear "Hide extensions for known file types" before you can check whether the region-id file has an extension.

    2. In the region-id file, enter the region ID of the instance. Example: cn-hangzhou.

      Note

      To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

    For example, the instance runs a Windows Server 2012 R2 operating system and resides in the China (Hangzhou) region whose ID is cn-hangzhou. The default installation directory of Cloud Assistant Agent on the instance is C:\ProgramData\aliyun\assist\. You must create the region-id file in the directory and enter cn-hangzhou in the file, as shown in the following figure.在Windows上添加文件

Install Cloud Assistant Agent on a Linux instance

Use RPM packages

This installation method is applicable to Linux operating systems such as Alibaba Cloud Linux, CentOS, RHEL, and SUSE Linux.

  1. Use a user that has sudo permissions to connect to a Linux instance.

    For more information, see Connection method overview.

  2. Download the Red Hat Package Manager (RPM) package for Cloud Assistant Agent.

    Cloud Assistant Agent version

    Download command

    Public URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun-assist-latest-1.aarch64.rpm"

    Public URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_{version}.rpm"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun-assist-{version}-1.aarch64.rpm"

    Internal URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_latest.rpm"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun-assist-latest-1.aarch64.rpm"

    Internal URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_{version}.rpm"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun-assist-{version}-1.aarch64.rpm"
    Note
    • {version} indicates the version number of Cloud Assistant Agent.

    • {regionId} indicates the region ID of the instance on which you want to install Cloud Assistant Agent.

      To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

    • You can specify the following version numbers of Cloud Assistant Agent to download Cloud Assistant Agent from public or internal URLs:

      • Version numbers that can be specified in public URLs:

        • x86 architecture: 1.0.1.413, 1.0.1.414, 1.0.1.448, 1.0.1.450, 1.0.2.458, 1.0.2.479, 1.0.2.541, 1.0.2.569, 1.0.2.574, 2.2.0.102, 2.2.0.106, 2.2.2.181, 2.2.3.187, 2.2.3.221, 2.2.3.247, 2.2.3.256, 2.2.3.269, 2.2.3.282, 2.2.3.289, 2.2.3.326, 2.2.3.349, 2.2.3.372, and 2.2.3.398

        • ARM architecture: 2.4.3.282, 2.4.3.326, 2.4.3.349, 2.4.3.372, and 2.4.3.398

      • Version numbers that can be specified in internal URLs:

        • x86 architecture: 1.0.1.407, 1.0.2.458, 1.0.2.479, 2.2.3.221, 2.2.3.247, 2.2.3.256, 2.2.3.265, 2.2.3.269, 2.2.3.282, 2.2.3.289, 2.2.3.326, 2.2.3.349, 2.2.3.372, and 2.2.3.398

        • ARM architecture: 2.4.3.282, 2.4.3.326, 2.4.3.349, 2.4.3.372, and 2.4.3.398

    For example, to download the RPM package for x86 version 1.0.2.458 of Cloud Assistant Agent in the China (Hangzhou) region, access the following internal URL:

    sudo wget "https://aliyun-client-assist-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/linux/aliyun_assist_1.0.2.458.rpm"
  3. Install Cloud Assistant Agent.

    By default, Cloud Assistant Agent is installed in one of the following directories on Linux instances:

    • Default installation directory for CoreOS operating systems: /opt/local/share/aliyun-assist/

    • Default installation directory for other operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE: /usr/local/share/aliyun-assist/

    To install the latest version of Cloud Assistant Agent on an instance, run one of the following commands based on the operating system architecture of the instance:

    • x86

      sudo rpm -ivh --force aliyun_assist_latest.rpm
    • ARM

      sudo rpm -ivh --force aliyun-assist-latest-1.aarch64.rpm
  4. Perform operations based on the operating system or network type of the instance.

    • If the instance runs a Red Hat operating system, perform the following operations:

      1. Stop the qemu-ga service.

        sudo systemctl stop qemu-guest-agent
        sudo systemctl disable qemu-guest-agent
      2. Restart Cloud Assistant.

        sudo systemctl restart aliyun.service
    • If the instance resides in the classic network, perform the following operations:

      In the directory where Cloud Assistant Agent is installed, create a file named region-id and enter the region ID of the instance in the file. For example, to create the region-id file in the default installation directory and enter the region ID of the instance on which Cloud Assistant Agent is installed in the file, run one of the following commands based on the operating system of the instance:

      • CoreOS operating systems:

        sudo sh -c 'echo "cn-hangzhou" > /opt/local/share/aliyun-assist/region-id'
      • Other Linux operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE:

        sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id'

      If the sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id command is run, the following command output is returned.创建文件

Use DEB packages

This installation method is applicable to Linux operating systems such as Debian and Ubuntu.

  1. Use a user that has sudo permissions to connect to a Linux instance.

    For more information, see Connection method overview.

  2. Download the Debian package (DEB package) for Cloud Assistant Agent.

    Cloud Assistant Agent version

    Download command

    Public URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.deb"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun-assist_latest-1_arm64.deb"

    Public URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_{version}.deb"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun-assist_{version}-1_arm64.deb"

    Internal URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_latest.deb"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun-assist_latest-1_arm64.deb"

    Internal URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_{version}.deb"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun-assist_{version}-1_arm64.deb"
    Note
    • {version} indicates the version number of Cloud Assistant Agent.

    • {regionId} indicates the region ID of the instance on which you want to install Cloud Assistant Agent.

      To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

    • You can specify the following version numbers of Cloud Assistant Agent to download Cloud Assistant Agent from public or internal URLs:

      • Version numbers that can be specified in public URLs:

        • x86 architecture: 1.0.1.413, 1.0.1.414, 1.0.1.448, 1.0.1.450, 1.0.2.458, 1.0.2.479, 1.0.2.541, 1.0.2.569, 1.0.2.574, 2.2.0.102, 2.2.0.106, 2.2.2.181, 2.2.3.187, 2.2.3.221, 2.2.3.247, 2.2.3.256, 2.2.3.269, 2.2.3.282, 2.2.3.289, 2.2.3.326, 2.2.3.349, 2.2.3.372, and 2.2.3.398

        • ARM architecture: 2.4.3.282, 2.4.3.326, 2.4.3.349, 2.4.3.372, and 2.4.3.398

      • Version numbers that can be specified in internal URLs:

        • x86 architecture: 1.0.1.407, 1.0.2.458, 1.0.2.479, 2.2.3.221, 2.2.3.247, 2.2.3.256, 2.2.3.265, 2.2.3.269, 2.2.3.282, 2.2.3.289, 2.2.3.326, 2.2.3.349, 2.2.3.372, and 2.2.3.398

        • ARM architecture: 2.4.3.282, 2.4.3.326, 2.4.3.349, 2.4.3.372, and 2.4.3.398

    For example, to download the DEB package for x86 version 1.0.2.458 of Cloud Assistant Agent in the China (Hangzhou) region, access the following internal URL:

    sudo wget "https://aliyun-client-assist-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/linux/aliyun_assist_1.0.2.458.deb"
  3. (Optional) If an earlier version of Cloud Assistant Agent is installed on the instance, uninstall the earlier version.

    sudo dpkg -r aliyun-assist
  4. Install Cloud Assistant Agent.

    By default, Cloud Assistant Agent is installed in one of the following directories on Linux instances:

    • Default installation directory for CoreOS operating systems: /opt/local/share/aliyun-assist/

    • Default installation directory for other operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE: /usr/local/share/aliyun-assist/

    To install the latest version of Cloud Assistant Agent on an instance, run one of the following commands based on the operating system architecture of the instance:

    • x86

      sudo dpkg -i aliyun_assist_latest.deb
    • ARM

      sudo dpkg -i aliyun-assist_latest-1_arm64.deb
  5. If the instance resides in the classic network, perform the following operations:

    In the directory where Cloud Assistant Agent is installed, create a file named region-id and enter the region ID of the instance in the file. For example, to create the region-id file in the default installation directory and enter the region ID of the instance on which Cloud Assistant Agent is installed in the file, run one of the following commands based on the operating system of the instance:

    • CoreOS operating systems:

      sudo sh -c 'echo "cn-hangzhou" > /opt/local/share/aliyun-assist/region-id'
    • Other Linux operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE:

      sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id'

    If the sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id command is run, the following command output is returned.创建文件

Use binary packages

This installation method is applicable to mainstream Linux operating systems.

  1. Use a user that has sudo permissions to connect to a Linux instance.

    For more information, see Connection method overview.

  2. Download the binary package for Cloud Assistant Agent.

    Cloud Assistant Agent version

    Download command

    Public URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest_update.zip"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun_assist_latest_update_arm.zip"

    Public URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_{version}_update.zip"

    ARM

    sudo wget "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun_assist_{version}_update_arm.zip"

    Internal URL for the latest version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_latest_update.zip"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun_assist_latest_update_arm.zip"

    Internal URL for a specific version

    x86

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/linux/aliyun_assist_{version}_update.zip"

    ARM

    sudo wget "https://aliyun-client-assist-{regionId}.oss-{regionId}-internal.aliyuncs.com/arm/aliyun_assist_{version}_update_arm.zip"
    Note
    • {version} indicates the version number of Cloud Assistant Agent.

    • {regionId} indicates the region ID of the instance on which you want to install Cloud Assistant Agent.

      To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

    • You can specify the following version numbers of Cloud Assistant Agent to download Cloud Assistant Agent from public or internal URLs:

      • x86 architecture: 2.2.3.282, 2.2.3.289, 2.2.3.326, 2.2.3.349, 2.2.3.372, and 2.2.3.398

      • ARM architecture: 2.4.3.282, 2.4.3.326, 2.4.3.349, 2.4.3.372, and 2.4.3.398

    For example, to download the binary package for x86 version 2.2.3.282 of Cloud Assistant Agent in the China (Hangzhou) region, access the following internal URL:

    sudo wget "https://aliyun-client-assist-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/linux/aliyun_assist_2.2.3.282_update.zip"
  3. Install Cloud Assistant Agent.

    By default, Cloud Assistant Agent is installed in one of the following directories on Linux instances:

    • Default installation directory for CoreOS operating systems: /opt/local/share/aliyun-assist/

    • Default installation directory for other operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE: /usr/local/share/aliyun-assist/

    Decompress the binary package to the installation directory and install Cloud Assistant Agent. For example, to install version 2.2.3.282 of Cloud Assistant Agent on an instance that uses an x86 operating system, run the following commands:

    sudo unzip  -o aliyun_assist_2.2.3.282_update.zip -d /usr/local/share/aliyun-assist/
    sudo chmod a+x /usr/local/share/aliyun-assist/2.2.3.282/update_install
    sudo bash /usr/local/share/aliyun-assist/2.2.3.282/update_install
  4. Perform operations based on the operating system or network type of the instance.

    • If the instance runs a Red Hat operating system, perform the following operations:

      1. Stop the qemu-ga service.

        sudo systemctl stop qemu-guest-agent
        sudo systemctl disable qemu-guest-agent
      2. Restart Cloud Assistant.

        sudo systemctl restart aliyun.service
    • If the instance resides in the classic network, perform the following operations:

      In the directory where Cloud Assistant Agent is installed, create a file named region-id and enter the region ID of the instance in the file. For example, to create the region-id file in the default installation directory and enter the region ID of the instance on which Cloud Assistant Agent is installed in the file, run one of the following commands based on the operating system of the instance:

      • CoreOS operating systems:

        sudo sh -c 'echo "cn-hangzhou" > /opt/local/share/aliyun-assist/region-id'
      • Other Linux operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE:

        sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id'

      If the sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id command is run, the following command output is returned.创建文件

Use source code

  1. Use a user that has sudo permissions to connect to a Linux instance.

    For more information, see Connection method overview.

  2. Install necessary software, such as Git and Go.

    In this example, Yellowdog Updater, Modified (YUM) is used. If you use other Linux operating systems, use the corresponding package manager.

    • Install Git.

      sudo yum install git -y
    • Install Go.

      sudo yum install go -y
  3. Download the source code for Cloud Assistant Agent.

    sudo git clone https://github.com/aliyun/aliyun_assist_client
  4. Access the directory where the source code is stored.

    cd ./aliyun_assist_client
  5. Compile the source code.

    sudo go build

    If no error message is returned, Cloud Assistant Agent is installed.

  6. If the instance resides in the classic network, perform the following operations:

    In the directory where Cloud Assistant Agent is installed, create a file named region-id and enter the region ID of the instance in the file. For example, to create the region-id file in the default installation directory and enter the region ID of the instance on which Cloud Assistant Agent is installed in the file, run one of the following commands based on the operating system of the instance:

    • CoreOS operating systems:

      sudo sh -c 'echo "cn-hangzhou" > /opt/local/share/aliyun-assist/region-id'
    • Other Linux operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE:

      sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id'

    If the sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id command is run, the following command output is returned.创建文件

  7. Run Cloud Assistant Agent.

    aliyun-service -d

Install Cloud Assistant Agent on Windows or Linux instances by using Alibaba Cloud CLI

To use this method, you do not need to connect to an instance but you must install Alibaba Cloud CLI on the instance. For information about how to install Alibaba Cloud CLI on different operating systems, see the following topics:

Note

You cannot use Alibaba Cloud CLI to install Cloud Assistant Agent on RHEL.

  1. Call the DescribeCloudAssistantStatus operation to check whether Cloud Assistant Agent is installed on your instance.

    aliyun ecs DescribeCloudAssistantStatus --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p --output cols=CloudAssistantStatus rows=InstanceCloudAssistantStatusSet.InstanceCloudAssistantStatus[]

    If the value of the CloudAssistantStatus parameter is true in the response, Cloud Assistant Agent is installed on the instance. If the value of the CloudAssistantStatus parameter is false in the response, proceed to the next step.

  2. Call the InstallCloudAssistant operation to install Cloud Assistant Agent.

    aliyun ecs InstallCloudAssistant --RegionId TheRegionId --InstanceId.1 i-bp1g6zv0ce8og******p
  3. Call the RebootInstance operation to restart the instance.

    aliyun ecs RebootInstance --InstanceId i-bp1g6zv0ce8og******p
  4. If the instance is in the classic network, add a region declaration within the instance.

    1. Connect to the ECS instance as the root user or an administrator.

      For more information, see Connection method overview.

    2. View the version of Cloud Assistant Agent.

      If the version of Cloud Assistant Agent is later than 1.0.1.400, Cloud Assistant Agent is installed on the instance. If the version of Cloud Assistant Agent is 1.0.1.400 or earlier, proceed to the next step.

    3. Create the region-id file and enter the region ID of the instance in the file.

      Linux

      In the directory where Cloud Assistant Agent is installed, create a file named region-id and enter the region ID of the instance in the file. For example, to create the region-id file in the default installation directory and enter the region ID of the instance on which Cloud Assistant Agent is installed in the file, run one of the following commands based on the operating system of the instance:

      • CoreOS operating systems:

        sudo sh -c 'echo "cn-hangzhou" > /opt/local/share/aliyun-assist/region-id'
      • Other Linux operating systems, such as Alibaba Cloud Linux, Ubuntu, Debian, Red Hat, SUSE Linux Enterprise Server, and openSUSE:

        sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id'

      If the sudo sh -c 'echo "cn-hangzhou" > /usr/local/share/aliyun-assist/region-id command is run, the following command output is returned.创建文件

      Windows

      1. In the directory where Cloud Assistant Agent is installed, create a file named region-id. Do not add an extension, such as .txt or .conf, to the file name.

        Important

        In Windows, you must clear "Hide extensions for known file types" before you can check whether the region-id file has an extension.

      2. In the region-id file, enter the region ID of the instance. Example: cn-hangzhou.

        Note

        To query the region in which an instance resides, click the ID of the instance on the instance list page in the ECS console and view the value of the Region parameter in the Basic Information section of the Instance Details page. Then, you can query the ID of the region in the Regions and zones topic.

      For example, the instance runs a Windows Server 2012 R2 operating system and resides in the China (Hangzhou) region whose ID is cn-hangzhou. The default installation directory of Cloud Assistant Agent on the instance is C:\ProgramData\aliyun\assist\. You must create the region-id file in the directory and enter cn-hangzhou in the file, as shown in the following figure.在Windows上添加文件

View information about Cloud Assistant Agent on an instance

After you install Cloud Assistant Agent on an instance, you can perform the following steps to query the version number and status of Cloud Assistant Agent.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Maintenance & Monitoring > Cloud Assistant.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Click the ECS Instances tab to view information about Cloud Assistant Agent on the ECS instances in the current region.

    查询结果

Latest versions of Cloud Assistant Agent supported by specific kernel versions

Kernel version

Latest version of Cloud Assistant Agent supported by the kernel version

Linux kernel version earlier than 2.6.32

  • x86 or x64 architecture: 2.2.3.398

  • ARM architecture: 2.4.3.398

Kernel version earlier than 12.x in FreeBSD 11 or earlier

2.3.3.529