Image creation
Image copy
Encrypted image
Image sharing
Image import
Image export
Image deletion
Image usage
-
How do I resolve a system disk auto-resize failure for an instance created from a custom image?
-
Why do I need to comment out mount entries when I create a custom image or an ECS instance?
-
Some custom images do not support the creation of I/O optimized instances. What should I do?
-
How do I configure and use a private Docker image repository?
-
Why do the OS names of some custom images include minor version numbers while others do not?
Appendix
Can I create a custom image from an ECS data disk?
No. You can create a custom image only from a system disk snapshot, not from a data disk. However, you can add snapshots of data disks when you create a custom image from a system disk snapshot. For more information, see Create a custom image from a snapshot.
Image creation progress and duration
You can view the progress of the image creation task on the Images page in the ECS console. The time required to create the image depends on the size of the instance disks. The image becomes available after the snapshots of all disks are created. For more information, see Create a custom image from an instance.
When should I copy an image?
A custom image is available only in the region where it was created and cannot be used directly in other regions. You can copy an image for the following purposes:
-
Deploy applications on ECS instances in multiple regions.
-
Migrate an ECS instance to another region.
-
Use a custom image across regions.
-
Change the encryption status of a custom image, such as by encrypting its system disk.
For more information, see Copy a custom image.
Which images can I copy?
You can copy only custom images. You cannot copy public images or Marketplace images.
Image copy duration
The time required to copy an image depends on the network transmission speed and the number of tasks in the queue. Copying an image involves transferring the image file over the network from a zone in a source region to a zone in the destination region.
If you want to copy a large image, such as an image larger than 2 TiB, you can first copy the snapshots to the destination region and then create an image from the snapshots in the destination region. This method is faster than directly copying the image. For more information, see Copy a snapshot and Create a custom image from a snapshot. When you copy a snapshot to a destination region, you are charged for the data transfer and storage of the snapshot. For more information, see Snapshot pricing.
Copy a Marketplace-based custom image across regions
If the source Marketplace image is available in the destination region, you can copy a custom image that was created based on the Marketplace image to the destination region. Otherwise, an error is reported.

Share images between Alibaba Cloud sites
You cannot share images between an account on the China site (aliyun.com) and an account on the international site (alibabacloud.com).
Risks of using shared images
-
Shared images pose risks of data leaks and software exposure. Before you share an image with another account, ensure that the image contains no sensitive data or critical security software. An account that receives your shared image can use it to create ECS instances and create more custom images from these instances. This enables data propagation.
-
Alibaba Cloud does not guarantee the integrity and security of images from other accounts. Use shared images at your own risk. We recommend that you use only images that are shared by trusted accounts. After you create an ECS instance from a shared image, log on to the instance to check the security and integrity of the image.
-
The owner of an image can view how the image is shared and can delete the image. If the owner deletes a shared image, you can no longer reinitialize the system disks of the ECS instances that were created from that image.
Reshare a shared image
No, you cannot directly reshare the image. However, you can create a new custom image from the shared image, and then share the new image.
Share an image across accounts and regions
You can perform these steps in any order: share the image with the destination account, and copy the image to the destination region. For more information, see Copy a custom image and Share a custom image.
Encrypt system disks with KMS, Terraform, or Packer
-
An ECS system disk supports encryption by using the default key of Key Management Service (KMS) or a bring-your-own-key (BYOK) key. For more information, see Encrypt a system disk.
-
In Packer, you can use the
image_encryptedparameter. For more information, see Alicloud Image Builder. -
In Terraform, you can use the
encryptedparameter. For more information, see alicloud_disks.
Limitations on copying encrypted images
-
Make sure that Key Management Service (KMS) is activated. For more information, see Activate Key Management Service.
-
When you copy an encrypted image, you must select Encrypt during copy as the copy type.
-
If you want to use a custom key, you must create a key in KMS in advance. For more information, see Create a key.
Permissions for sharing encrypted images
To share an encrypted custom image, you must first use Resource Access Management (RAM) to create a role named AliyunECSShareEncryptImageDefaultRole and grant the required permissions and policies to the role. Then, you can share the encrypted custom image with other Alibaba Cloud accounts or with other accounts in your enterprise by using your resource directory. For more information, see Share an encrypted custom image.
Image import progress and duration
You can view the progress of an image import task in the list of custom images in the destination region or on the Tasks page.
The time required to import a custom image depends on the size of the image file and the number of concurrent import tasks. For more information, see Import a custom image.
Replace an expired BYOL license
You can change the operating system of the instance to replace the BYOL image with an Alibaba Cloud image.
-
For Windows Server systems, you can use official images provided by Alibaba Cloud. For more information, see Public images.
-
You can obtain SQL Server and Red Hat images from Alibaba Cloud Marketplace. For more information, see Marketplace images.
Use an internal OSS URL for image import
No. The Object Storage Service (OSS) object address must be a public URL that you generate by sharing the file. You cannot use an internal URL provided by OSS to import an image. Otherwise, the import task fails and an error is reported.
-
For information about how to obtain the object URL of an image file, see Share a file by using the console.
-
For information about internal OSS URLs, see Obtain the internal endpoint of an OSS bucket.
Convert an ISO file for ECS
ECS does not support importing ISO image files. You must first convert an ISO image file to a supported format.
-
Use a tool such as VirtualBox on your local machine to create a local image from the ISO file.
-
Convert the local image file to a supported format, such as RAW, VHD, QCOW2, or VMDK.
For more information, see Import a custom image.
How do I import a local image file?
For more information, see Import a custom image.
Permissions for uploading images to OSS
-
If you are using an Alibaba Cloud account, you can directly upload image files to Object Storage Service (OSS). For more information, see Upload a file.
-
If you are a RAM user, the Alibaba Cloud account holder must grant you the required permissions to manage the OSS bucket. For more information, see Permissions.
Download an image to a local machine
You can export a custom image to download the image file to your local machine. For more information, see Export a custom image.
Bootability of exported images on other platforms
An exported image is not guaranteed to be bootable on other platforms. However, you can mount the disk image to access its data.
How do I export a public image?
You can only export custom images from ECS. To export a public image, first create a custom image from it, and then export the resulting custom image. For more information, see Export a custom image.
Delete a custom image that is in use
You can only force delete the image.
Consequences of deletion:
-
The recipient Alibaba Cloud account can no longer find the shared image in the ECS console or via ECS API calls.
-
The recipient Alibaba Cloud account can no longer use the image to create ECS instances or replace system disks.
-
If the recipient Alibaba Cloud account created ECS instances from the shared image before the image was deleted, the system disks of those instances cannot be reinitialized.
For more information, see Delete a custom image.
Resolve the "ImageId is used" deletion error
This error occurs because the image is in use by an ECS instance. To delete the image, you must force delete it. Forcibly deleting an image does not affect existing instances. However, you cannot reinitialize the system disk of instances created from this image. For more information, see Delete a custom image.
Why does a curl request from an internal VPC network to the mirror site domain http://mirrors.cloud.aliyuncs.com/redirect to the public internet URLhttps://developer.aliyun.com/mirror/?
This redirect applies only to the root path (/). The server responds with an HTTP redirect to the public home page. If you append a repository path, such as centos or alinux, to the domain name http://mirrors.cloud.aliyuncs.com/, the content is still downloaded over the internal network.
Resolve system disk auto-resize failures
Automatic system disk resizing may fail if the cloud-init service is not installed or fails to run, or if the file system is not supported. If an automatic resize fails, you can manually resize the disk. For more information, see Resize a disk.
Why comment out mount entries for custom images
When you create an ECS instance from a custom image, a data disk may fail to mount for the following reasons:
-
The ECS instance does not have a data disk.
-
The data disk is new and has not been partitioned or formatted.
-
The disk mount entries in the /etc/fstab file of the custom image are not commented out.
This failure can occur if an ECS instance with an unpartitioned data disk is created from a custom image whose /etc/fstab file contains uncommented mount entries.
-
The data disk of the ECS instance is not partitioned, as shown in the following figure.

