Installing a VM Agent
This section describes how to install the VM agent for a single managed VM in the VM environment.
Prerequisites
VM resources have been managed in the VM environment, and no VM agent is installed. For details, see Managing Basic Resources.
Installing a VM Agent
- Log in to ServiceStage.
- On the Environment Management page, click the target environment of the VM type.
- In the Resources area, choose ECSs 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 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.
To use OBS, you need to add the OBS Administrator policy during agency authorization.
- 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.
- Select Agency for Authorization Model:
- 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.
- Log in to the VM and run the installation command.
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?
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