All Products
Search
Document Center

Elastic Compute Service:Step 1: Resize a disk to extend its capacity

Last Updated:May 08, 2024

When system disks or data disks do not have sufficient storage space, you can resize the disks in the Elastic Compute Service (ECS) console to extend their capacity. This topic describes how to resize a disk online or offline. After you resize a disk online, you do not need to restart the associated instance to make the resize operation take effect. After you resize a disk offline, you must restart the associated instance to make the resize operation take effect.

Prerequisites

  • The instance to which the disk that you want to resize is attached meets the following requirements:

    • If you want to resize the disk online, make sure that the instance is in the Running (Running) state.

    • If you want to resize the disk offline, make sure that the instance is in the Running (Running) or Stopped (Stopped) state.

  • The disk that you want to resize meets the following requirements:

    • The disk is in the In Use (In Use) or Unattached (Unattached) state.

      Note

      After you resize the disk, you must extend the partitions and file systems on the disk in the operating system of the instance. If the disk is in the Unattached state, attach the disk to an instance before you extend the partitions and file systems on the disk.

    • (Recommended) Snapshots are created for the disk to back up data. For more information, see Create a snapshot for a disk.

      Note
      • You cannot resize a disk for which a snapshot is being created. Wait until the snapshot is created and then resize the disk.

      • You are charged for snapshots. For more information, see Billing of snapshots.

Procedure

  1. Go to the Cloud Disk tab on the Instance Details 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 the region where the ECS instance is located.image.png

    4. Find the instance to which the disk that you want to resize is attached and click the instance ID.

    5. On the Instance Details page, click the Cloud Disk tab.

  2. Find the disk that you want to resize. In the Actions column, choose 更多 > Resize.

    To batch resize multiple disks, log on to the ECS console with an Alibaba Cloud account and choose Storage & Snapshots > Disks in the left-side navigation pane. Then, select the disks that you want to resize on the Disks page and click Resize below the disk list.

    Note
    • You can use only Alibaba Cloud accounts to batch resize multiple disks. If you want to batch resize multiple disks, log on to the ECS console with your Alibaba Cloud account.

    • You cannot batch resize multiple disks that are attached to the same instance.

  3. In the Determine Disk and Read Notes step, click I Understand Risks and Have Backed Up Data. Proceed.

  4. In the Configure Resizing Method and New Size step, configure the parameters.

    image

    1. Configure the New Disk Size parameter. The value cannot be smaller than the current disk size.

    2. Configure the Resizing Method parameter. Valid values:

      • Online Resizing: the default recommended resize method. After you resize a disk online, you do not need to restart the instance for the resize operation to take effect.

      • Offline Resizing: After you resize a disk offline, you must restart the instance in the ECS console or by calling an API operation for the resize operation to take effect.

      Note
      • If the instance is in the Stopped state or the instance type does not support online resizing of disks, you can resize disks only offline. For information about the instance types that do not support online resizing of disks, see the FAQ section of this topic.

      • If the instance is a Windows instance on which a virtio driver version earlier than 58011 is installed, select Offline Resizing. If you select Online Resizing to resize a disk on the Windows instance, the resize operation does not take effect. Before you select Online Resizing to resize a disk on the Windows instance, update the virtio driver version. For more information, see Update Red Hat virtio drivers of Windows instances.

      • If the business deployed on an instance does not support instance restarts, select Online Resizing.

      • To make the resize operation take effect, restart the instance in the ECS console or by calling an API operation. You cannot run the reboot command to restart the instance from within the instance to make resize operation take effect. For more information, see Restart an instance or RebootInstance.

    3. Read the ECS Terms of Service and select I have read and agree to ECS Terms of Service.

    4. In the lower-left corner of the Resize Disk page, confirm the price and click OK.

    5. Complete the payment.

  5. In the Confirm Resizing Results step, click Next Step: Extend Partitions and File Systems in the lower-left corner of the Resize Disk page when Successful is displayed in the Resizing Result column.

    image

  6. (Conditionally required) Perform this step only if you resize disks offline. In the Extend Partitions and File systems step, click Restart Instance in the Solution section to restart the instance for the resize operation to take effect.

    image

  7. In the Extend Partitions and File systems step, view the partition information of the disk and select a method to extend partitions and file systems on the disk in the Resolution section.

    image

    • Documentation: Connect to the instance and use the CLI in the operating system to extend partitions and file systems on the disk.

      For more information, see Extend the partitions and file systems of disks on a Linux instance or Extend the partitions and file systems of disks on Windows instances.

    • Cloud Assistant: Use Cloud Assistant in the ECS console to send remote commands to extend partitions and file systems on the disk without the need to log on to the instance.

      Important

      When you use Cloud Assistant, take note of the following limits:

      • Cloud Assistant is available only to specific users. If you can use Cloud Assistant, you are presented with the ECS Cloud Assistant page in the ECS console.

      • Cloud Assistant commands can run only on specific operating systems. For more information, see Overview of Cloud Assistant.

      • You must install Cloud Assistant Agent on an instance before you can use Cloud Assistant to extend partitions and file systems on disks of the instance in the ECS console. For more information, see Install Cloud Assistant Agent.

      Click Run Preceding Command. In the Send Remote Commands dialog box, click Run. The system runs the command to extend partitions and file systems.

FAQ

What do I do if I resized a disk offline but do not want to restart the associated instance?

The offline resize operation takes effect only after you start or restart the associated instance. If you resized a disk offline but you cannot start or restart the instance due to your business requirements, you can resize the disk online to make the offline resize operation take effect. You are charged when you resize the disk online. Resize the disk based on your business requirements.

For example, if you resize a disk to 60 GiB offline in the ECS console, but you do not want to restart the associated instance, the offline resize operation does not take effect. You can resize the disk online in the ECS console. For example, you can resize the disk to 61 GiB online. After you resize the disk, the disk capacity is increased to 61 GiB in the operating system.

What do I do if the resize operation does not take effect on a disk for which the multi-attach feature is enabled?

After you resize a disk for which the multi-attach feature is enabled, all instances to which the disk is attached may not immediately recognize the new disk size. After you resize the disk, we recommend that you perform the following operations:

  1. Detach the disk. For more information, see Detach a data disk.

  2. Re-attach the disk. For more information, see Attach a data disk.

  3. (Conditionally required) If the new disk size is still not recognized by specific instances after you re-attach the disk, we recommend that you restart the instances. For more information, see Restart an instance.

Which instance types do not support online resizing of disks?

The following instance types do not support online resizing of disks:

  • ecs.ebmc4.8xlarge

  • ecs.ebmhfg5.2xlarge

  • ecs.ebmg5.24xlarge

  • ecs.t1

  • ecs.s1

  • ecs.s2

  • ecs.s3

  • ecs.c1

  • ecs.c2

  • ecs.m1

  • ecs.m2