After you create an Elastic Compute Service (ECS) instance, you can customize the instance by performing operations such as installing software and deploying application environments and then create a custom image from the instance. Instances created from the custom image contain all of the customized items, which eliminates the need to configure these items for each new instance.
Prerequisites
Sensitive data is deleted from the instance to enhance data security.
- Network configurations of the instance. The network configurations are checked based on your Linux distribution. For more information, see How to solve unreachable network errors when a VPC-type instance is created from a custom image.
- Free space on the system disk. The system disk must have sufficient free space.
Background information

Before you create a custom image from an instance, take note of the following items:
- When you create a custom image from an instance, you do not need to stop the instance.
Note When you create a custom image from an instance that is in the Running state, real-time data may not be saved to the image. To ensure data integrity, we recommend that you stop the instance before you use it to create a custom image. If you do not want to stop your instance, you can create a snapshot-consistent group from the instance and then use the snapshot-consistent group to create a custom image. For more information, see Create a snapshot-consistent group.
- While a custom image is being created from an instance, the state of the instance must not be changed. For example, if you stop, start, or restart an instance while a custom image is being created from the instance, the image cannot be created.
- You cannot create images from expired subscription instances. However, you can create snapshots for the system disks of the instances and then use the snapshots to create custom images.
- You cannot create images from released instances. However, if you have stored a system disk snapshot of a released instance, you can use the snapshot to create a custom image.
- A custom image resides within the same region as the instance from which the image was created. For example, if an instance is located in the China (Hangzhou) region, the image created from the instance is also located in the China (Hangzhou) region. For information about how to use images across regions, see Copy a custom image.
- The amount of time it takes to create an image depends on the disk size of the instance from which the image is created.
- You cannot create images that contain snapshots of system disks and data disks from instances that use local SSDs. For more information, see Overview.
When you create a custom image from a Linux instance, take note the following additional items:
- Do not upload data disk information to the /etc/fstab file. Otherwise, instances created from the image cannot be started.
- Do not update the kernel or operating system version.
- Do not adjust the system disk partitions. Only system disks with a single root partition are supported.
- Do not modify critical system files such as /sbin, /bin, and /lib.
- Do not modify the default logon username root.