Modify the settings for a Google Cloud Hyperdisk volume


If your workload requires additional storage space, you can increase the size of your Google Cloud Hyperdisk volume. Hyperdisk volumes also allow you to dynamically provision the performance characteristics of your disks.

  • Hyperdisk Balanced volumes: You can specify the IOPS and throughput levels when creating the volume, and you can also change those values at any time.
  • Hyperdisk Extreme volumes: You can specify the IOPS level when creating the volume, and you can also change that value at any time.
  • Hyperdisk Throughput volumes: You can specify the throughput level when creating the volume, and you can also change that value at any time.

Before you begin

  • If you haven't already, set up authentication. Authentication is the process by which your identity is verified for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine as follows.

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init
    2. Set a default region and zone.

    REST

    To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.

      Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init

Required roles and permissions

To get the permission that you need to modify a Hyperdisk, ask your administrator to grant you the following IAM roles on the project:

For more information about granting roles, see Manage access.

This predefined role contains the compute.disks.update permission, which is required to modify a Hyperdisk.

You might also be able to get this permission with custom roles or other predefined roles.

Supported values for Hyperdisk volumes

The values you use when modifying a Hyperdisk volume must fall within the range of maximum and minimum values described in Hyperdisk limits per disk.

If the Hyperdisk volume is attached to a VM, then the new values also can't exceed the Hyperdisk limits per VM.

Overview of modifying Hyperdisk

You can dynamically change the disk size or the performance characteristics of Hyperdisk volumes.

Capacity changes

You can resize a Hyperdisk volume only to increase its size. You can't reduce the capacity of a Hyperdisk volume. If you want to decrease the size of a Hyperdisk volume, you must create a smaller volume, migrate data from the original volume to the smaller volume, and delete the original volume.

You can increase the provisioned size for a Hyperdisk Extreme or Hyperdisk Balanced volume every 4 hours, and for a Hyperdisk Throughput volume every 6 hours. You can resize Hyperdisk volumes even if they are attached to a running VM.

For the best results, complete the following steps when changing the capacity of a Hyperdisk volume:

  1. Increase the size of the volume.
  2. Backup the disk.
  3. Resize the disk partitions.

Performance changes

After you change the provisioned IOPS or throughput, it can take up to 15 minutes for the changes to take effect. You can dynamically change the provisioned IOPS or throughput for a volume every 4 hours. Changing the provisioned IOPS or throughput for a Hyperdisk volume does not delete or modify disk data.

Modify a Hyperdisk volume

You can increase the volume size and change the provisioned IOPS or throughput for a Hyperdisk volume with the following time limits:

  • Increase the disk size: Once every four hours for Hyperdisk Extreme or Hyperdisk Balanced, once every six hours for Hyperdisk Throughput
  • Modify the provisioned IOPS or throughput: Once every four hours

If you attempt to change the disk before the four hours have expired, you will receive an error message like Cannot update provisioned throughput due to being rate limited.

Console

  1. In the Google Cloud console, go to the Disks page.

    Go to Disks

  2. In the list of disks in your project, click the name of the Hyperdisk volume for which you want to change the capacity or provisioned performance.

  3. On the disk details page, click Edit.

    1. In the Size field, enter the new size for your disk. The disk size must be in the range of supported values.
    2. For Hyperdisk Extreme and Hyperdisk Balanced: In the Provisioned IOPS field, enter the new IOPS value for your volume.
    3. For Hyperdisk Throughput and Hyperdisk Balanced: In the Provisioned throughput field, enter the new throughput value for your volume.
  4. Click Save to apply your changes to the disk.

gcloud

Use the disks update command and specify the --size, --provisioned-iops, or --provisioned-throughput flags.

gcloud compute disks update DISK_NAME  \
    --size=DISK_SIZE  \
    --provisioned-iops=IOPS_LIMIT  \
    --provisioned-throughput=THROUGHPUT_LIMIT

Replace the following:

  • DISK_NAME: the name of the Hyperdisk volume that you are modifying.
  • DISK_SIZE: Optional: The new size of the disk. The value must be a whole number followed by a size unit of GB for gibibyte, or TB for tebibyte. The disk size must be in the range of supported values.
  • IOPS_LIMIT: Optional: The IOPS configuration for Hyperdisk Extreme and Hyperdisk Balanced volumes. The value must be in the range of supported values.
  • THROUGHPUT_LIMIT: Optional: The throughput configuration for the Hyperdisk Throughput or Hyperdisk Balanced volume, specified as an integer that represents the throughput measured in MiB per second. The value must be in the range of supported values.

REST

Construct a POST request to the compute.disks.update method. In the request body, specify the sizeGb, provisionedIops or provisionedThroughput parameters.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME/update
{
   "sizeGb": "DISK_SIZE,
   "provisionedIops": "IOPS_LIMIT",
   "provisionedThroughput": "THROUGHPUT_LIMIT"
}

Replace the following:

  • PROJECT_ID: your project ID.
  • ZONE: the zone where your Hyperdisk volume is located.
  • DISK_NAME: the name of the Hyperdisk volume to modify.
  • DISK_SIZE: Optional: The new size of the disk. The value must be a whole number followed by a size unit of GB for gibibyte, or TB for tebibyte. The disk size must be in the range of supported values.
  • IOPS_LIMIT: Optional: The IOPS configuration for the Hyperdisk Extreme or Hyperdisk Balanced volume. The value must be in the range of supported values.
  • THROUGHPUT_LIMIT: Optional: The throughput configuration for the Hyperdisk Throughput or Hyperdisk Balanced volume, specified as an integer that represents the throughput measured in MiB per second. The value must be in the range of supported values.

Back up the Hyperdisk volume

Resizing a disk doesn't delete or modify disk data, but as a best practice, always backup your disk by creating a snapshot before you make any changes to the file system or partitions.

Resize the file system and partitions

After increasing the size of your Hyperdisk volume, you might need to resize its file system and partitions. For more information, see Resize the file system and partitions in the Persistent Disk documentation.

What's next