All Products
Search
Document Center

Elastic Compute Service:Upload image files to OSS

Last Updated:Aug 05, 2024

Before you import custom images in the Elastic Compute Service (ECS) console, you must create Object Storage Service (OSS) buckets and then upload the corresponding image files to the buckets. This topic describes the permissions required to upload image files and how to upload image files.

Prerequisites

Grant permissions for different scenarios

  1. Use an Alibaba Cloud account to create a custom policy that contains the required permissions for a RAM user based on the actual scenario. Make sure that the policy follows the principle of least privilege. For more information, see the Create a custom policy on the JSON tab section of the "Create custom policies" topic.

  2. Attach the policy to the RAM user by using the Alibaba Cloud account. For more information, see Grant permissions to a RAM role.

    Important

    In the preceding steps, make sure that the scope of the permissions that are granted to the RAM user is account-wide instead of limited to a specific resource group. If the scope of the permissions is limited to a specific resource group, make sure that the images that you want to import belong to the specified resource group. For information about how to import images to ECS, see Import custom images.

Create an OSS bucket and upload an image file

To create an OSS bucket and upload an image file to the bucket, perform the following steps. To view the video tutorial, see Import custom images.

Note

You can also use the OSS graphical management tool ossbrowser to upload image files. For more information, see Use ossbrowser.

  1. Log on to the OSS console.

  2. Create a bucket in the OSS console.

    For more information, see Create buckets.

  3. Upload an image file to the bucket.

    For more information, see Upload objects.

    Note
    • The size of the image file that you want to upload in the OSS console cannot exceed 5 GB. For information about how to upload an image file whose size exceeds 5 GB, see Multipart upload.

    • The image file must be in the RAW, Virtual Hard Disk (VHD), or QEMU Copy-On-Write 2 (QCOW2) format and must not be compressed.

  4. Obtain the object URL of the image file.

    For more information, see Use object URLs.

    When you obtain the URL of an object, take note of the following items:

    • You must use the same Alibaba Cloud account to obtain the URL of an image file and import the image to ECS. For information about how to import images to ECS, see Import custom images.

    • The URL of an object must be the public URL that is generated when you share the object in OSS. Internal endpoints that are provided by OSS cannot be used to import images. If you use an internal endpoint to import an image, an error occurs. For information about the internal endpoints of OSS, see the Obtain the internal endpoint for a bucket section of the "Access to OSS resources from an ECS instance by using an internal endpoint of OSS" topic.

References

After you upload image files to OSS, you can import the custom images in the ECS console or by using Server Migration Center (SMC). For more information, see Import custom images.