After you create an Elastic Compute Service (ECS) instance, you can perform operations such as installing software and deploying application environments to customize the instance and create a custom image for the customized instance. Instances created from the custom image contain all the customized items, which eliminates the need to configure these items for each new instance.
Sensitive data is deleted from the instance to enhance data security.
- The network configurations. The network configurations of the instance are checked based on your Linux version. For more information, see How to solve unreachable network errors when a VPC-type instance is created from a custom image.
- The remaining free space of the system disk. The system disk has a sufficient amount of free space.
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 file. To ensure data integrity, we recommend that you stop the instance before you create a custom image from it. You can also create an instance snapshot for the instance and use the instance snapshot to create a custom image without stopping the instance. For more information, see Create snapshots for multiple disks together by creating an instance snapshot.
- When you create a custom image from an instance, the state of the instance cannot be changed. For example, if you stop, start, or restart an instance when you create a custom image from the instance, the custom image cannot be created.
- You cannot create images for 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 for released instances. However, if you have saved snapshots for the system disks of the instances, you can use the snapshots to create custom images.
- Custom images are located within the same region as the instances from which the images are 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 custom images.
- The amount of time it takes to create an image depends on the disk size of the instance from which the image is created.
When you create a custom image from a Linux instance, take note the following items:
- Do not upload data disk information to the /etc/fstab file. Otherwise, instances created by using 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.
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the instance from which you want to create a custom image. In the Actions column, choose .
- Enter an image name in the Custom Image Name field and enter a description in the Custom Image Description field.
- Click Create. Note The image can be used only after snapshots are created for all disks. Wait until the snapshots are created.