Create a custom image from a snapshot

更新时间:
复制 MD 格式

You can create a custom image from an existing system disk snapshot. A custom image includes the operating system, applications, configurations, and data from the source ECS instance. You can then use the custom image to create ECS instances, which allows you to rapidly replicate the source instance's environment. This topic describes how to create a custom image from a system disk snapshot.

Prerequisites

  • Create a system disk snapshot. For more information, see Create a snapshot.

  • Remove sensitive data from the snapshot to avoid security risks.

Usage notes

Before you create a custom image from a snapshot, note the following:

Item

Description

Region restrictions

The custom image must be in the same region as its source snapshot. To use an image in another region, you can create the custom image and then copy the custom image to the destination region.

Snapshot restrictions

  • The snapshot must be a system disk snapshot. You cannot create a custom image from a data disk snapshot.

  • You cannot create a custom image from a shared snapshot.

  • You can use both encrypted and unencrypted snapshots to create a custom image. A custom image created from an encrypted snapshot is encrypted by default and uses the same encryption key as the source snapshot.

Billing

Snapshots continue to incur snapshot storage fees. For more information, see Snapshot billing.

Creation duration

The time it takes to create an image depends on the size of the source cloud disk. The image is ready to use only after the creation process for all its associated disk snapshots is complete.

Other

If the source ECS instance of the snapshot expires or is released, this does not affect the custom image created from the snapshot or any ECS instances created from that image.

Procedure

You can create a custom image from a system disk snapshot from several locations in the console, such as the Images page, the Instance Details page, and the Snapshots page. This procedure uses the Snapshots page as an example.

  1. Go to ECS console - Snapshots.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. Region

  3. On the Disk Snapshots tab, find the target snapshot whose Disk Type is System Disk. In the Actions column, click Create Custom Image.

  4. In the Create Custom Image dialog box, configure the following parameters.

    Parameter

    Description

    References

    Name

    Enter a name for the custom image.

    N/A

    (Optional) Detect Image

    The image check feature verifies whether an imported custom image is valid and can create fully functional ECS instances.

    By default, Check After Creation is selected. The system performs an image check immediately after creating the image. After the check is complete, you can view the check details in the Check Result column of the custom image list. If any issues are found, you can use the public CloudOps Orchestration Service (OOS) template ACS-ECS-RepairImage for a one-click fix, or manually resolve the issues based on the suggestions in the image details.

    Note

    The image check feature is supported only for some operating systems. For more information, see Check and fix custom images.

    Check and fix custom images

    (Optional) Image Family

    You can select an image family when you create the custom image.

    You can deprecate or restore images within a family, which allows for smooth updates and rollbacks.

    Image families

    (Optional) Snapshot Settings

    Select Add Data Disk and click Add to select a data disk snapshot ID. After you add data disks, the resulting custom image contains the same number of data disks.

    • If you do not select a data disk snapshot ID, the system creates an empty data disk with a default capacity of 5 GiB.

    • If you select a data disk snapshot ID, the capacity of the new data disk equals the snapshot size.

    Create a disk from a snapshot

    Snapshot Billing

    If an automatic release time is configured for the snapshot, select I have read the snapshot billing notice "Snapshot billing".

    Important

    If the selected snapshot is configured to be automatically released, you must manually delete any custom images created from it before the scheduled release time. Otherwise, the snapshot will not be released and will continue to incur fees.

    Snapshot billing

    (Optional) Image Description

    Enter a description for the custom image.

    N/A

    (Optional) Tag

    Select a tag.

    • Optional: This parameter is optional in most scenarios.

    • Required if your RAM user is subject to a RAM policy that enforces tag binding. Otherwise, you will encounter a permission error.

    Tags

    (Optional) Resource Group

    Select a resource group to organize and manage permissions for the custom image.

    Resource groups

  5. Click OK and wait for the creation process to complete.