- Documentation
Elastic Compute Service
Elastic Compute Service
User Guide
Elastic Block Storage
Basic volume operations
Attaching a volume
Basic volume operations
Attaching a volume
Attaching a volume
You can attach available data volumes to ECS instances. This topic explains how to do so.
Prerequisites
- Attach operations are only available for pay-as-you-go data volumes. They can be attached to either pay-as-you-go or subscription instances.
- You can only attach a volume to an instance within the same availability zone.
- You can attach data volumes either online or offline. The target instance's status must be "Running" or "Stopped".
- The target volume must be in the "Available" status and must be a data volume.
- Your account must have no outstanding balance and must not be more than two hours overdue.
Notes
- Different instance types support different types of volumes. You cannot attach an ESSD and a PTSSD volume to the same instance at the same time. For more information, see Instance types and specifications.
- You can only attach a volume to an instance within the same availability zone. Once you have attached the volume, you cannot change the availability zone.
Attaching volumes from the Instances page
- In the left navigation pane, select "Instances & Images > Instances".
- In the top menu bar, select the project and region where the instance resides.
- On the "Instances" page, use one of the following methods to access the "Attach Volume" page.
- Select "··· > Volumes & Image > Attach volumes" in the "Actions" column of the instance.
- Click the name of the instance to access its details page. Then, select the "Volumes" tab and click "Attach" in the upper-left corner of the page.
- Select the desired volume and choose whether to enable the "Delete with instance" feature, which is disabled by default.
tip
- If you enable "Delete with instance" and delete the instance, all data on the attached data volume will be deleted and billing will stop.
- If you do not select "Delete with instance" and then delete the instance, how the system handles the data on the attached data volume depends on the instance's billing method. If the instance adopts the pay-as-you-go billing method, the data volume is automatically detached and retained, and billing continues. If the instance is subscription-based, the data volume is deleted with the instance.
- Click "Attach" to attach the new data volume to the instance.
- A successfully attached volume will appear on the "Volumes" tab of the instance details page.
Attaching volumes from the Volumes page
- In the left navigation pane, select "Storage > Volumes".
- In the top menu bar, select the project and region in which you want to create a volume.
- On the "Volumes" page, select the desired volume and click "Attach" in the lower-left corner.
- In the "Attach Volume" panel, select the instance to which you want to attach the volume.
- Choose whether to enable the "Delete with instance" feature, which is disabled by default.
tip
- If you enable "Delete with instance" and delete the instance, all data on the attached data volume will be deleted and billing will stop.
- If you do not select "Delete with instance" and then delete the instance, how the system handles the data on the attached data volume depends on the instance's billing method. If the instance adopts the pay-as-you-go billing method, the data volume is automatically detached and retained, and billing continues. If the instance is subscription-based, the data volume is deleted with the instance.
- Click "Attach" to attach the data volume to the instance.
- After a successful attachment, you can view the instance to which the volume is attached in the "Instances" column on the "Volumes" page.
Last updated: 2026.04.29 14:25:49