The multi-attach feature allows you to attach a single cloud disk, such as an ESSD or an ESSD AutoPL disk, to multiple ECS instances that support the NVMe protocol in the same zone. This setup enables concurrent read and write access, making it ideal for workloads that require efficient data sharing and fast failover. This topic shows you how to attach a cloud disk to multiple ECS instances using the multi-attach feature.
For more information about the NVMe protocol, see NVMe protocol overview.
Use cases
The multi-attach feature is suitable for the following use cases:
Billing
The multi-attach feature is free of charge. You are charged only for the resources that you use, such as cloud disks and ECS instances. For more information about ECS billing, see Billing overview.
Limitations
The following limitations apply when you use the multi-attach feature:
|
Resource |
Description |
|
cloud disk |
|
|
Region and Zone |
This feature is supported in the same regions and zones where the required instance families are available. |
|
ECS instance |
|
|
Image |
The image must include NVMe drivers. Note
|
Procedure
Step 1: Create a multi-attach disk
Go to ECS console - Block Storage.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
-
Click Create Disk.
-
On the Create Disk page, configure the disk parameters.
NoteThis step describes only the parameters required to enable the multi-attach feature. For more information about other parameters, see Create an empty data disk.
Parameter
Description
Attach
Select Not Attach to create the disk without attaching it to an ECS instance.
Region and Zone
Select a region and zone that support the multi-attach feature.
Billing Method
Select Pay-as-you-go.
Cloud Disk
Configure the disk settings and enable the multi-attach feature.
-
Select a disk category and set the capacity.
-
Select Multi-attach.
After the disk is created, verify that the new disk shows Yes in the Multi-attach column on the Disks page.
-
Step 2: Attach the disk to multiple instances
Go to ECS console - Instances.
-
From the instance list, note the IDs of the ECS instances that support the NVMe protocol.
Go to ECS console - Block Storage.
-
Find the target disk and click Attach in the Actions column.
-
In the Attach Disk dialog box, configure the following parameters.
NoteThis step describes only the parameters required to attach a multi-attach-enabled cloud disk. For more information about other parameters, see Attach a data disk.
-
Target Instance: Enter the ID of the target ECS instance.
-
Release Disk with Instance: Do not select this option. The multi-attach feature requires you to retain the cloud disk when an instance is released.
-
-
Log on to an ECS instance to partition, format, and mount a file system for the disk.
For more information, see Initialize a data disk.
ImportantIf a multi-attach-enabled cloud disk that is attached to multiple ECS instances uses a file system designed for a single node, such as ext3, ext4, XFS, or NTFS, data cannot be synchronized between the instances. This can lead to data inconsistency. We recommend that you create a cluster file system that is suitable for your application. A cluster file system synchronizes all written data, created files, and modified metadata across all attached nodes in real time to ensure data consistency at the file system level. Common cluster file systems include OCFS2, GFS2, Veritas CFS, Oracle ACFS, and DBFS. For more information, see Deploy a cluster file system based on a shared NVMe disk.
-
(Optional) Repeat Step 2 to Step 5 to attach the cloud disk to multiple other ECS instances that support the NVMe protocol.
After the attachment is successful, the disk status changes to In Use. You can hover over the instance ID or name in the Associated Instance column to view the attachment information for one or more ECS instances.
Related documentation
-
You can modify the NVMe driver attributes of a custom image. For more information, see Modify the attributes and tags of an image.
-
When you resize a cloud disk that has the multi-attach feature enabled, the new capacity may not take effect. For more information, see Step 1: Resize a cloud disk.