All Products
Search
Document Center

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

Last Updated:Mar 14, 2024

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

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

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

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

  3. Step 3: (Optional) 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.

  3. On the Buckets page, click Create Bucket.

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

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

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.

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets.

  3. In the bucket list on the Buckets page, click a bucket name in the Bucket Name column. In this example, click importrhel.

  4. On the Objects page, click Create Directory.

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

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

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

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

  9. Click the image name. In the View Details panel, click Copy Object URL in the URL field.

    Note
    • The 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.

  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 a region.

    Note

    Select the region of the bucket from which you want to import the image.

  4. Import the image.

    1. In the upper-right corner of the Images page, click Import Image.

    2. In the Prepare Before Import step, check whether the image meets the required conditions 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 a custom image.

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

What to do next

Step 5: Create an ECS instance from the RHEL image