When you deploy services in the cloud, you can import on-premises image files in the Alibaba Cloud Elastic Compute Service (ECS) console or have ECS images automatically generated for your servers by using Server Migration Center (SMC). This topic describes the use scenarios and operation procedures of the preceding methods.
Prerequisites
- Make sure that both your Alibaba Cloud account and Resource Access Management (RAM) user have the permissions that are required to import custom images.
- Log on to the RAM console by using your Alibaba Cloud account. Then, attach the
AliyunECSImageImportDefaultRole
role to ECS to grant access permissions on Object Storage Service (OSS) resources to ECS. - If you use a RAM user, contact the owner of the corresponding Alibaba Cloud account to grant operation permissions on OSS buckets to the RAM user before you proceed. For more information, see Grant permissions for different scenarios.
- Log on to the RAM console by using your Alibaba Cloud account. Then, attach the
- The URL of the image file is obtained in the OSS console. For more information, see Share objects.
- Make sure that you read and understand the usage limits and requirements of images. For more information, see Instructions for importing images.
Scenarios
Method | Scenario |
---|---|
Import a custom image in the ECS console | You can import custom images by using the ECS console in the following scenarios:
|
Import a custom image by using SMC | This method allows you to use SMC to migrate one or more servers such as servers in Internet data centers, virtual machines, or cloud servers from other cloud platforms to Alibaba Cloud. When your servers are migrated, SMC generates ECS images for the servers. |
Import a custom image in the ECS console
Video tutorial
The following video shows how to import a custom image in the ECS console.
To import an image file from your on-premises machine to ECS, perform the following steps:
Step 1: (Optional) Grant access permissions on OSS resources to ECS
The first time you import custom images, log on to the RAM console by using your Alibaba Cloud account. Then, attach the AliyunECSImageImportDefaultRole
role to ECS to grant access permissions on OSS resources to ECS. If ECS has access permissions on OSS resources, skip this step.
Step 2: Import a custom image in the ECS console
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the upper-left corner of the top navigation bar, select a region. Important Make sure that you select the region of the OSS bucket where the image file is stored.
- In the upper-right corner of the Images page, click Import Image.
- In the Prepare Before Import step, check whether the image meets the required conditions and click Next.
- In the message that appears, click Confirm.
- In the Import Image File step, configure the parameters that are described in the following table.
Parameter Required Description Current Region Yes This parameter is automatically set to the current region. To change the region, close the Import Image dialog box and select a different region in the left part of the top navigation bar. Then, click Import Image to re-open the Import Image dialog box and continue to configure other parameters. Important Make sure that you select the region of the OSS bucket where the image file is stored.Image File URL Yes Enter the URL of the image file. Image Name Yes Enter a name for the new custom image. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), colons (:), and hyphens (-). It must start with a letter. OS Type Yes Select the operating system type of the image that you want to import from OSS. Valid values: windows and linux. If your image is a non-standard platform image, select linux.
OS Version Yes Select the operating system version of the image that you want to import from OSS. - For information about supported operating system versions, see Instructions for importing images.
- If the operating system of your image is a custom distribution based on the Linux kernel, Submit a ticket.
Architecture Yes Select the operating system of the image that you want to import from OSS. Valid values: - 32-bit
- 64-bit
- ARM 64-bit
Image Check No The image check feature checks whether imported custom images are valid and whether the images can be used to create full-featured ECS instances. If you select Check After Import, the image is checked immediately after the image is imported to ECS. After the image is checked, you can click Details in the Status column that corresponds to the image in the custom image list to view the check results of the image and resolve issues based on the corresponding solutions that are provided in the results. For information about check items and solutions to image issues, see Image check items.Note Only specific operating systems support the image check feature. For information about operating systems that do not support the feature, see Operating system limits for image check.Boot Mode No Select the boot mode of the image that you want to import from OSS. Valid values: BIOS and UEFI. Image Format No Select the format of the image that you want to import from OSS. Valid values: Auto-detect, RAW, QCOW2, and VHD. - If you do not know the image format, you can select Auto-detect to allow the system to identify the image format.
- If you want to select an image format, we recommend that you select QCOW2 or VHD that generates a smaller transmission footprint.
Note- To import an ISO file to ECS, the ISO file must be converted to an image format supported by ECS. For more information, see How do I convert ISO files to image formats that are supported by ECS?
- You can also use Packer to create an image on your on-premises machine and import the image to ECS. For more information, see Use Packer to create and import an on-premises image and Alicloud Image Builder parameters used to implement DevOps.
License Type No Select a license type to activate the source operating system after the image is imported. Default value: Auto. Valid values: - Auto: Alibaba Cloud checks the source operating system and allocates a license. If this value is selected, the system checks whether a license has been allocated by Alibaba Cloud for your specified operating system version, and then performs an operation based on the check result.
- If a license has been allocated by Alibaba Cloud for the specified operating system version, the system allocates the license to the imported image.
- If no license has been allocated by Alibaba Cloud for the specified operating system version, the system switches the license type to BYOL.
- Alibaba Cloud License: the license allocated by Alibaba Cloud. If this value is selected, a license allocated by Alibaba Cloud is applied based on your selected operating system version.
- BYOL: the license that comes with the source operating system. If this value is selected, make sure that your license key can be used in Alibaba Cloud.
For information about Red Hat Cloud Access and Windows licenses, see Overview and Microsoft licenses and Software Assurance.
Disk Configurations No Specify the system disk size and add images that contain data from data disks. - Select Configure Disk Attributes.
- You need only to specify the system disk size. Other system disk parameters are set by default. The system disk can range from 5 to 2,048 GiB in size and cannot be smaller than the image file. Note The image file size is the size of the image file that you want to import to OSS. You can view the image file size in the OSS console.
- Click increaseData Disk and configure the parameters.
- Image File URL: Enter the URL of the data disk image file. Obtain the URL of the data disk image file by using the same method as the system disk.
- Mount Point: The parameter is set by the system.
- Image Format: Select the format of the image that you want to import from OSS. Valid values: Auto-detect, RAW, QCOW2, and VHD.
- Disk SizeGiB: The data disk can range from 5 to 2,048 GiB in size and cannot be smaller than the image file. Note The image file size is the size of the image file that you want to import to OSS. You can view the image file size in the OSS console.
Image Description No Enter a description for the new custom image. Tag No Add tags to the new custom image. You can use tags to classify images for simple search operations and batch operations. Resource Group No Specify a resource group for the new custom image to simplify management. Important If the scope of permissions that are granted to your RAM user is limited to a specific resource group, select that resource group. - Confirm that your configurations are correct and click OK. Then, the system creates a task to import the image.
Step 3: (Optional) View or cancel the image import task
- View the image import taskYou can go to the Images or Task Logs page to view the progress of the image import task.Note The period of time that is required to import a custom image varies based on the image file size and the number of ongoing concurrent import tasks.
When you import an image, a snapshot is automatically generated. You can view the information about the snapshot on the Snapshots page in the ECS console. When the image import task is in progress, the state of the snapshots is displayed as Failed. When the image import task is completed, the snapshots enter the Successful state and the image enters the Available state. The total size of the snapshots is equal to the size of the imported image file, regardless of the system disk size that you specified when you imported the image. Snapshots are billed based on the amount of storage space that is occupied. For more information, see Snapshots.
- Cancel the image import taskBefore the image import task is completed, you can cancel the task by using one of the following methods:
- Method 1: On the Custom Images tab of the Images page, find the image that is being imported and click Cancel Import in the Actions column.
- Method 2: On the Task Logs page, cancel the image import task.
- In the left-side navigation pane, choose .
- Find the image import task that you want to cancel and click Cancel in the Actions column.
Import a custom image by using SMC
To generate an ECS image for your server by using SMC, perform the following operations:
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- In the upper-right corner of the Images page, click Online SMC Migration. You are directed to the SMC console.
- In the SMC console, download the SMC client. Extract the SMC client, upload the SMC client to the source server, and then run the SMC client. Then, import the information about the source server to the SMC console.
- Create and start a migration task in the SMC console. Select ECS Image as the destination type. For more information, see Step 2: Create and start a migration task.After the migration task is completed, SMC generates a custom image for your source server. The image name starts with
IMAGE_FROM_SMC
. You can use the image to create ECS instances in the ECS console.