All Products
Search
Document Center

Elastic Compute Service:Step 4: Import the image to Alibaba Cloud ECS

Last Updated:May 29, 2024

Before you import an image to Elastic Compute Service (ECS), you must 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

Background information

Alibaba Cloud OSS is a secure, cost-effective, and high-durability storage service that allows you to store large amounts of data in the cloud. For more information, see What is OSS?

Procedure

  1. Step 1: Create a bucket in the OSS console

  2. Step 2: Upload the image to the OSS bucket

  3. Step 3: Authorize ECS to access OSS resources

  4. Step 4: Import the image in the ECS console

Step 1: Create a bucket in the OSS console

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the Buckets page, click Create Bucket.

  3. 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.

      Note

      The region of the bucket must be the same as the region where you want to import the image.

    • Storage Class: Select the default storage class. In this example, select Standard.

    • ACL: Select the default access control list (ACL) for the bucket. In this example, select 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 is greater than 5 GiB in size, upload the image by calling an API operation or by using ossutil.

In this example, the image is smaller than 5 GiB in size. You can upload the image to an OSS bucket in the OSS console.

  1. Log on to the OSS console.

  2. Create a directory in the bucket to which you want to upload the image.

    1. In the left-side navigation pane, click Buckets. In the bucket list, click a bucket name in the Bucket Name column. In this example, click importrhel.

    2. Go to the Objects page and click Create Directory.

    3. In the Create Directory panel, enter a valid directory name and click OK. In this example, enter rhel/.

  3. Upload the image.

    1. Click the directory name. Then, click Upload Object.

    2. On the Upload Object page, configure the following parameters:

      • Upload To: Select Current Directory.

      • Object ACL: Select Inherited from Bucket.

      • Files to Upload: Click Select Files to select an on-premises file or click Select Folders to select an on-premises folder. You can also drag the on-premises file or folder to the Files to Upload section.

      For information about how to configure other parameters, see Simple upload.

    3. Click Upload Object.

      You can view the upload progress of the image file in the Task List panel. If Uploaded is displayed in the Status column corresponding to the image file, the image file is uploaded and displayed in the rhel/ directory.

  4. Click the image name. In the View Details panel, find the URL parameter and click Copy Object URL to the right to copy the object URL of the uploaded image file.

    Note
    • The object URL is required when you import the image.

    • If you set the Object ACL parameter to Private, the object URL contains the Expires and Signature information.

Step 3: Authorize ECS to access OSS resources

Before you import an image in the ECS console, complete the following operations:

  • Make sure that both your Alibaba Cloud account and Resource Access Management (RAM) user have the permissions that are required to import custom images.

    • You can 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 the "Grant permissions for different scenarios" section of the Upload image files to OSS topic.

  • Obtain the URL of the image file that you want to import in the OSS console. For more information, see Use object URLs.

  • Familiarize yourself with the usage limits and requirements of images. For more information, see Instructions for importing images.

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.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the upper-left corner of the top navigation bar, select the region in which you want to import the image.

    Note

    The region of the bucket in which you uploaded the image must be the same as the region where you want to import the image.

  4. Import the image.

    1. On the Images page, choose Import Image > Import Image in the upper-right corner.

    2. In the Prepare Before Import step, check whether the required preparations are complete and click Next.

    3. In the message that appears, click Confirm.

    4. In the Import Image File step, configure the parameters. For more information, see Import custom images.

  5. Verify that the configurations are correct and click OK. The system creates a task to import the image.

What to do next

Step 5: Create an ECS instance from the RHEL image