You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Basic volume operations
Attaching a volume
Copy page
Download PDF
Attaching a volume
You can attach available data volumes to ECS instances. This topic explains how to do so.​
tip​
For instructions on how to automatically mount your volumes on boot, see Setting up automatic mounting of volume partitions upon boot.​
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​
  1. Log in to the ECS console.​
  1. In the left navigation pane, select "Instances & Images > Instances".​
  1. In the top menu bar, select the project and region where the instance resides.​
  1. 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.​
  1. 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.​
  1. Click "Attach" to attach the new data volume to the instance.​
  1. If you are attaching a newly created volume, refer to Partitioning and formatting a volume to learn how to partition and format it with a file system before you can use it.​
  • A successfully attached volume will appear on the "Volumes" tab of the instance details page.​
Attaching volumes from the Volumes page​
  1. Log in to the ECS console.​
  1. In the left navigation pane, select "Storage > Volumes".​
  1. In the top menu bar, select the project and region in which you want to create a volume.​
  1. On the "Volumes" page, select the desired volume and click "Attach" in the lower-left corner.​
  1. In the "Attach Volume" panel, select the instance to which you want to attach the volume.​
  1. 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.​
  1. Click "Attach" to attach the data volume to the instance.​
  1. If you are attaching a newly created volume, refer to Partitioning and formatting a volume to learn how to partition and format it with a file system before you can use it.​
  • 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