Server Migration Center (SMC) allows you to migrate servers to Container Registry. You can migrate containerized applications to Container Registry at low costs. Application containerization achieves automatic management and distribution of computing resources and ensures fast and secure deployment of applications. This improves resource usage and reduces computing 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 Activate an account and Create a repository.
- A RAM role is created for the intermediate instance that is generated by SMC for migration. Set the following parameters to configure the RAM role. For more information, see Create a RAM role for a trusted Alibaba Cloud service.
- Select Alibaba Cloud Service as the trusted entity type.
- Select Normal Service Role as the role type.
- Select Elastic Compute Service as the trusted 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 of 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 versions to import the information of the source server. Click here to download the latest version of the SMC client.
Background information
- For information about Docker container images, see Concepts.
- During migration, SMC creates an intermediate instance. You are charged a small fee for the intermediate instance. 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.
Procedure
(Optional) Step 1: Exclude dynamic data directories
To ensure stable migration, we recommend that you exclude dynamic data directories, such as data directories of large databases. Then, you can pause the services on the source server and start the migration task. Skip this step if you do not need to exclude dynamic data directories.
You do not need to stop services on the source server to exclude dynamic data directories. To exclude dynamic data directories, 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.
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.