Skip to main content

Resize a vDisk

Infrastructure admin users and VDC manager users can increase the size of a virtual disk that is available for an application instance.

Complete the following steps to resize a vDisk:

  1. Log in to the ThinkAgile CP Cloud Controller as an infrastructure admin or VDC manager user.
  2. Expand the VDC that contains the application instance and click VDC Instances.
    Figure 1. VDC instances page
    Screen capture of the VDC instances page
  3. Click the application instance to display the details for that instance. Then click the Profile tab.
    Figure 2. Profile tab
    Screen capture of the Profile tab for an application instance
  4. Scroll down to the Storage section and click the Actions menu (Screen capture of the Actions menu icon) for the vDisk to be resized. Then click Edit size.
    Figure 3. Actions menu

  5. Enter the new size of the disk and then click Save.
    Note
    The new size must be larger than the current size.
  6. After the disk has been resized, follow the additional steps below for your operating system (Windows or Linux).

After resizing a vDisk for Windows

After you resize a vDisk for Windows, complete the following steps:
  1. Establish a console session with the Windows instance, and open Disk Management. The disk that was resized will show in Unallocated space.
  2. Complete the following steps to create a new volume in the Unallocated space:
    1. Right-click the Unallocated space and select New Simple Volume.
    2. Click Next and enter the volume size.
    3. Click Next and assign a drive letter to the new volume.
    4. Click Next, select formatting options, and assign a volume label.
    5. Click Next and Finish.
  3. Complete the following steps to extend the current volume into the Unallocated space:

    1. Right-click the volume and select Extend Volume.
    2. Click Next and enter the amount of space to add to the volume.
    3. Click Next and Finish.
  4. Verify the partition is aligned and realign it if necessary:

    1. Open System Information (msinfo32).
    2. Click Components > Storage > Disks.
    3. For each disk, make note of the size in bytes, the partition size in bytes, and the partition starting offset in bytes.
    4. Check for misalignment:
      1. If you have multiple partitions, add the Partition Size (bytes) to the Partition Starting Offset (bytes). Subtract this value from the Partition Starting Offset (bytes) of the subsequent partition. You should get either 0 or a positive number.
      2. For the last partition on the disk, add the Partition Size (bytes) to the Partition Starting Offset (bytes). Subtract this value from the disk Size (bytes). You should get either 0 or a positive number.
      3. If you get a negative number for either of these, it means your partition is misaligned by that number of bytes: it's either overlapping another partition or it ends beyond the end of the disk.
    5. Shrink the volume if necessary:

      1. Open Disk Management.
      2. For each partition that is misaligned, right click on it and select Shrink. Shrink the volume by the amount by which it's misaligned or more. That is, take the negative number you calculated in the previous step and divide it by 1,048,576 to get the size in MB, then shrink the volume by at least that amount.

After resizing a vDisk for Linux

After resizing a vDisk for Linux, complete the following steps:
  1. Establish a console session with the Linux instance.
  2. Create a new ext4 partition /dev/sdb2 on disk /dev/sdb:
    1. Check how many drives are installed:

      fdisk -l | grep '^Disk'

    2. Add a partition to the disk:

      fdisk /dev/sdb

    3. Type p to use the partitioner, type n to create a new partition, and select your preferred settings when prompted.
    4. Type w to save the partition.
    5. Format the disk:

      mkfs.ext4 /dev/sdb2

    6. Create a mount point and mount the partition:

      mkdir /disk2

      mount /dev/sdb2 /disk2

    7. Edit fstab so the new partition automatically mounts to /disk2 on reboot:

      vi /etc/fstab

    8. Type i to edit the file.
    9. Add the followoing line:

      /dev/sdb2 /disk2 ext4 defaults 1 2

    10. Enter ESC and type :wq to write the changes and save the file.
  3. To expand an existing ext4 partition /dev/sdc1 on disk /dev/sdc that's mounted to /disk3:
    1. Unmount the partition:

      umount /disk3

    2. Expand the partition by deleting and recreating it without deleting the data:

      fdisk /dev/sdc

    3. Print the current partitions: p
    4. Delete the partition: d
    5. If multiple partitions are present, select the desired partition when prompted.
    6. Recreate the partition:
      1. Type p to use the partitioner, n to create a new partition, and select your preferred settings when prompted.

      2. Type w to save the partition.
    7. Expand the ext4 filesystem:

      resize2fs /dev/sdc1