If you want to use data that is stored on an existing or a released disk to perform data extraction or fault analysis, you can use a snapshot of the disk to create disks. You can create disks from the snapshots of system disks or data disks.
Prerequisites
A snapshot is created for a system disk or a data disk, and the ID of the snapshot is obtained. For information about how to create snapshots, see Create a snapshot of 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.
We recommend that you do not use Logical Volume Manager (LVM) to create logical volumes across multiple disks. A snapshot can back up the data of only a single disk. If you create a logical volume across multiple disks by using LVM, data discrepancies may occur when you roll back the disks.
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 Modify 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
Log on to the ECS console.
In the left-side navigation pane, choose .
In the upper-left corner of the Disks page, click Create Disk.
In the Storage section of the disk buy page, click Create from Snapshot and then select a snapshot.
Configure the parameters that are described in the following table.
Parameter or section
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 ECS instances.
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 reside in the same zone. The region and zone of a disk cannot be changed after the disk is created. Proceed with caution when you configure the Region parameter.
Attach to ECS Instance: creates disks and attaches the disks to a specified ECS instance.
If you select this option, you must configure the ECS Instance parameter by selecting a region and an ECS instance.
NoteYou 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 must be attached to subscription instances.
Storage
Select a disk category and specify a disk capacity.
You must specify a disk capacity that is at least the same size as the snapshot. If the disk capacity that you specify is greater than the snapshot size, you must re-partition the disk to ensure that the excess disk capacity can be used.
ImportantIf 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 theDisk label type
parameter in the command output. If the parameter value isgpt
, 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 larger than 2 TiB in size.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, each 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.
NoteDisks have capacity quotas. The total capacity of the disks that you purchase cannot exceed the remaining capacity quota. You can use the following formula to calculate the total disk capacity: Total capacity = Capacity of a single disk × Number of disks. After you select a disk category, the purchased capacity and the remaining capacity quota are displayed on the disk buy page.
Release
Specify whether to release the automatic snapshots of the disks together with the disks or release 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 Billing Method to Pay-as-you-go.
Terms of Service
Read and select ECS Terms of Service and Product Terms of Service.
Others (Optional)
Configure the Disk Name, Description, Tags, and Resource Group parameters for easy search and management.
Confirm the configurations and the fees and click Preview. In the Preview message, click Create. Then, follow the on-screen instructions to complete the payment.
After the disks are created, you can view the disks on the Disks page. However, the disks cannot be directly used on ECS instances. You must perform the following operations before you can use the disks on ECS instances.
What to do next
In most cases, a disk that is created from a snapshot contains data and requires no additional initialization operation. To use the new disk that is created from a snapshot on an instance, perform the following operations based on the operating system of the instance:
Linux instance
If you selected Not Attach when you created the disk, attach the disk to an instance. For more information, see Attach a data disk.
Log on to the instance and run the following command to
mount
the partitions of the new disk:mount <Disk partition name> <Mount point>
Log on to the instance to which the source disk of the snapshot is attached, and run the
df -h
command to query the names and mount points of partitions for the new disk. You can use an existing directory as the mount point of a partition or run themkdir -p <Mount point>
command to create a directory as the mount point of the partition.ImportantIf you want to attach the new disk to the instance to which the source disk of the snapshot is attached, you must change the UUID of the new disk before you
mount
the partitions of the new disk. For more information, see Modify the UUID of a disk.
Windows instance
If you selected Not Attach when you created the disk, attach the disk to an instance. For more information, see Attach a data disk.
Log on to the instance and bring the disk online in the Disk Management window by performing Step 1 to Step 4 in the "Procedure" section of the "Initialize a data disk up to 2 TiB in size on a Windows instance" topic.