Managing VM Agents
To deploy a component to a VM (ECS or custom server), you need to install the VM agent. After the host node is managed, the backend can communicate with the host node.
VM Agent Status Description
For details about the VM agent status and description, see Table 1.
Agent Status |
Description |
---|---|
Agent uninstalled |
The VM agent is not installed on the ECS node. You need to install the VM 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? |
Upgrading |
The VM agent has been installed on the ECS node and is being upgraded. |
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. |
Agent unhealthy |
The VM agent has been installed on the VM node and is unhealthy. The node cannot access the ServiceStage domain name. To rectify the fault, see What Should I Do If the VM Agent Is Subhealthy? |
Supported OSs and Versions
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.
OS |
Version |
Description |
---|---|---|
EulerOS |
|
|
CentOS |
|
|
Fedora |
|
|
openEuler |
20.03 64bit |
Video Tutorial for Installing a VM Agent
Installing a VM Agent
This section describes how to install a VM agent for a single VM (ECS or custom server) managed in the VM or VM + Kubernetes environment. Before performing this operation, ensure that:
- VM resources have been managed in the environment, and no VM agent is installed. For details, see Managing Basic Resources.
- Python 2.x or later has been installed on the VM.
- Log in to ServiceStage.
- Choose Environment Management. The Environment Management page is displayed.
- Click the target VM environment. The Overview page is displayed.
- Choose ECSs or Custom servers from Compute.
- In the managed resource list, locate the VM where the agent is to be installed and click Install Agent in the Agent Status column.
- Select an Authorization Model to authorize the agent to use your authentication information for obtaining the deployment, upgrade, start, and stop tasks of an application and execute the task.
Authorization Model
Description
Agency
Only managed ECSs support this function.
- Click
and select an agency.
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.
- Click
.
AK/SK
For security purposes, obtain and use the AK/SK with the ServiceStage Development permission. The account to which the AK/SK belongs and the account for installing the VM agent must belong to the same user.
For details about how to obtain the AK/SK, see Access Keys.
Set AK/AK/SK Filling.- Manual
In the VM Agent installation command, {AK} and {SK} are placeholders and do not contain the actual AK and SK values. After copying the installation command and logging in to the VM to install the agent, manually enter the AK and SK values as prompted, which is more confidential.
- Quick entry
AK and SK are directly filled in the VM agent installation command. After copying the installation command, log in to the VM and enter the installation command to install the agent.
Enter the obtained AK and SK in the text boxes.
- Click
- Click Copy Command. The agent installation command is automatically generated in the lower part of the window.
- 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}
-
In AK/SK authentication mode, run the following commands to install the agent on an ECS:
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}
- In AK/SK authentication mode, run the following commands to install the agent on a custom server:
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} ${Domain_Name} ${Server_ID} ${Server_IP} ${Server_Name}
The parameters are described as follows:
Parameter
Description
AGENT_INSTALL_URL
Agent installation address.
{AK}, {SK}
Access key.
${Region_Name}
Region name. For example, ap-southeast-1.
${Domain_Name}
Global domain name.
${Project_ID}
Project ID.
For details about how to obtain a project ID, see API Credentials.
${Version}
Version number.
The default value is latest, indicating that the latest version is automatically downloaded.
${Flag}
Whether to automatically add the application access port.
- true: yes
- false: no
${Server_ID}
Unique ID of the custom server.
${Server_IP}
IP address of the custom server.
${Server_Name}
Name of the custom server.
- Example command for the Agency model:
- Log in to the VM and run the installation command.
Select Manual in 6, enter the installation command, press Enter, and enter the obtained AK and SK as prompted.
If the message "Install agent success!" is displayed, the installation was successful.- After the VM agent is installed, the following directories are generated on the VM where the agent is installed:
- /opt/application: directory for storing services and configuration files of VM-deployed components. Do not add, delete, or modify the directory. Otherwise, the installed VM agent may be offline.
- /opt/servicestage-agent: directory for storing configuration files of the VM agent. Do not add, delete, or modify the directory. Otherwise, the installed VM agent may be offline.
- /var/log/servicestage-agent: log directory of the installed VM agent, which stores the agent log agent.log and monitoring script log servicestage-agent-watchdog.log. Do not delete or modify the directory. Otherwise, the installed VM agent may be offline.
- /var/log/application: directory for storing component logs. Do not delete or modify the directory. Otherwise, the installed VM agent may be offline.
- /opt/ssa/packages: temporary directory for storing service packages of VM-deployed components. Do not delete or modify the directory. Otherwise, the installed VM agent may be offline.
- If the VM agent fails to be installed, see What Should I Do If I Don't See the VM Agent After Installing It?
- After the VM agent is installed, the following directories are generated on the VM where the agent is installed:
Upgrading a VM Agent
If the installed VM agent is in the Agent online state and a later version is available, you can upgrade the agent by referring to this section.
- Log in to ServiceStage.
- Choose Environment Management. The Environment Management page is displayed.
- Click the target VM environment. The Overview page is displayed.
- Choose ECSs or Custom servers from Compute.
- In the managed resource list, select the target resource and click Upgrade Agent.
- Click OK.
After Agent Status changes from Agent upgrading to Agent online, the VM agent has been upgraded.
Restarting a VM Agent
If the installed VM agent is in the Agent online state, you can restart the agent based on service requirements.
- Log in to ServiceStage.
- Choose Environment Management. The Environment Management page is displayed.
- Click the target VM environment. The Overview page is displayed.
- Choose ECSs or Custom servers from Compute.
- In the managed resource list, select the target resource and click Restart Agent.
- Click OK.
After Agent Status changes from Agent restarting to Agent online, the VM agent has been restarted.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot