How Do I Configure a Source Server to Access Huawei Cloud Through a Proxy?
Scenarios
Each source server must continuously communicate with SMS over the Internet. If the migration source cannot access the Internet, you can configure a proxy for it.
The IP address and port number in this FAQ are used as examples only.
Preparations
- Prepare a CentOS server that will serve as a proxy server. CentOS 7.2 64-bit is used as an example here.
The proxy server must be able to communicate with the source server over the private network.
- Obtain the Squid installation package.
Procedure
- Configure the proxy server.
- Install Squid.
- Edit the squid.conf file as follows.
http_port 3128 cache_mem 64 MB maximum_object_size 4 MB cache_dir ufs /var/spool/squid 100 16 256 access_log /var/log/squid/access.log acl localnet src 192.168.0.0/16 http_access allow localnet http_access deny all
http_port is the port specified for Squid. acl localnet src is the private IP address of the source server that needs to access the Internet using the proxy server. You can also set acl localnet src to 0.0.0.0/0 to allow access from all servers.
- Initialize Squid.
- Start Squid and set it to automatically start upon system boot.
- Download and install the Agent on the source server.
- Linux
- Run the following command on the source server to download the Agent:
curl -x http://<proxy-server-IP-address>:<proxy-port> -O https://sms-resource-intl-ap-southeast-3.obs.ap-southeast-3.myhuaweicloud.com/SMS-Agent.tar.gz
- Decompress the installation package.
tar -zxvf SMS-Agent.tar.gz
- Go to the SMS-Agent/agent/config directory and modify the auth.cfg file.
proxy_addr indicates the private IP address of the proxy server that the source server uses to access SMS over port 3128. This IP address is different from the IP address of the target server.
- Enter the AK/SK pair of the Huawei Cloud account you will use for migration as prompted.
When the message "sms agent starts up successfully" is displayed, the Agent has started and will start reporting source server information to SMS.
- Run the following command on the source server to download the Agent:
- Windows
- Download and install the Agent on the source server.
- If the source server runs Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows 8.1, run the following command in PowerShell on the source server to download the Agent:
Invoke-WebRequest -Proxy http://<proxy-server-IP-address>:<proxy-port> -Uri https://sms-resource-intl-ap-southeast-3.obs.ap-southeast-3.myhuaweicloud.com/SMS-Agent-Py3.exe -OutFile C:\\SMS-Agent-Py3.exe -UseBasicParsing
- If the source server runs Windows Server 2008 or Windows 7, download the Agent (Python 2) from the proxy server, upload the Agent package to the source server, and install the Agent.
For details, see Installing the Windows Agent.
- If the source server runs Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows 8.1, run the following command in PowerShell on the source server to download the Agent:
- In the displayed SMS-Agent GUI, enter the AK/SK pair of the Huawei Cloud account you will use for migration, and click Start.
- If you do not need to use an HTTPS proxy, select Directly connection.
- If you need to use an HTTPS proxy, select Use proxy and enter the IP address, port number, username, and password of the proxy server. Ignore Proxy user name and Password because no username or password is configured for the proxy server in this example.
proxy_addr indicates the private IP address of the proxy server that the source server uses to access SMS over port 3128. This IP address is different from the IP address of the target server.
When the message "Upload success. Waiting for the SMS instruction" is displayed, the Agent has been started. You can sign in to the SMS console and perform subsequent operations.
After a Windows source server is migrated, you are advised to reset the browser proxy settings to avoid its effects on the source server.
- Download and install the Agent on the source server.
- Linux
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