When system disks or data disks do not have sufficient space, you can resize the disks in the Elastic Compute Service (ECS) console to increase storage space. 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 new disk size take effect. After you resize a disk offline, you must restart the associated instance to make the new disk size 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, the instance is in the Running (Running) state.
If you want to resize the disk offline, 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.
NoteAfter 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.
NoteYou 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
Go to the Cloud Disk tab on the Instance Details page.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region where the ECS instance is located.
Find the instance to which the disk that you want to resize is attached and click the instance ID.
On the Instance Details page, click the Cloud Disk tab.
Find the disk that you want to resize. In the Actions column, choose .
To batch resize disks, log on to the ECS console with an Alibaba Cloud account and choose
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.NoteYou can use only Alibaba Cloud accounts instead of Resource Access Management (RAM) users to batch resize disks. To batch resize disks, log on to the ECS console with your Alibaba Cloud account.
Disks that are attached to the same instance cannot be batch resized.
In the Determine Disk and Read Notes step, click I Understand Risks and Have Backed Up Data. Proceed.
In the Configure Resizing Method and New Size step, configure the parameters.
Set the New Size parameter. The specified value cannot be smaller than the current disk size.
Set the Resizing Method parameter.
Resize Online: 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.
Resize Offline: 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.
NoteIf your 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 in this topic.
If the virtio driver version of a Windows instance is earlier than 58011, select Resize Offline. If you select Resize Online, the resize operation cannot take effect. Before you select Resize Online to resize the disk on the Windows instance, update the virtio driver version. For more information, see Update Red Hat virtio drivers of Windows instances.
If business deployed on instances does not support instance restarts, use the online resizing method.
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.
Read and select I have read and agreed to ECS Terms of Service.
Confirm the price and click OK.
Complete the payment.
In the Confirm Resizing Results step, click Next Step: Extend Partitions and File Systems when Successful is displayed in the Resizing Result column.
(Conditionally required) This step applies only when disks are resized offline. In the Extend Partitions and File systems step, click Restart Instance to restart the instance to which the disk is attached for the resize operation to take effect.
View the partition information of the disk and select a method to extend partitions and file systems on the disk.
Documentation: Connect to the instance and use the CLI in the operating system to extend partitions and file systems.
For more information, see Extend the partitions and file systems of disks on a Linux instance or Extend the partitions and file systems of a disk on a Windows instance.
Cloud Assistant: You do not need to connect to the instance. Use Cloud Assistant in the ECS console to send remote commands to the instance to extend partitions and file systems.
ImportantWhen you use Cloud Assistant, take note of the following limits:
Cloud Assistant is applicable only to specific users. If you can use Cloud Assistant, you are presented with the Cloud Assistant page in the ECS console.
Cloud Assistant commands can be run only on specific operating systems. For more information, see Overview of Cloud Assistant.
You must install Cloud Assistant on the ECS instance before you can use Cloud Assistant to extend partitions and file systems for 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.