-
In the ECS instance created from the custom image, the disk mount entries in the /etc/fstab file are not commented out, as shown in the following figure.

-
When the instance starts, it attempts to mount the disk based on the configurations in the /etc/fstab file. However, the disk fails to mount because it is not partitioned, as shown in the following figure.

You can leave the mount entries uncommented only if the data disk is created from a snapshot that is already partitioned and formatted.
If the issue persists, submit a ticket for technical support.
Enable I/O optimization for custom images
Some custom images do not support the creation of I/O optimized instances. To enable support for I/O optimized instances for such an image, submit a ticket to request this feature. When you submit the ticket, specify the name of the image.
Configure and use a private Docker repository
Image management is a core feature of Docker. To share images within an enterprise or organization, Docker provides an open source project named docker-registry on GitHub. You can use this project to build a private Docker image repository.
To quickly start a Docker registry that supports Alibaba Cloud Object Storage Service (OSS), download and install docker-registry from GitHub. Then, run the pip install docker-registry-driver-alioss command to install the OSS driver.
-
Run the Docker registry.
docker run -e OSS_BUCKET=<your_oss_bucket_name> -e STORAGE_PATH=/docker/ -e OSS_KEY=<your_oss_accesskey_id> -e OSS_SECRET=<your_oss_accesskey_secret> -p 5000:5000 -d chrisjin/registry:ali_oss -
Configure the config.yml file.
storage: alioss storage_path: _env:STORAGE_PATH:/devregistry/ oss_bucket: _env:OSS_BUCKET[:default_value] oss_accessid: _env:OSS_KEY oss_accesskey: _env:OSS_SECRET -
Start the Docker registry.
DOCKER_REGISTRY_CONFIG=[your_config_path] gunicorn -k gevent -b 0.0.0.0:5000 -w 1 docker_registry.wsgi:application
If the issue persists, submit a ticket for technical support.
OS naming conventions for custom images
Operating systems without a minor version number, such as Centos_64-bit, originate from images that were imported from an on-premises environment. When you create a custom image from this type of image, this naming convention is inherited.
Operating systems with a minor version number, such as Centos_7.9 64-bit, indicate that the image was created from an ECS instance on Alibaba Cloud. This naming format is used when you create a custom image from that instance.