Installing the MgC Agent on Windows
The MgC Agent for Windows is used to collect details of resources such as servers, storage systems, and containers. It also works with migration workflows to migrate applications and data to the cloud.
Precautions
Item |
Description |
---|---|
Version upgrade |
|
Rollback |
|
Disk space reservation |
During the execution of server migration workflows, the disk space occupied by the MgC Agent increases by about 1 MB to 2 MB each time a server is migrated. You can calculate the available disk space based on the number of servers to be migrated and reserve at least 2 MB space for each server. For example, if you plan to migrate 10 servers, reserve at least 20 MB disk space. To prevent excessive disk space usage, you are advised to periodically delete historical logs in the MgC Agent installation path after the migration is complete. The paths are as follows:
All these logs are stored in folders named by date. You can delete older log files to free up disk space and maintain system stability. |
Preparations
- Prepare a Windows server for installing the MgC Agent (formerly Edge) in the source intranet environment. The Windows server must:
- Run Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows Server 8.1.
- Use PowerShell 3.0 or later.
- Have at least 4 CPUs and 8 GB of memory.
- Have at least 20 GB of available space on the drive (drive C by default) for installing the MgC Agent.
- Be able to access the Internet and the domain names of MgC, IoTDA, and other cloud services. For details about the domain names to be accessed, see Domain Names.
- Allow the ports required by the MgC Agent (formerly Edge). For details about the required ports, see Communication Matrix.
- Allow outbound traffic on port 8883 if the server is in a security group.
- Not have any antivirus or protection software enabled. This type of software may stop the MgC Agent from executing migration commands, resulting in migration failures.
Do not install the MgC Agent on a source server to be migrated.
- High resource consumption: The MgC Agent consumes CPU and memory resources during collection and migration. If a large number of migration tasks are performed by the MgC Agent, services on the source server may be affected.
- Port occupation: The MgC Agent occupies some ports on the server, which may affect services running on it.
- Sign up for a HUAWEI ID and enable Huawei Cloud services, and obtain an AK/SK pair for the account.
- Create a migration project on the MgC console.
Requirements for Source Servers
When the MgC Agent is used to collect data from and migrate source servers, the source servers must meet the requirements below.
- Allow access from the server where the MgC Agent is installed over port 5985.
- Use PowerShell 3.0 or later.
- Have WinRM enabled and be able to access the server where the MgC Agent is installed. For more information, see How Do I Configure WinRM and Troubleshoot WinRM Connection Problems?
- Allow the execution of shell scripts. To review the current execution policy, you can open PowerShell on the source servers as an administrator and run the following command:
Get-ExecutionPolicy
If Restricted is returned, no scripts can be executed. Run the following command and enter Y to change the policy to RemoteSigned:Set-ExecutionPolicy RemoteSigned
- Allow access from the server where the MgC Agent is installed over port 22.
- Allow direct root access. That means remote connections using root with SSH or other tools must be allowed on these Linux source servers.
- Have SFTP and SSH enabled.
- Support the following key exchange algorithms and MAC algorithms:
- Key exchange algorithms: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, rsa-sha2-512, and rsa-sha2-256
- MAC algorithms: hmac-sha2-256 and hmac-sha2-512
If a server does not support the preceding security algorithms, you are advised to upgrade OpenSSH to 8.0 or later. Otherwise, deep collection cannot be performed for that server.
- Have their iptables configured to allow all communications with the server where the MgC Agent is installed. To verify that, you can run the following command on the source servers. If the source field in the command output contains the IP address and port of the server where the MgC Agent is installed, it means that the MgC Agent is not allowed to access these source servers. In this case, you need to allow access from the MgC Agent.
iptables -L INPUT -v -n
Run the following command to allow the access.iptables -D INPUT -s <IP-address-of-the-MgC-Agent-server-indicated-by-the-source-field>
Downloading and Installing the MgC Agent
- Sign in to the MgC console from the Windows server you prepared.
- In the navigation pane, choose MgC Agent.
- In the Windows area, click Download Installation Package to download the MgC Agent installation package to the Windows server you prepared.
- Decompress the downloaded MgC Agent installation package and double-click the installation program to start the installation. If the installation program cannot be launched, try to run it in compatibility mode. For details, see How Do I Run the MgC Agent in Compatibility Mode? The default installation directory is C:\ and cannot be changed.
- Click Finish to complete the installation and open the MgC Agent console.
Signing In to the MgC Agent Console
You can log in to the MgC Agent using any of the methods below. However, data cannot be exchanged between different login modes. If you change the login mode or credentials, any data associated with your previous login mode and credentials will be lost. It is important to choose your login mode carefully.
This mode is designed for offline collection. After login, you can determine whether to connect to MgC. A username and password must be set up. It is essential to keep them secure.
- On the login page, select Local Account.
- On the Register page, set a username and password, confirm the password, and click Privacy Statement.
- Read the privacy statement carefully before selecting I have read and agree to the Privacy Statement, and click Register.
You are advised to change your password every three to six months.
- After the registration is successful, enter the registered username and password, and click Log In to open the Overview page of the MgC Agent console.
This mode is intended for migration scenarios. You do not need to create a local account, but the network conditions for accessing MgC must be met.
- On the login page, select Huawei Cloud Access Key.
- Enter an AK/SK pair of your Huawei Cloud account, and select the region where you create migration projects on MgC from the drop-down list.
- Click Log In. The Overview page of the MgC Agent console will open.
This mode is applicable to migration scenarios. The MgC Agent must be deployed on a Huawei Cloud ECS that has been granted MgC permissions through an agency. If metadata access is enabled for the ECS and Metadata Version is set to Only V2 (Token), the MgC Agent version must be 25.4.2 or later.
- Create a custom policy in JSON view. Specify a policy name and copy the following content to the Policy Content box:
{ "Version": "1.1", "Statement": [ { "Action": [ "mgc:*:query*", "mgc:*:discovery", "mgc:*:assess", "mgc:*:migrate", "iam:agencies:listAgencies", "iam:roles:listRoles", "iam:quotas:listQuotas", "iam:permissions:listRolesForAgency" ], "Effect": "Allow" } ] }
If you need to use MgC migration workflows to migrate servers, you also need to create a project-level and a global-level SMS custom policy. For details, see SMS Custom Policies.
- Create a cloud service agency and grant permissions. Set Agency Type to Cloud service and select Elastic Cloud Server (ECS) and Bare Metal Server (BMS) from the Cloud Service drop-down list. After the agency is created, click Authorize and select the custom policy created in 1. If server migration is required, select the SMS custom policies created in 1 at the same time.
- Return to the MgC Agent login page and select Huawei Cloud ECS Agency for Login Mode.
- Select the region where you create migration projects on MgC from the drop-down list.
- Click Log In. The Overview page of the MgC Agent console will open.
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