After you create an instance, you can perform operations to customize the instance such as installing software and deploying application environments and create a custom image for the updated instance. Instances created from the custom image will contain all of the configured items, saving you the trouble of configuring these items for each new instance.

Prerequisites

Sensitive data is deleted from the instance to enhance data security.

Before you create a custom image from a Linux instance, check the following items:

Background information

When you create a custom image from an instance, a snapshot is generated for each disk in the instance. Together, all of the snapshots constitute a complete custom image, as shown in the following figure.custom_image

Before you create a custom image from an instance, note the following points:

  • When you create a custom image from an instance, you do not need to stop the instance.
  • When you create a custom image from an instance, the status of the instance cannot be changed. For example, if you stop, start, or restart an instance, the custom image creation will fail.
  • You cannot create images for expired subscription instances. You can create a snapshot for the system disk of an instance and then use the snapshot to create a custom image.
  • You cannot create images for released instances. If you have saved a system disk snapshot for an instance, you can use the snapshot to create a custom image.
  • 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 more 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 size of the disk from which the image is created.

When you create a custom image from a Linux instance, note the following points:

  • Do not upload data disk information to the /etc/fstab file. Otherwise, instances created from the image cannot be started.
  • Do not upgrade the kernel or operating system version.
  • Do not adjust the system disk partitions. Only 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.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a custom image. In the Actions column, choose More > Disk and Image > Create Custom Image.
  5. Enter the image name and description.
  6. Click Create.
    The image can be used only after snapshots of all disks have been created. Image creation may take a while.

What to do next

After you create a custom image, you can: