Server Migration Center (SMC) allows you to migrate servers to Container Registry. You can use SMC to migrate containerized applications to Container Registry at low costs. Containerized applications achieve automatic management and distribution of compute resources and ensure the fast and secure deployment of applications. This improves resource usage and reduces compute costs. This topic describes how to migrate a server to Container Registry.
Prerequisites
- The server is not based on a Windows operating system.
- Container Registry is activated and a container image repository is created. For more information, see Create a repository and build images.
- A Resource Access Management (RAM) role is created for the intermediate instance that
is generated by SMC for migration. The following parameters are used to configure
the RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud service.
- Trusted Entity Type: Select Alibaba Cloud Service.
- Role Type: Select Normal Service Role.
- Trusted Service: Select Elastic Compute Service.
- A custom policy is created for the RAM role of the intermediate instance. The policy
grants the minimum permissions that are required to migrate a server to Container
Registry. The following example shows a sample policy. This policy is attached to
the RAM role. For more information, see Create a custom policy and Grant permissions to a RAM role.
{ "Statement": [ { "Effect": "Allow", "Action": [ "cr:GetAuthorizationToken", "cr:PushRepository", "cr:PullRepository", "cr:CreateRepository" ], "Resource": [ "*" ] } ], "Version": "1" }
- The information about the source server is imported to the SMC console. For more information,
see Step 1: Import the information of a migration source.
Notice
- The SMC client V2.3.0 and later support server migration to Container Registry. You can use these SMC clients to import the information about the source server. Download the latest version of the SMC client.
- Ensure that the client-side program is running during migration. If data transfer is interrupted, you can restart the client and the migration task to resume migration.
Background information
- For information about Docker container images, see Terms.
- During migration, SMC creates an intermediate instance. The intermediate instance incurs a small fee. For more information, see Pay-as-you-go.
- SMC releases the intermediate instance after the migration task enters the Finished or Expired state, or when the task is deleted.
(Optional) Step 1: Exclude dynamic data directories from migration
To ensure stable migration, we recommend that you exclude dynamic data directories, such as data directories of large databases. Then, you can stop the services on the source server and start the migration task. Skip this step if you do not need to exclude dynamic data directories.
To exclude dynamic data directories, perform the following steps. You do not need to stop services that are running on the source server. To enable the throttling environment, perform the following steps:
Step 2: Create and start a migration task
You can perform the following steps to exclude dynamic data directories. You do not need to stop your services that are running on the source server. To enable the throttling environment, perform the following steps:
Step 3: Verify the container image
After you migrate the source server to Container Registry, a container image is created. Perform the following steps to verify the container image. A container image on which NGINX is deployed is used as an example.