Before you import an image to Alibaba Cloud Elastic Compute Service (ECS), you must first upload the image to an Object Storage Service (OSS) bucket. This topic describes how to import a Red Hat Enterprise Linux (RHEL) image to Alibaba Cloud ECS.
Prerequisites
OSS is activated by using your Alibaba Cloud account. For more information, see Activate OSS.
Your Alibaba Cloud account and Resource Access Management (RAM) user are granted the required permissions to import custom images. For more information, see Import a custom image.
You are familiar with the usage limits and requirements of images. For more information, see Instructions for importing images, Customize Linux images, and Convert the format of an image.
Background information
OSS is a secure, cost-effective, and highly durable service that enables you to store large amounts of data in Alibaba Cloud. For more information, see What is OSS?
Procedure
Step 1: Create a bucket in the OSS console
Log on to the OSS console.
In the left-side navigation pane, click Buckets.
On the Buckets page, click Create Bucket.
In the Create Bucket panel, configure the following parameters and click OK.
Bucket Name: Enter a valid name for the bucket. In this example, enter importrhel.
Region: Select a region from the drop-down list.
NoteSelect the region of the bucket from which you want to import the image.
Storage Class: Select the default storage class
Standard .ACL: Select the default ACL
Private .
For information about how to configure other parameters, see Create a bucket.
Step 2: Upload the image to the OSS bucket
If the image file is greater than 5 GiB in size, you must upload the image by calling an API operation or using ossutil.
For more information about the API operation, see Multipart upload.
For more information about ossutil, see Overview.
In this example, the image file is less than 5 GiB in size. In this case, you can upload the file to an OSS bucket in the OSS console.
Log on to the OSS console.
In the left-side navigation pane, click Buckets.
In the bucket list on the Buckets page, click a bucket name in the Bucket Name column. In this example, click importrhel.
On the Objects page, click Create Directory.
In the Create Directory panel, enter a valid directory name and click OK. In this example, enter rhel/.
Click the directory name. Then, click Upload Object.
On the Upload Object page, configure the following parameters:
Upload To: Click Current Directory.
Object ACL: Click Inherited from Bucket.
Files to Upload: Click Select Files to select a local file or click Select Folders to select a local directory. You can also drag the local file or directory that you want to upload to the Files to Upload section.
For information about how to configure other parameters, see Simple upload.
Click Upload Object.
You can view the upload progress of the files in the Task List panel. If Uploaded is displayed in the Status column corresponding to the file, the image file is uploaded and displayed in the rhel/ directory.
Click the image name. In the View Details panel, click Copy Object URL in the URL field.
NoteThe file URL is required when you import the image.
If Object ACL is set to Private, the URL contains the Expires and Signature information.
Step 3: (Optional) Authorize ECS to access OSS resources
Step 4: Import the image in the ECS console
After you upload the image to the OSS bucket, you can perform the following operations to import the image to ECS in the ECS console. You can also call the ImportImage operation to import the image to ECS.
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.
NoteSelect the region of the bucket from which you want to import the image.
Import the image.
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. For more information, see Import a custom image.
Verify that the configurations are correct and click OK. The system creates a task to import the custom image.