Updated on 2024-05-28 GMT+08:00

Installing a VM Agent

To deploy a component to a VM, you need to install the VM agent. After the host is managed, the backend can communicate with the host.

For details about the VM agent status and description, see Table 1.

Table 1 VM agent status description

Agent Status

Description

Agent uninstalled

The VM agent is not installed on the ECS node. You need to install the VM agent.

Agent online

The VM agent has been installed on the ECS node and is running properly.

Agent offline

The VM agent has been installed on the ECS node, but is offline and cannot work properly.

For details about how to handle agent offline, see What Should I Do If the VM Agent Is Offline?

Agent upgrading

The VM agent has been installed on the ECS node and is being upgraded.

Agent upgrade failed

The VM agent has been installed on the ECS node and fails to be upgraded.

Agent restarting

The VM agent has been installed on the ECS node and is restarting.

The VM agent supports multiple OSs. You need to create an image by referring to Table 2, use the created image to create an ECS, and install the VM agent.

Table 2 OSs and versions supported by the VM agent

OS

Version

Description

EulerOS

  • 2.2 64bit
  • 2.3 64bit
  • 2.5 64bit
  • 2.8 64bit
  • For Linux x86_64 servers, all the listed OSs and versions are supported.
  • For Linux ARM servers, all the listed OSs and versions except CentOS 7.3 and earlier are supported.

CentOS

  • 6.5 64bit
  • 6.8 64bit
  • 6.9 64bit
  • 6.10 64bit
  • 7.2 64bit
  • 7.3 64bit
  • 7.4 64bit
  • 7.5 64bit
  • 7.6 64bit
  • 7.7 64bit
  • 7.8 64bit
  • 7.9 64bit

Fedora

  • 29 64bit
  • 30 64bit

openEuler

20.03 64bit

This section describes how to install the VM agent on a single VM.

Procedure

  1. Log in to ServiceStage.
  2. On the Environment Management page, click the target environment of the VM type.
  3. In the Resource Settings area, choose Elastic Cloud Server from Compute.
  4. In the managed resource list, locate the VM where the agent is to be installed and click Install Agent in the Agent Status column.
  5. Select an authorization mode.

    Authorize the agent to use your authentication information to obtain the deployment, upgrade, start, and stop tasks of an application and execute the task.

    You can use agency or AK/SK to perform authorization. Agency is recommended.

    • Select Agency for Authorization Model:

      Click , select an agency, and click .

      For details about how to create an agency, see Creating an Agency.

      When creating an agency, you need to delegate the op_svc_ecs account to manage resources or ECS cloud service to access other cloud resources, and select the Tenant Administrator policy in the corresponding region.

    • Select AKSK for Authorization Model:

      For security purposes, obtain and use the AK and SK with the ServiceStage Development permission. The account and the account used for installing the VM agent must belong to the same user.

      For details about how to obtain the AK/SK, see Access Keys.

  6. Copy the command automatically generated in the lower part of the window, that is, the agent installation command.

    Example command for the Agency model:
    export AGENT_INSTALL_URL=https://${Region_Name}-servicestage-vmapp.obs.${Region_Name}.${Domain_Name}/vmapp/agent/agent-install.sh;if [ -f `which curl` ];then curl -# -O -k ${AGENT_INSTALL_URL};else wget --no-check-certificate ${AGENT_INSTALL_URL};fi;bash agent-install.sh ${Project_ID} ${Version} ${Region_Name} ${Flag}
    Example command for the AKSK model:
    export AGENT_INSTALL_URL=https://${Region_Name}-servicestage-vmapp.obs.${Region_Name}.${Domain_Name}/vmapp/agent/agent-install.sh;if [ -f `which curl` ];then curl -# -O -k ${AGENT_INSTALL_URL};else wget --no-check-certificate ${AGENT_INSTALL_URL};fi;bash agent-install.sh ${AK}${SK} ${Project_ID} ${Version} ${Region_Name} ${Flag}
    • AGENT_INSTALL_URL indicates the installation address of the agent.
    • If the Agency model is used, the ECS node has the permission to obtain the temporary AK/SK of the user. In this case, you do not need to enter AK/SK in the command.
    • ${AK} and ${SK} indicate access keys.
    • ${Region_Name} indicates a region name.
    • ${Domain_Name} indicates the global domain name.
    • ${Project_ID} indicates a project ID. For details about how to obtain a project ID, see API Credentials.
    • ${Version} is the version number. Use latest to automatically download the latest version.
    • ${Flag} is a Boolean value, indicating whether to automatically add the application access port. true indicates yes and false indicates no.

  7. Log in to the VM and run the installation command.

    If the VM agent fails to be installed, see What Should I Do If I Don't See the VM Agent After Installing It?