After you register a third-party server as an Alibaba Cloud managed instance, you can use various online services provided by Alibaba Cloud (such as Cloud Assistant, CloudOps Orchestration Service and Apsara Devops) to manage or use the server. For example, you can use Cloud Assistant to manage the server without logging on to the server.
Limits
Third-party server limits
The server must run an operating system of one of the following versions:
Alibaba Cloud Linux 2/3
CentOS 6 and later
CoreOS and OpenSUSE
Debian 8, Debian 9, Debian 10, and later
Red Hat 5, Red Hat 6, Red Hat 7, and later
SUSE Linux Enterprise Server (SLES) 11, SLES 12, SLES 15, and later
Ubuntu 12, Ubuntu 14, Ubuntu 16, Ubuntu 18, and later
Windows Server 2012, Windows Server 2016, Windows Server 2019, and later
The server can access the Internet.
Region limits for the managed instance feature
The managed instance feature is supported only in the following regions:
China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), China (Hong Kong), Japan (Tokyo), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), Thailand (Bangkok), Germany (Frankfurt), UK (London), US (Silicon Valley), US (Virginia), UAE (Dubai), SAU (Riyadh - Partner Region).
Billing
The managed instance feature is provided by Alibaba Cloud free of charge.
After you register a third-party server as an Alibaba Cloud managed instance, you are charged when you use other Alibaba Cloud services. Specific billing rules vary based on the service you use.
Step 1: Create a registration code
To register a third-party server as an Alibaba Cloud managed instance, create a registration code which is known as an activation code and then apply the code to the server. A registration code is a credential used to verify the identity of a server to ensure that only legitimate servers can be registered as Alibaba Cloud managed instances.
A single registration code can be used to register up to 1,000 managed instances.
You can create up to 5,000 registration codes for instances in a region.
When you create more than 1,000 registration codes, more registration codes can be created only if the registration code usage is greater than 50%.
On the ECS Cloud Assistant page, click the Manage Instances tab. Then, click Register Instance. In the Registered Instances/Registration Quota column, you can view the registration code usage data.
- ECS console - Storage Capacity Units
In the top navigation bar, select the region and resource group of the resource that you want to manage.
ImportantThe created registration code and the registered managed instances belong to the region.
We recommend that you select the region where the network is connected at the fastest speed. You can use the ping command on the third-party server to test the connection speed and select the region with the fastest connection speed.
<RegionId>
: You can obtain the region ID from Regions and zones.ping -c 4 <RegionId>.axt.aliyuncs.com
On the Managed Instances tab, create a registration code.
Scenario 1: If no instances are registered in the current region, click Create Registration Code, and then go to Step 4.
Scenario 2: If instances are registered in the current region, click Register New Instance. Then, in the Register New Instance panel, click Create Registration Code.
In the Create Registration Code panel, configure the parameters for the managed instance.
Parameter
Description
Instance Name Prefix
Specifies the prefix of the names of instances to be managed for subsequent management.
Source IP Limit
The IP addresses or CIDR blocks of managed instances.
If you enter the public IP addresses or CIDR blocks, only the servers whose IP addresses are within the specified IP address range can be managed.
If you do not specify this parameter, all servers can be registered as managed instances.
Activation Quota
Specifies the number of managed instances.
Valid values: 1 to 1000. Default value: 10.
Validity Period
The validity period of the registration code. If the registration code is not used within the validity period, the registration code cannot be used to register new hosts. You must create a new registration code.
Default value: 4. Unit: hours.
Description
The description of the registration code. You can enter information such as the purpose of the code for subsequent management.
Tag
The Tag Key and Tag Value of the registration code for subsequent classification, management, and maintenance.
ImportantThe managed instances that are registered with the registration code are automatically added the Tag Key and Tag Value that are set for the registration code.
Resource Group
The resource group to which the managed instances are added. The resource group is used to manage the instances based on the purpose and permissions of the instances.
ImportantThe managed instances that are registered with the registration code are automatically added to the resource group that corresponds to the registration code.
If you do not specify a resource group ID, the managed instances are added to your default resource group.
For information about RAM access policies and resource group authentication for managed instances, see Custom policy examples for managed instances and Resource groups and authorization.
Click Generate Registration Code.
After the operation is complete, the installation scripts that need to be executed on the third-party server are generated.
Obtain the installation scripts.
Select the operating system type of the server, and click Download or Copy to save the installation scripts to your computer.
RPM package: applicable to operating systems such as Alibaba Cloud Linux, CentOS, RHEL, and SUSE Linux.
DEB package: applicable to operating systems such as Debian and Ubuntu.
EXE package: applicable to Windows Server operating systems.
ImportantAfter the registration code is generated, the installation scripts are displayed only once. You must save the suitable installation scripts to your computer. For example, save the scripts as
installAssistant.sh
for subsequent installation and registration.If your servers run different operating systems, you must download the corresponding installation scripts.
Step 2: Install Cloud Assistant Agent on the server and register the instance
Register the server as a managed instance by using the installation scripts that are generated when you create the registration code.
Linux servers
The server can directly access the Internet
Log on to your third-party server.
Create an installation script on the server.
Run the following command to create a script file, and copy the installation script that you obtained in Step 6 to the script file.
vim installAssistant.sh
Press the
Esc
key, and then enter:wq
to save the file.
Run the following command to grant execution permissions on the installation script:
sudo chmod 755 installAssistant.sh
Run the following command to install Cloud Assistant Agent on the server:
sudo ./installAssistant.sh
After the installation is complete, if the following information is returned, the installation is successful.
The server can access the Internet only through a proxy server
This section describes how to install Cloud Assistant Agent through a proxy server and register a managed instance through a proxy server. CentOS 7.8 is used in this example.
Log on to the server by SSH.
For more information, see Connection methods.
Run the following command to download Cloud Assistant Agent through a proxy server:
x86 architecture:
sudo https_proxy=<http://your_proxy_address> && wget https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm
ARM architecture:
sudo https_proxy=<http://your_proxy_address> && wget https://aliyun-client-assist.oss-accelerate.aliyuncs.com/arm/aliyun-assist-latest-1.aarch64.rpm
ImportantYou must change
<http://your_proxy_address>
to your proxy server address.Run the following command to install Cloud Assistant Agent:
x86 architecture:
sudo rpm -ivh aliyun_assist_latest.rpm --force
ARM architecture:
sudo rpm -ivh aliyun-assist-latest-1.aarch64.rpm --force
Configure a proxy for Cloud Assistant.
Modify the Cloud Assistant service configuration file.
Modify the Cloud Assistant service configuration file and configure the ALIYUN_ASSIST_PROXY environment variable. Perform the following steps:
Create the /etc/sysconfig/aliyun file by using vim.
sudo vim /etc/sysconfig/aliyun
Enter the following content. Then, save and close the file.
ALIYUN_ASSIST_PROXY=<http://your_proxy_address>
ImportantYou must change
<http://your_proxy_address>
to your proxy server address.
Run the following command to reload the systemd configuration:
sudo systemctl daemon-reload
Run the following command to restart Cloud Assistant:
sudo systemctl restart aliyun.service
After Cloud Assistant is started, if the /usr/local/share/aliyun-assist/{version}/log/aliyun_assist_main.log
Detected environment variable ALIYUN_ASSIST_PROXY for proxy setting
information exists in the Cloud Assistant log (default log path: ), a proxy is configured for Cloud Assistant.
Run the following command to register a Cloud Assistant managed instance through a proxy server:
Run the following command to configure a proxy server:
sudo export ALIYUN_ASSIST_PROXY=<http://your_proxy_address>
ImportantYou must change
<http://your_proxy_address>
to your proxy server address.Run the following command to register the server as an instance managed by Cloud Assistant:
ImportantThis is only an example. You must directly copy the code that is generated in Step 6 in the console.
sudo aliyun-service --register --RegionId "cn-hangzhou" \ --ActivationCode "a-hz0f5KlGmF/TsM5uBuq7Eqor+****" \ --ActivationId "045CE381-0404-4F42-A44B-CC232B3E****"
A server is connected to a virtual private cloud (VPC) by using Express Connect
This section describes how to install Cloud Assistant Agent by using Express Connect and register a managed instance in a VPC. CentOS is used in this example.
Log on to the server by using SSH.
For more information, see Connection methods.
Run the following script to register a managed instance in a VPC:
The following code is an example. You must change the values of
RegionId
,ActivationCode
, andActivationId
to the values in the automatically generated script in Step 6.CentOS operating system
#/bin/bash ## Specify a region based on the geographical location of the server. regionId="cn-hangzhou" if [[ -n $regionId ]]; then bucket="aliyun-client-assist-${regionId}.oss-${regionId}-internal.aliyuncs.com" ## Download Cloud Assistant Agent. wget -q https://${bucket}/linux/aliyun_assist_latest.rpm ## Install Cloud Assistant Agent. sudo rpm -ivh aliyun_assist_latest.rpm --force fi ## Register the server as a managed instance in a VPC. Enter the following setting to set the network type to VPC: NetworkMode "vpc" ## Copy the values of RegionId, ActivationCode, and ActivationId from the place where the registration code was created in the ECS console. sudo aliyun-service --register \ --NetworkMode "vpc" \ --RegionId "${regionId}" \ --ActivationCode "a-hz0f5KlGmF/TsM5uBuq7Eqor+****" \ --ActivationId "2C217D35-FE6C-5636-BC3C-CC480D3*****"
Debian and other Linux operating systems
#/bin/bash ## Specify a region based on the geographical location of the server. regionId="cn-hangzhou" if [[ -n $regionId ]]; then bucket="aliyun-client-assist-${regionId}.oss-${regionId}-internal.aliyuncs.com" ## Download Cloud Assistant Agent. wget -q https://${bucket}/linux/aliyun_assist_latest.deb ## Install Cloud Assistant Agent. sudo dpkg -i aliyun_assist_latest.deb fi ## Register the server as a managed instance in a VPC. Enter the following setting to set the network type to VPC: NetworkMode "vpc" ## Copy the values of RegionId, ActivationCode, and ActivationId from the place where the registration code was generated in the ECS console. sudo aliyun-service --register \ --NetworkMode "vpc" \ --RegionId "${regionId}" \ --ActivationCode "a-hz0f5KlGmF/TsM5uBuq7Eqor+****" \ --ActivationId "2C217D35-FE6C-5636-BC3C-CC480D3*****"
Windows servers
The server can directly access the Internet
Remotely log on to the server by using Remote Desktop Connection.
For more information, see Connection methods.
Upload the installation script to the server.
The installation script is the one that is generated when you create the registration code, which is the installation script generated in Step 6.
NoteRemote Desktop Connection allows you to directly copy the script file to the server. If the script file cannot be directly copied due to network environment limits, you can upload scripts by using FTP or other software.
Right-click the installation script and select Run With PowerShell to start installing Cloud Assistant Agent.
The server can access the Internet only through a proxy server
This section describes how to install Cloud Assistant Agent through a proxy server and register a managed instance through a proxy server. Windows Server 2016 Datacenter is used in this example.
Remotely log on to the server by using Remote Desktop Connection.
For more information, see Connection methods.
Configure a proxy server for the browser.
Select .
Click Network And Internet.
Click Network And Sharing Center.
Click Internet Options in the lower-left corner.
Click the Connections tab, and then click LAN Settings.
In the Proxy Server section, configure the address and port of your proxy server, and then click OK.
Download the Cloud Assistant Agent installation package.
Click Start, and select .
Right-click Windows PowerShell and select Run As Administrator.
In the Windows PowerShell dialog box, run the following command to download the Cloud Assistant Agent installation package:
Invoke-WebRequest -Uri 'https://aliyun-client-assist.oss-accelerate.aliyuncs.com/windows/aliyun_agent_latest_setup.exe' -OutFile 'C:\\aliyun_agent_latest_setup.exe'
After the download is complete, install Cloud Assistant Agent.
Go to the C:\ drive.
Double-click aliyun_agent_latest_setup.exe and follow the installation wizard to install Cloud Assistant Agent.
Configure a proxy server for Cloud Assistant.
Select .
Click System And Security.
Click System.
Click Advanced System Settings on the left.
Click the Advanced tab, and then click Environment Variables.
In the System Variables section, click New.
Configure Variable Name and Variable Value, and then click OK.
Variable Name: Set this parameter to ALIYUN_ASSIST_PROXY.
Variable Value: Set this parameter to your proxy server.
Run the following command in Windows PowerShell to restart Cloud Assistant:
Run the following command to stop Cloud Assistant:
net stop AliyunService
Run the following command to restart Cloud Assistant:
net start AliyunService
Register a Cloud Assistant managed instance through a proxy server in Windows PowerShell.
Run the following command to go to the directory where Cloud Assistant Agent is installed:
cd C:\ProgramData\aliyun\assist\{version}
Important{version}
indicates the version of Cloud Assistant. You must change it to the specific version that is installed.Run the following command to register the Windows server as an instance managed by Cloud Assistant:
The following command is an example. You must change the values of
RegionId
,ActivationCode
, andActivationId
to the values in the automatically generated script in Step 6..\aliyun_assist_service.exe --register --RegionId="cn-hangzhou" --ActivationCode="a-hz0f6dB8Fg6hhtK0A5n9xqqdH****" --ActivationId="0A2E5ECE-5C71-4FA3-807B-05962C25****"
A server is connected to a virtual private cloud (VPC) by using Express Connect
This section describes how to install Cloud Assistant Agent by using Express Connect and register a managed instance. Windows Server 2016 Datacenter is used in this example.
Remotely log on to the server by using Remote Desktop Connection.
For more information, see Connection methods.
Click Start, and select .
Right-click Windows PowerShell and select Run As Administrator.
Run the following command in the Windows PowerShell dialog box:
The following command is an example. You must change the values of
RegionId
,ActivationCode
, andActivationId
to the values in the automatically generated script in Step 6.$RegionId = "cn-hangzhou" $Bucket = "aliyun-client-assist-${RegionId}.oss-${RegionId}-internal.aliyuncs.com" Invoke-WebRequest -Uri "https://${Bucket}/windows/aliyun_agent_latest_setup.exe" ` -OutFile 'C:\\aliyun_agent_latest_setup.exe' &"C:\\aliyun_agent_latest_setup.exe" '/S' '--register' ` '--NetworkMode="vpc"' '--RegionId="cn-hangzhou"' ` '--ActivationCode="a-hz0f6dB8Fg6hhtK0A5n9xqqdH****"' ` '--ActivationId="0A2E5ECE-5C71-4FA3-807B-05962C25****"' type C:\ProgramData\aliyun\assist\hybrid\instance-id Start-Sleep -s 30 net stop AliyunService net start AliyunService
Step 3: Verify that the third-party server is managed by Alibaba Cloud
After you install Cloud Assistant Agent on the server and register the instance, you must go back to the ECS console to check whether the managed instance is connected. If the managed instance is connected, the third-party server is managed by Alibaba Cloud.
- ECS console - Storage Capacity Units
In the top navigation bar, select the region and resource group of the resource that you want to manage.
On the Managed Instances tab, view the list of managed instances.
By default, all resources under the current Alibaba Cloud account are displayed. You can select a resource group from the All Resources In Account drop-down list in the upper-left corner of the Cloud Assistant console to view the managed instances and registration codes in the resource group.
As shown in the preceding figure, if the Connection Status of a managed instance is Connected, the server is managed by Alibaba Cloud.
After your third-party server is registered as a managed instance, you can use Cloud Assistant to manage the server without the need to log on to the server. For more information about how to use Cloud Assistant, see Create and run a command and Send a local file to an ECS instance.
(Optional) Deregister managed instances
If you no longer want to use Alibaba Cloud to manage a third-party server, deregister the managed instance and then stop and uninstall Cloud Assistant.
Linux servers
Log on to the server by SSH.
For more information, see Connection methods.
Run the following command to deregister the managed instance:
sudo aliyun-service --deregister
Disable and uninstall the Cloud Assistant daemon process.
Run the following command to disable the Cloud Assistant daemon process:
sudo /usr/local/share/assist-daemon/assist_daemon --stop
Note/usr/local/share/assist-daemon/assist_daemon is the default path of the Cloud Assistant daemon process.
Run the following command to uninstall the Cloud Assistant daemon process:
sudo /usr/local/share/assist-daemon/assist_daemon --delete
Run the following command to disable Cloud Assistant Agent:
NoteThe initialization process service used by the server varies based on the version of the Linux kernel. Linux that runs a recent kernel version (such as Ubuntu 18.04) generally uses the systemd initialization process service. In this example, the systemd initialization process service is used. For information about operations for other initialization process services, see Start, stop, or uninstall Cloud Assistant Agent.
sudo systemctl stop aliyun.service
Run the following command to uninstall Cloud Assistant Agent:
To uninstall the Cloud Assistant RPM package, run the following command:
sudo rpm -qa | grep aliyun_assist | xargs sudo rpm -e
To uninstall the Cloud Assistant DEB package, run the following command:
sudo dpkg -r aliyun-assist
Delete the Cloud Assistant daemon process and Cloud Assistant Agent.
Run the following command to delete the directory where the Cloud Assistant daemon process is stored:
sudo rm -rf /usr/local/share/assist-daemon
Run the following command to delete the Cloud Assistant Agent directory:
sudo rm -rf /usr/local/share/aliyun-assist
Windows server
In this example, a server that runs Windows Server 2019 is used. The paths for Windows PowerShell and services vary based on the Windows version.
Remotely log on to the server by using Remote Desktop Connection.
For more information, see Connection methods.
Run Windows PowerShell.
Click Start.
Select
.Right-click Windows PowerShell and select Run As Administrator.
Run the following command in Windows PowerShell to unregister the managed instance:
aliyun-service --deregister
Open the Services window.
Click Start.
Select
.
Find Aliyun Assist Service and click Stop The Service.
FAQ
Why is the connection status of a managed instance displayed as Not Connected?
If Cloud Assistant is abnormal or the status is displayed as Not Connected, the issue may be related to the running status of Cloud Assistant Agent. Log on to the managed server and run the systemctl status aliyun.service
command to check the running status of Cloud Assistant.
running
indicates that Cloud Assistant is running properly.If the status is not
running
, run thesystemctl restart aliyun.service
command to restart Cloud Assistant. For more information about Cloud Assistant issues, see View the status of Cloud Assistant and handle exceptions.For other issues, collect logs (
/usr/local/share/aliyun-assist/<version>/log
) and contact Alibaba Cloud technical support.
How do I view existing registration codes?
Click Register New Instance. Then, in the Register New Instance panel, you can view the list of existing registration codes and create new registration codes.
The validity period of the activation code exceeds the limit?
When creating a registration code, if you receive the prompt The Valid Usage Time Of The Activation Code Exceeds The Limit, with the error code
ActivationTTL.ExceedLimit
, it indicates that the Validity Period parameter you set does not meet the requirements. Please reduce the Validity Period parameter value and retry. The default Validity Period for registration codes is 4 hours.When registration expiration prevents the registration of a third-party server, the error code
activation_has_expired
is reported. This error indicates that the registration code has expired. You need to create a new registration code and then register again.
References
After you successfully register a managed instance, you can use various online services provided by Alibaba Cloud, such as Cloud Assistant, CloudOps Orchestration Service and Apsara Devops, as described below:
Cloud Assistant: Implements tasks such as automated O&M scripts, polling processes, software installation and uninstallation, starting or stopping services, and installing patches or security updates. For more information, see Use Cloud Assistant.
CloudOps Orchestration Service: Automates the management and execution of O&M tasks. For more information, see CloudOps Orchestration Service OOS.
You can also call the following Cloud Assistant APIs to manage activation codes and managed instances.