Local disks are storage devices directly attached to the host server of an Elastic Compute Service (ECS) instance. Compared with cloud disks, local disks offer higher I/O performance but pose a higher risk of data loss. This topic describes how to select local disks based on business requirements and how to reduce data risks that are associated with local disks.
Introduction
Local disks are disks that are attached to the physical machines that host ECS instances. The disks provide local storage for ECS instances and the following benefits: high random IOPS, high throughput, cost-effectiveness, and low latency. Instances that are equipped with local disks are suitable for business scenarios that require high storage I/O performance and have a high-availability architecture at the application layer. For more information, see Local disks.
Risks
A local disk is attached only to a single physical machine and does not provide a distributed multi-copy mechanism. The durability of the data that is stored on a local disk is determined by the reliability of the associated physical machine. Data loss can occur in the following scenarios: the local disk fails, the physical machine to which the local disk is attached fails, and the disk is mishandled. We recommend storing only temporary data on local disks.
Compared with local disks, cloud disks use a distributed triplicate mechanism to provide data durability when unexpected hardware failures occur. If your application is not deployed in a multi-node data redundancy architecture, we recommend using cloud disks for data storage.
Best practices
Select instance types
For big data and heavy-load database applications, instances with local disks, such as those in the i4, d3c, and d3s instance families, offer significant advantages in cost and storage access latency. If your business scenario requires extremely high storage I/O performance and has a high-availability architecture at the application layer, you can use instances equipped with local disks. In addition, if you have a big data cluster, we recommend using a deployment set to distribute the instances across different physical servers. This reduces the impact of a damaged local disk.
If your application does not have a high-availability architecture, we recommend using other instances. For more information about instance parameters, see Overview of instance families. For more information about best practices, see Instance type selection.
Back up a local disk
You can back up data from a local disk to a Cloud Backup repository. You can also periodically back up data to OSS, NAS on the same instance, or a data disk by writing an automation script. For more information, see Back up data on a local disk.
If you use a local disk but do not have a data reliability architecture at the application layer, we strongly recommend that you back up your data.
Use deployment sets to improve availability
To ensure data availability, implement data redundancy at the application layer.
You can use deployment sets to achieve high availability and disaster recovery by distributing ECS instances across different physical servers. For more information, see Deployment sets.
Migrate data from a local disk to a cloud disk
If your business is deployed on an instance that is equipped with local disks, you can change the instance into an instance equipped with cloud disks. Cloud disks use a distributed triplicate mechanism, which provides data durability when unexpected hardware failures occur. You can create a snapshot for a cloud disk to back up data on the cloud disk.
You can use Server Migration Center (SMC) to perform a full data backup of an instance with local disks. SMC lets you migrate one or more local disk instances to Alibaba Cloud with a few clicks, creating an image backup in the process. For more information, see What is SMC?
When you migrate data, take note of the following items:
When you use SMC, you are charged only for ECS resources that you use during migration.
If you want to retain the public IP address of the source instance, you can convert the public IP address into an elastic IP address (EIP). Then, disassociate the EIP from the source instance. After you create a destination instance, you can associate the EIP with the destination instance.
If you want to retain the private IP address of the source instance, you must create the destination instance in the same VPC and vSwitch as the source instance. After you create the new instance in the ECS console, you can change its private IP address to match that of the source instance. Alternatively, when you create the instance by calling an API operation, you can directly specify the private IP address.
We recommend selecting the transferring data over an internal network mode and enable block copy to maximize the efficiency of migration.
We recommend enabling automatic incremental synchronization when you use SMC to migrate data and generate image replicas on a regular basis.
During migration, SMC does not interfere with the source instance, and does not modify the configurations or files of the source instance. SMC uses only a portion of the CPU, memory, and bandwidth resources. To ensure data consistency for applications such as databases, we recommend stopping the applications before you use SMC to migrate and back up data.
Handle local disk damages
If a local disk is damaged, Alibaba Cloud triggers a system event and sends you notifications containing recommended actions and other relevant information. You can perform O&M based on the scenarios, as shown in the following figure. For more information, see O&M scenarios and system events for instances equipped with local disks.