tencent cloud

All product documents
Cloud Virtual Machine
Expanding Cloud Disks
Last updated: 2024-01-08 09:37:01
Expanding Cloud Disks
Last updated: 2024-01-08 09:37:01

Scenarios

A cloud disk is an expandable storage device on cloud. You can expand its capacity at any time without losing any data in it. After expanding the cloud disk, you need to expand the partition and file system. You can allocate the capacity of the expanded part to an existing partition or format it into a new partition.
Note:
MBR partition supports disk with a maximum capacity of 2 TB. When you partition disk with a capacity greater than 2 TB, we recommend that you create and mount a new data disk and use the GPT partition format to copy data.

Expanding Data Disks

If the cloud disk is a data disk, you can expand it using the following three methods.
Note:
If multiple cloud disks of the same capacity and type are attached to the CVM, you can identify them using the method shown in Distinguishing data disks. Select a data disk and expand its capacity as instructed below.
Expand in the CVM console (recommended)
Expand in the CBS console
Expand via an API
1. Log into the CVM Console.
2. Select More > Resource Adjustment > Expand Cloud Disks in the Operation column.
3. Select the data disk to be expanded in the pop-up window, and click Next.
4. Select a new capacity (it must be greater than or equal to the current capacity) and click Next.
5. Read the notes and click Adjust Now, as shown below:


6. Assign its expanded capacity to an existing partition, or format it into an independent new partition. Depending on the operating system of the CVM, see Extending Partitions and File Systems (Windows) or Determining the Expansion Method.
1. Log in to the CBS Console.
2. Select More > Expand for the target cloud disk.
3. Select a new capacity. It must be greater than or equal to the current capacity.
4. Complete the payment.
5. Assign its expanded capacity to an existing partition, or format it into an independent new partition. Depending on the operating system of the CVM, see Extending Partitions and File Systems (Windows) or Determining the Expansion Method.
You can use the ResizeDisk API to expand the specified cloud disks. For more information, see ResizeDisk.

Expanding System Disks

1. Log in to the CVM console. Locate the target CVM, and select More > Resource Adjustment > Expand Cloud Disks in the Operation column.
2. Select the system disk to expand in the pop-up window, and click Next.
3. Select a new capacity (it must be greater than or equal to the current capacity) and click Next.
4. Expand the cloud disk as instructed below.
Expand in the CVM console
Expand in the CBS console
Expand via an API
Note:
CVM supports expanding a cloud system disk without shutting down the instance.
1. In the Expand partition and file system tab, read the notes and click Adjust Now.


2. Complete the capacity expansion in the console and log in to the instance to check whether the file system has been extended automatically. If not, extend the partition and file system as instructed in Extending System Disk and File System Online.
1. Log in to the CBS Console.
2. Select More > Expand for the target cloud disk.
3. Select a new capacity. It must be greater than or equal to the current capacity.
4. Complete the payment.
5. Assign its expanded capacity to an existing partition, or format it into an independent new partition. Depending on the operating system of the CVM, see Extending Partitions and File Systems (Windows) or Determining the Expansion Method.
You can use the ResizeInstanceDisks API to expand the non-elastic disks. For more information, see ResizeInstanceDisks.

Relevant operations

Distinguishing data disks

Check cloud disks according to the operating system of the CVM.
Linux
Windows
2. Run the following command to view the relationship between the elastic cloud disks and the device name.
ls -l /dev/disk/by-id
The following information will appear:

Note that disk-xxxx is the ID of a cloud disk. You can use it to view cloud disk details on the CBS console.
2. Right-click

, and select Run.
3. Enter cmd in the pop-up window and press Enter.
4. Run the following command to view the relationship between the elastic cloud disks and the device name.
wmic diskdrive get caption,deviceid,serialnumber
You can also run the following command.
wmic path win32_physicalmedia get SerialNumber,Tag
The following information will appear:

Note that disk-xxxx is the ID of a cloud disk. You can use it to view cloud disk details on the CBS console.

Checking the cloudinit configuration

Check cloud disks according to the operating system of the CVM.
Linux instance
Windows instance
After the expansion, log in to the Linux instance and check whether the /etc/cloud/cloud.cfg file contains the growpart and resizefs configuration items.
If yes, ignore other operations.


growpart: Expands the partition to the disk size.
resizefs: Expands or adjusts the file system in the / partition to the partition size.
If no, manually extend partitions and file systems (Linux) according to the operating system, and assign its extended capacity to an existing partition, or format it into an independent new partition.
After the system disk is expanded, log in to the Windows instance and check whether the ExtendVolumesPlugin configuration item under plugin exists in C:\\Program Files\\Cloudbase Solutions\\Cloudbase-Init\\conf\\cloudbase-init.conf.
If yes, reboot the machine. cloudbase-init will automatically extend the volume, adding the empty space behind the C partition to the C partition. Note that there must be no other partition between partition C and the blank space. If you don't want to reboot the machine, there are other partitions between the C partition and the blank space, or cloudbase-init is blocked by third-party security software, you need to execute the following powershell command manually.
$DiskOps="@
select disk 0
select volume c
extend
exit
@"
$DiskOps | diskpart.exe | Out-Null
If no, manually extend partitions and file systems (Windows) according to the operating system, and assign its extended capacity to an existing partition, or format it into an independent new partition.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon