You can create a separate pay-as-you-go disk, and attach the disk to an instance as a data disk.

Prerequisites

  • The target instance and the disk are in the same zone.
  • The target instance is in the Running or Stopped state, not in the Locked state.
  • The disk is in the Unattached (Available) state.
  • Your account has no overdue payments.

Background information

Take note of the following contents before you attach a disk:
  • Disks that are created with instances and subscription data disks that are created for subscription instances do not need to be attached.
  • You can attach a maximum of 16 data disks to an ECS instance.
  • A disk can be attached only to a single instance.

Attach disks on the Instances page

If you want to attach multiple disks to an instance, we recommend that you perform the operations on the Instances page.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the target instance and click the ID of the instance.
    Attach a data disk
  5. In the left-side navigation pane, click Disks. On the Disks page, click Attach Disk in the upper-right corner.
  6. Configure the following parameters in the dialog box that appears:
    • Target Disk: Select a disk that is in the same zone with the instance and is in the Unattached state from the drop-down list.
    • Release Disk with Instance: If you do not select this option, the disk will be retained when the instance is released.
      Note If the disk you want to attach is the system disk that you detached from another instance, the instance specified by Release Disk with Instance refers to the instance from which you detached the disk, not the current instance.
    • Delete Automatic Snapshots While Releasing Disk: If you select this option, automatic snapshots of the disk will be released when the disk is released. We recommend that you do not select this option to keep backup data.
  7. Click OK, and click Attach.
    If the state of the disk turns to In Use, the disk is attached.
  8. Before you can use the disk, perform the following operations based on the content of the disk and the operating system of the instance.
    Disk content Operating system What to do next
    New empty disks Linux For more information about operations on disks smaller than 2 TiB, see Format a data disk for a Linux-based ECS instance. For more information about operations on disks larger than 2 TiB, see Partition and format data disks larger than 2 TiB.
    Windows Server For more information about operations on disks smaller than 2 TiB, see Format a data disk for a Windows-based ECS instance. For more information about operations on disks larger than 2 TiB, see Partition and format data disks larger than 2 TiB.
    Disks created from snapshots Linux Establish a remote connection to the instance and run the following command to mount the disk partitions that have available file systems.
    mount <Data disk partition> <Mount target>
    Windows Server N/A

Attach disks on the Disks page

If you want to attach multiple disks to different ECS instances, we recommend that you perform the operations on the Disks page.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Storage & Snapshots > Disks.
  3. In the top navigation bar, select a region.
  4. Find the target disk in the Unattached state and choose More > Attach in the Actions column.
  5. Configure the following parameters in the dialog box that appears:
    • Target Instance: Select an ECS instance that is in the same zone as the disk.
    • Release Disk with Instance: If you do not select this option, the disk will be retained when the instance is released.
      Note If the disk you want to attach is the system disk that you detached from another instance, the instance specified by Release Disk with Instance refers to the instance from which you detached the disk, not the current instance.
    • Delete Automatic Snapshots While Releasing Disk: If you select this option, automatic snapshots of the disk will be released when the disk is released. We recommend that you do not select this option to keep backup data.
  6. Configure the parameters and click Attach.
    If the state of the disk turns to In Use, the disk is attached.
  7. Before you can use the disk, perform the following operations based on the content of the disk and the operating system of the instance.
    Disk content Operating system What to do next
    New empty disks Linux For more information about operations on disks smaller than 2 TiB, see Format a data disk for a Linux-based ECS instance. For more information about operations on disks larger than 2 TiB, see Partition and format data disks larger than 2 TiB.
    Windows Server For more information about operations on disks smaller than 2 TiB, see Format a data disk for a Windows-based ECS instance. For more information about operations on disks larger than 2 TiB, see Partition and format data disks larger than 2 TiB.
    Disks created from snapshots Linux Establish a remote connection to the instance and run the following command to mount the disk partitions that have available file systems.
    mount <Data disk partition> <Mount target>
    Windows Server N/A

What to do next

After the disk is in use, you can perform the following operations as needed.
Business requirement What to do next
Resize the disk
Back up disk data
Restore the disk to its initial status Reinitialize a data disk
Restore the disk to its status at a specific point of time Roll back a disk
Release unneeded pay-as-you-go disks to minimize costs
  1. Detach a cloud disk
  2. Release a disk