All Products
Search
Document Center

Elastic Compute Service:Create a disk from a snapshot

Last Updated:May 11, 2024

You can create a disk from a snapshot. The data on the new disk is the same as the data that existed on the source disk when the snapshot was created. Snapshot-based disk creation allows you to quickly replicate disks for environment cloning or data backup. You can use a snapshot to create system disks or data disks. This topic describes how to create a disk from a snapshot.

Prerequisites

A snapshot is created for a system disk or a data disk, and the ID of the snapshot is obtained. For more information, see Create a snapshot for a disk.

Limits

When you create a disk from a snapshot, take note of the following limits:

  • Disks are independent of each other and cannot be merged by formatting. Before you create disks, we recommend that you determine the number and capacity of disks that you need based on your business requirements.

  • If you create a disk from a snapshot and attach the new disk to the Elastic Compute Service (ECS) instance to which the source disk of the snapshot is attached, the UUID of the new disk conflicts with the UUID of the source disk. In this case, you must change the UUID of the new disk. For more information, see Change the UUID of a disk.

  • You can use a snapshot that resides in one zone to create disks in another zone. For example, you can use a snapshot that resides in Hangzhou Zone A to create disks in Hangzhou Zone B.

Procedure

You can create disks from a snapshot on the Disks page and the Snapshots page. The following section describes how to create disks from a snapshot on the Disks page.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Storage & Snapshots > Disks.

  3. In the upper-left corner of the Disks page, click Create Disk.

  4. In the Storage section of the disk buy page, click Create from Snapshot and then select a snapshot.

    image.png

  5. Configure the parameters that are described in the following table.

    Parameter

    Description

    Attach

    Specify whether to attach the disks that you want to create to an ECS instance.

    • Not Attach: creates disks without attaching the disks to an ECS instance.

      If you select this option, you can create only pay-as-you-go disks. The disks and the ECS instance to which you want to attach the disks must belong to the same zone. After you create a disk, you cannot change the region and zone of the disk. Exercise caution when you configure the Region and Zone parameter.

    • Attach to ECS Instance: creates disks and attaches the disks to an ECS instance.

      If you select this option, you must configure the ECS Instance parameter by selecting a region and an ECS instance.

    Note

    You can use a snapshot that resides in one zone to create disks in another zone. For example, you can use a snapshot that resides in Hangzhou Zone A to create disks in Hangzhou Zone B.

    Billing Method

    Specify the billing method of the disks.

    • Pay-as-you-go: Pay-as-you-go disks can be attached to subscription or pay-as-you-go instances.

    • Subscription: Subscription disks can be attached only to subscription instances.

    Storage

    Select a disk category and specify a disk capacity.

    You must specify a disk capacity that is greater than or equal to the size of the snapshot. If the disk capacity that you specify is greater than the snapshot size, you must repartition the disk to ensure that the excess disk capacity can be used.

    Important

    If the snapshot is less than 2,048 GiB in size and you want to specify a disk capacity that is greater than 2,048 GiB, make sure that the source disk of the snapshot uses the GUID Partition Table (GPT) partition style. You can run the fdisk -lu command and then determine the partition style of a disk based on the value of the Disk label type parameter in the command output. If the parameter value is gpt, the disk uses the GPT partition style. If the source disk does not use the GPT partition style, we recommend that you specify a disk capacity that is less than 2,048 GiB to prevent data loss during partitioning. For more information, see Initialize a data disk whose size exceeds 2 TiB.

    Other parameters:

    • Performance Level: You can specify performance levels only for enhanced SSDs (ESSDs). You can select a performance level based on the capacity of an ESSD. The performance of an ESSD varies based on the capacity of the ESSD and the performance level. For more information, see ESSDs.

    • Multi-attach: You can select this option to enable the multi-attach feature for ESSDs. This way, an ESSD can be attached to multiple instances in the same zone. For more information, see Enable multi-attach.

    • Disk Encryption: Disk encryption is suitable for scenarios that require data security and regulatory compliance. If you select this option, data that is stored on the created disks is automatically encrypted.

    Quantity

    Specify the number of disks that you want to create.

    Note
    • You can attach up to 64 data disks to an ECS instance. The maximum number of disks that can be attached to an ECS instance varies based on the instance type. For more information, see Overview of instance families. When you create disks, pay attention to the number of disks to prevent resource waste.

    • Disks have capacity quotas. The total capacity of the disks that you want to create cannot exceed your remaining capacity quota. Use the following formula to calculate the total disk capacity: Total disk capacity = Capacity per disk × Number of disks. After you select a disk category, the purchased capacity and the remaining capacity quota of the disk category are displayed on the disk buy page. You can go to the Quota Center to view and adjust your disk capacity quotas. For more information, see Manage quotas.

    Release

    Specify whether to release the disks or the automatic snapshots of the disks together with the instance to which the disks are attached. This parameter is available only if you select Attach to ECS Instance and set the Billing Method parameter to Pay-as-you-go.

    Terms of Service

    Read and select ECS Terms of Service and Product Terms of Service.

    Others (Optional)

    Configure the Name, Description, Tag, and Resource Group parameters to help you identify and manage the disks.

  6. Confirm the configurations and fees, click Preview, and then proceed as prompted to create the disks.

    After you create the disks, you can view the disks on the Disks page. However, the disks cannot be directly used on the ECS instance. You must perform the required operations to use the disks. For more information, see the "What to do next" section of this topic.

What to do next

In most cases, a disk that is created from a snapshot contains data and does not require initialization. To use the new disk that is created from a snapshot on an instance, you need to only perform the following operations based on the operating system of the instance: