VMAgent Manager

To deploy an application to a virtual machine (VM), you need to install the agent. After the host is managed, the backend can communicate with the host.

To install the Agent, perform the following steps:

  1. Log in to ServiceStage, and choose Infrastructure > VM Agent Manager.
  2. On the VM Agent Management page, locate the VM where the agent is to be installed and click Install.
  3. On the page that is displayed, select an authorization model.

    Authorize the agent to use your identity authentication information to obtain the deploy, upgrade, start, and stop tasks of an application and execute the task. You can select agency or AK/SK to perform authorization. You are advised to use agency.

    • Select Agency Authorization for Authorization Mode.
      1. Select a created agency. For details about how to create a delegate, see Creating an Agency.
      2. On the ECS details page, set the ECS agency.
      Figure 1 Setting ECS agency

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

    • Select AKSK for Authorization Mode.

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

  4. Enter AK/K.

    Figure 2 Installing Agent

  5. Set whether to add application access port automatically.
  6. Copy the command automatically generated in the lower part of the window, that is, the agent installation command.

    export AGENT_INSTALL_URL=https://servicestage-vmapp.obs.cn-xxxxx-1.myhwclouds.com/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}} true

    Commands are described as follows:

    • In the preceding command, AGENT_INSTALL_URL indicates the installation address of the Agent.
      • If region is set to CN-North-Beijing1, AGENT_INSTALL_URL=https://servicestage-vmapp.obs.cn-north-1.myhwclouds.com/vmapp/agent/agent-install.sh.
      • If other regions are used, AGENT_INSTALL_URL=https://${region_name}-servicestage-vmapp.obs.${region_name}.myhwclouds.com/vmapp/agent/agent-install.sh.
    • If agency authorization 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. If AK/SK authorization is used, you need to enter the AK/SK value in the command.
    • project_id is the 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.
    • region_name, for example, cn-xxxxx-1.
    • true: application access port is added automatically.

  7. Use a remote login tool, such as PuTTY, or switch to the ECS host details page, click Remote Login in the upper right corner, log in to the host to be installed as the root user, and run the command in 6. If the message "Install agent success!" is displayed, the installation is successful. After successful installation, check the agent status in the node list.