Help Center/ Server Migration Service/ FAQs/ Migration Network/ How Do I Configure a Source Server to Access Huawei Cloud Through a Proxy?
Updated on 2024-11-29 GMT+08:00

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

  1. Configure the proxy server.

    1. Install Squid.

    2. 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.

    3. Initialize Squid.

    4. Start Squid and set it to automatically start upon system boot.

  2. Download and install the Agent on the source server.

    • Linux
      1. 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
      2. Decompress the installation package.
        tar -zxvf SMS-Agent.tar.gz

      3. 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.

      4. 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.

    • Windows
      1. 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.

      2. 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.