All Products
Search
Document Center

4. Import image to Alibaba Cloud

Last Updated: Jun 14, 2019

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.

1. Create a bucket

To activate OSS and create a bucket, follow these steps:

  1. Go to the OSS product details page.

  2. Click Buy Now to activate OSS.

  3. After OSS is activated, log on to the OSS console.

  4. In the left-side navigation pane, click the Plus icon to create a bucket.

    Plus

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

2. Upload the image

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.

  1. Log on to the OSS console.

  2. In the left-side navigation pane, from the bucket list, click the bucket name, for example, importrhel.

  3. On the bucket page, click the Files tab and then Create Directory.

  4. In the Create Directory dialog box, enter a valid name for the directory, for example, rhel/ in this article, and click OK.

  5. Click the directory name, for example, rhel/, and on the directory page, click Upload.

    Upload

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

      UploadTask

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

    Preview

    Note: If the ACL of the file is Private, the URL contains expire and signature information.

3. Import the image

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.

  1. Log on to the ECS console.

  2. Select the region where the importrhel OSS bucket is located.

  3. In the left-side navigation pane, select Snapshots and Images > Images.

  4. On the Image page, click Import Image.

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

    ConfirmAddress

  6. On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.

    AuthorizationPolicy

  7. After the authorization is confirmed, in the left-side navigation pane, select Snapshots and Images > Images.

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

  9. Click OK.

    Imported

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

API operation

You can also use the ImportImage method to import the image.

Next step

Create and test RHEL instances