To import an image to Alibaba Cloud, you must upload it to an OSS bucket first. To create an ECS instance from the imported image, make sure that the OSS bucket, the image, and the instance are in the same region and that they are owned by the same account.
To activate OSS and create a bucket, follow these steps:
Go to the OSS product details page.
Click Buy Now to activate OSS.
After OSS is activated, log on to the OSS console.
In the left-side navigation pane, click the icon to create a bucket.
In the Create Bucket dialog box, complete the following configurations and click OK.
Bucket Name: Enter a valid bucket name. For example, importrhel in this article.
Region: From the drop-down list, select a region.
Note: The bucket and the instance to be created must be in the same region.
Storage Class: Select the default class. In this example, select Standard Storage.
ACL: Select the default method. In this example, select Private.
To upload an image file to an OSS bucket in the OSS console, follow these steps:
Note: Only image files smaller than 5 GiB can be uploaded to an OSS bucket. If your image file is larger than 5 GiB, use either APIs or ossutil to upload it. For more information about APIs, see Multipart upload. For more information about ossutil, see Download an installation.
Log on to the OSS console.
In the left-side navigation pane, from the bucket list, click the bucket name, for example, importrhel.
On the bucket page, click the Files tab and then Create Directory.
In the Create Directory dialog box, enter a valid name for the directory, for example, rhel/ in this article, and click OK.
Click the directory name, for example, rhel/, and on the directory page, click Upload.
In the Upload dialog box, complete the following configurations:
File Directory: Select Current Directory.
File ACL: Select Inherited from Bucket.
Upload: Drag the image file to the Upload area, or click upload them directly to select the file to be uploaded.
In the Upload Task dialog box, you can view the upload progress. When the progress is 100%, you can see the image information in the rhel/ directory.
Click the image name, and in the Preview dialog box, under the URL field, click Copy File URL. You need the URL to import the image.
Note: If the ACL of the file is Private, the URL contains expire and signature information.
After the image is uploaded, you can import it in the ECS console. Follow these steps:
Note: We recommend that you use the primary account to import the image.
Log on to the ECS console.
Select the region where the importrhel OSS bucket is located.
In the left-side navigation pane, select Snapshots and Images > Images.
On the Image page, click Import Image.
In the Import Image dialog box, read the notes, and click Confirm Address in item 3 of How to import an image to authorize the official ECS service account to access your OSS bucket.
On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.
After the authorization is confirmed, in the left-side navigation pane, select Snapshots and Images > Images.
On the Image List page, click Import Image, and in the Import Image dialog box, complete the following configurations:
OSS Object Address: Paste the URL of the image file.
Image Name: Enter a valid name for the image.
Note: You can use this name to search for the image when creating an ECS instance.
Operating System: Select Linux.
System Disk Size: Enter a value between 40 and 500 as the size of the system disk to meet your business needs.
System Architecture: Select x86_64.
System Platform: Select RedHat.
Image Format: Select QCOW2, RAW, or VHD. In this example, VHD is selected.
(Optional) Image Description: Enter a brief description about the image for future reference.
Go to the Image List page. If the Progress of the image is 100%, it is imported successfully.
Note: It usually takes 1 to 4 hours to import an image, and the duration of the task depends on the size of your image file and the amount of concurrent tasks. You can view the task progress on the Image List page or the Manage Tasks page.
You can also use the
ImportImage method to import the image.