To import an image to Alibaba Cloud ECS, you must first upload the image to an OSS bucket. If you want to create an ECS instance from an imported image, make sure that the image, the ECS instance, and the OSS bucket that contains the image are in the same region and are owned by the same account.

Procedure

  1. Step 1: Activate OSS and create a bucket
  2. Step 2: Upload an image
  3. Step 3: Import the image

Step 1: Activate OSS and create a bucket

Follow these steps to activate OSS and create a bucket:

  1. Go to the OSS product page.
  2. Click Activate OSS.
  3. After you activate OSS, log on to the OSS console.
  4. In the left-side navigation pane, click the Create a bucket icon to create a bucket.
    Create a bucket
  5. In the Create Bucket pane, complete the following configurations. Then, 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 bucket and the ECS instance to be created must be in the same region.
    • Storage Class: Select the default storage class. In this example, select Standard.
    • Access Control List (ACL): Select the default ACL. In this example, select Private.

Step 2: Upload an image

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 and resumable upload. For more information about ossutil, see Overview. In this example, the image file is less than 5 GiB in size. You can upload it to an OSS bucket by using the OSS console.

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click the bucket name in the bucket list. In this example, the bucket name is importrhel.
  3. On the bucket details page, click Files, and then click Create Folder.
  4. In the Create Folder pane, enter a valid folder name. In this example, enter rhel/. Then, click OK.
  5. Click the folder name, and then click Upload.
  6. In the Upload pane, specify the following parameters.
    • Upload To: Click Current.
    • File ACL: Click Inherited from Bucket.
    • Upload: Drag and drop the image file onto the section next to Upload, or click Upload to select the file to be uploaded.
      In the Upload Tasks pane, you can view the upload progress in the Upload Progress column. When the upload progress is 100%, the image file is displayed in the rhel/ directory.Upload tasks
  7. Click the image name. In the View Details pane, click Copy File URL below the URL field. The file URL is required when you import the image.
    Note If File ACL is set to Private, the URL contains the expiration and signature information.

Step 3: Import the image

After you upload the image, you can perform the following steps to import the image in the ECS console. You can also call the ImportImage operation to import the image.
Note We recommend that you use an Alibaba Cloud account to import images. If you use a RAM user, you must grant the AliyunECSImageImportDefaultRole permission to the RAM user.
  1. Log on to the ECS console.
  2. Select the region where the OSS bucket that contains the image is located. In this example, the OSS bucket is named importrel.
  3. In the left-side navigation pane, choose Snapshots & Images > Images.
  4. On the Images page, click Import Image.
  5. In the Import Image dialog box that appears, read the note, and then click Confirm Address in Step 3 to authorize ECS to access your OSS bucket.
    Verify
  6. On the Cloud Resource Access Authorization page, click Agree to Authorization.
  7. After you authorize ECS to access your OSS bucket, go back to the ECS console. In the left-side navigation pane, choose Snapshots & Images > Images.
  8. On the Images page, click Import image. In the Import Image dialog box, complete the following configurations.
    • OSS Object Address: Paste the file URL that you copied in Step 2.
    • Image Name: Enter a valid name for the image. You can use this name to search for images when you create an ECS instance.
    • Operating System: Select Linux.
    • System Disk Size (GiB): Enter a value ranging from 40 to 500 as the size of the system disk.
    • System Architecture: Select x86_64.
    • Platform: Select RedHat.
    • Image Format: Select RAW, QCOW2, or VHD. In this example, select VHD.
    • Image Description: Optional. You can enter a short description of the image for later use.
  9. Click OK.
  10. Go back to the Images page. If 100% is displayed in the Progress column corresponding to the image, the image is imported.
    Note It typically takes one to four hours to import an image. The amount of time required to import an image depends on the size of the image and the number of concurrent tasks in progress. You can view the task progress on the Images page or the Manage Tasks page.

What to do next

Step 5: Create an ECS instance from the RHEL image