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.
Step 1: Activate OSS and create a bucket
Follow these steps to activate OSS and create a bucket:
- Go to the OSS product page.
- Click Activate OSS.
- After you activate OSS, log on to the OSS console.
- In the left-side navigation pane, click the icon to create a bucket.
- 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.
- Log on to the OSS console.
- In the left-side navigation pane, click the bucket name in the bucket list. In this example, the bucket name is importrhel.
- In the Create Folder pane, enter a valid folder name. In this example, enter rhel/. Then, click OK.
- Click the folder name, and then click Upload.
- 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.
- 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
- Log on to the ECS console.
- Select the region where the OSS bucket that contains the image is located. In this example, the OSS bucket is named importrel.
- In the left-side navigation pane, choose Snapshots & Images > Images.
- On the Images page, click Import Image.
- 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.
- On the Cloud Resource Access Authorization page, click Agree to Authorization.
- 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.
- 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.
- Click OK.
- 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.