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. Custom images can only be created from system disk snapshots. However, you can include data disk snapshots when you create a custom image from a snapshot.
Image creation progress and duration
View the creation progress on the Images page in the ECS console. Creation time depends on instance disk size. The image becomes available after all disk snapshots are created. See Create a custom image from an instance.
When should I copy an image?
A custom image is available only in its source region. Copy an image to:
-
Deploy applications across multiple regions.
-
Migrate an instance to another region.
-
Use a custom image across regions.
-
Change the encryption status, such as encrypting the system disk.
See Copy a custom image.
Which images can I copy?
Only custom images can be copied. Public images and Marketplace images cannot be copied.
Image copy duration
Copy duration depends on network speed and task queue depth.
For large images (such as over 2 TiB), copy the snapshots to the destination region first, then create an image from those snapshots. This is faster than copying the image directly. Copying snapshots across regions incurs data transfer and storage fees. See Snapshot pricing.
Copy a Marketplace-based custom image across regions
You can copy a Marketplace-based custom image to the destination region only if the source Marketplace image is available there. Otherwise, the copy fails.

Share images between Alibaba Cloud sites
Image sharing between the China site (aliyun.com) and the international site (alibabacloud.com) is not supported.
Risks of using shared images
-
Shared images risk data leaks and software exposure. Before sharing, verify the image contains no sensitive data or critical security software. Recipients can create instances and further custom images from the shared image, propagating the data.
-
Alibaba Cloud does not guarantee the integrity or security of images from other accounts. Use shared images at your own risk. Only use images shared by trusted accounts, and verify security after creating an instance from a shared image.
-
The image owner can view sharing status and delete the image. If the owner deletes a shared image, you can no longer reinitialize system disks of instances created from it.
Reshare a shared image
No. Create a custom image from the shared image, then share the new image.
Share an image across accounts and regions
These steps can be performed in any order: share the image with the destination account, and copy the image to the destination region.
Encrypt system disks with KMS, Terraform, or Packer
-
ECS system disks support encryption with the default Key Management Service (KMS) key or a bring-your-own-key (BYOK) key. See Encrypt a system disk.
-
In Packer, use the
image_encryptedparameter. See Alicloud Image Builder. -
In Terraform, use the
encryptedparameter. See alicloud_disks.
Limitations on copying encrypted images
-
When you copy an encrypted image, you must select Encrypt during copy as the copy type.
-
To use a custom key, create a key in KMS first.
Permissions for sharing encrypted images
First, use RAM to create a role named AliyunECSShareEncryptImageDefaultRole and grant the required permissions. Then share the encrypted image with other Alibaba Cloud accounts or enterprise accounts via your resource directory. See Share an encrypted custom image.
Image import progress and duration
View import progress in the custom images list of the destination region or on the Tasks page.
Import duration depends on image file size and concurrent task count. See Import a custom image.
Replace an expired BYOL license
Change the instance operating system to replace the BYOL image with an Alibaba Cloud image.
-
For Windows Server, use official Alibaba Cloud public images.
-
SQL Server and Red Hat images are available from Alibaba Cloud Marketplace.
Use an internal OSS URL for image import
No. The OSS object address must be a public URL generated by sharing the file. An internal OSS URL causes the import task to fail.
-
To obtain the object URL, see Share a file by using the console.
-
For internal OSS URLs, see Obtain the internal endpoint of an OSS bucket.
Convert an ISO file for ECS
ECS does not support ISO image files. Convert an ISO file to a supported format first.
-
Use a tool such as VirtualBox to create a local image from the ISO file.
-
Convert the image to a supported format, such as RAW, VHD, QCOW2, or VMDK.
How do I import a local image file?
Permissions for uploading images to OSS
-
With an Alibaba Cloud account, you can directly upload image files to OSS.
-
As a RAM user, the Alibaba Cloud account holder must grant you the required permissions to manage the OSS bucket.
Download an image to a local machine
Export a custom image to download it to your local machine.
Bootability of exported images on other platforms
Exported images are not guaranteed to be bootable on other platforms, but you can mount the disk image to access its data.
How do I export a public image?
Only custom images can be exported. To export a public image, first create a custom image from it, then export the custom image.
Delete a custom image that is in use
You must force delete the image.
Consequences of deletion:
-
The recipient can no longer find the shared image in the ECS console or via API.
-
The recipient can no longer use the image to create instances or replace system disks.
-
Instances already created from the shared image cannot have their system disks reinitialized.
Resolve the "ImageId is used" deletion error
This error occurs because the image is in use. Force delete it. Force deletion does not affect existing instances, but you cannot reinitialize the system disk of instances created from this image. See Delete a custom image.
Resolve system disk auto-resize failures
Auto-resize may fail if cloud-init is not installed or fails to run, or if the file system is unsupported. If auto-resize fails, manually resize the disk.
Why comment out mount entries for custom images
Creating an instance from a custom image may fail to mount a data disk if:
-
The instance has no data disk.
-
The data disk is new and not yet partitioned or formatted.
-
The mount entries in /etc/fstab of the custom image are not commented out.
This failure occurs when an instance with an unpartitioned data disk is created from a custom image whose /etc/fstab contains uncommented mount entries.
-
The data disk is not partitioned.

-
The mount entries in /etc/fstab are not commented out.

-
The instance tries to mount the disk per /etc/fstab but fails because the disk is not partitioned.

Leave 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 I/O optimized instances. To enable this, submit a ticket and specify the image name.
Configure and use a private Docker repository
Docker provides an open source project, docker-registry, on GitHub for building private image repositories.
To start a Docker registry with OSS support, download docker-registry from GitHub, then install the OSS driver with pip install docker-registry-driver-alioss.
-
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 config.yml:
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
OS names without a minor version number, such as Centos_64-bit, originate from imported on-premises images. Custom images created from these images inherit this naming convention.
OS names with a minor version number, such as Centos_7.9 64-bit, indicate that the image was created from an Alibaba Cloud ECS instance.