All Products
Search
Document Center

Elastic Compute Service:Best practices for local disks

Last Updated:Feb 26, 2024

Local disks are located on the physical machines that host their associated Elastic Compute Service (ECS) instances. Compared with cloud disks, local disks have higher storage I/O performance but greater data risks. 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 to local disks

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, high 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 about local disks, see Local disks.

Risk comparison between local disks and cloud disks

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 that you store 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 that you use cloud disks for data storage.

Best practices

Select instance types

Instances that are equipped with local disks have great advantages in terms of cost and storage access latency, and are ideal for big data and heavy-load database applications. These instances include those in the i2 and d1 instance families. Enterprises that have a high-availability architecture at the application layer and require high storage I/O performance are ideal candidates for instances that are equipped with local disks. If you use a big data cluster, we recommend that you use deployment sets. Deployment sets distribute ECS instances across different physical machines and reduce data risk when local disk failures occur.

If your application is not deployed in a high-availability architecture, we recommend that you do not use instances that are equipped with local disks. For information about instance families, see Overview of instance families. For information about best practices for instance type selection, see Best practices for selecting instance types.

Back up a local disk

If your service is deployed on an instance that is equipped with local disks, but a high-availability architecture does not exist at the application layer, we recommend that you back up your data. You can back up local disk data by using one of the following methods:

  • Method 1: Use Hybrid Backup Recovery (HBR)

    HBR is a fully managed online backup service that allows you to back up data to the cloud in an efficient, secure, and cost-effective way. You can use HBR to back up data from local Internet data centers (IDCs), branches, or cloud resources to a cloud vault. For more information, see What is Cloud Backup?

  • Method 2: Build a redundant architecture

    You can build a redundant data architecture to reduce the impact of local disk failures. We recommend that you purchase a cloud disk and copy the data on a local disk to the cloud disk in real time. You can also purchase ECS instances in different zones or regions and deploy applications on the instances for disaster recovery.

Use deployment sets to improve availability

To ensure data availability, we recommend that you implement data redundancy at the application layer.

You can use deployment sets to distribute ECS instances across multiple physical machines for high availability and disaster recovery purposes. For more information, see Create a deployment set.

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 back up the data stored on an ECS instance that is equipped with local disks. SMC can also help you back up data from a single or multiple instances that are equipped with local disks to Alibaba Cloud with one click and generate image replicas. 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, specify a virtual private cloud (VPC) and vSwitch that have the same CIDR blocks as the VPC and vSwitch of the source instance when you create the destination instance. After you create the destination instance by using the ECS console, you can change the private IP address of the destination instance to that of the source instance. Alternatively, if you call an API operation to create the destination instance, you must specify the private IP address of the instance to that of the source instance and specify the VPC and vSwitch that have the same CIDR blocks as the VPC and vSwitch of the source instance for the instance.

  • We recommend that you select the transferring data over an internal network mode and enable block copy to maximize the efficiency of migration backup.

  • We recommend that you enable 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 that you stop 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, countermeasures, and event cycles. 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.

image