Add Hyperdisk storage to a VM


You can use a Hyperdisk Extreme or Hyperdisk Throughput volume with your VM by completing the following tasks:

  • Create a blank, non-boot, and zonal Hyperdisk volume and attach it to your VM either as part of VM creation or as separate tasks.
  • Format and mount the volume to provide access to a data or file system.

The process is the same for Hyperdisk Balanced volumes, except that you can also create boot disks of type Hyperdisk Balanced.

For general information about Hyperdisk, see About Hyperdisk.

Before you begin

  • Review the Hyperdisk limitations before adding a Hyperdisk volume to your VM.
  • 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 permissions that you need to add a Hyperdisk volume to your VM, ask your administrator to grant you the following IAM roles on the project:

For more information about granting roles, see Manage access.

These predefined roles contain the permissions required to add a Hyperdisk volume to your VM. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to add a Hyperdisk volume to your VM:

  • To create and attach a Hyperdisk volume:
    • compute.disks.create on the project
    • compute.instances.attachDisk on the VM
    • compute.disks.use on the volume that you want to attach to the VM
  • To format and mount the attached volume: compute.instances.setMetadata on the VM

You might also be able to get these permissions with custom roles or other predefined roles.

Add a Hyperdisk volume to your VM

You can create and attach a Hyperdisk volume by using the Google Cloud console, Google Cloud CLI, or REST.

Console

  1. Go to the VM instances page.

    Go to VM instances

  2. Click the name of the VM where you want to add a disk.

  3. On the VM instance details page, click Edit.

  4. Under the heading Additional disks, click Add new disk.

  5. Specify a name for the disk, and optionally add a description. Select Blank disk as the Disk source type.

  6. Under Disk settings, choose one of the following for disk type:

    1. Hyperdisk Balanced. You can also change the default disk Size, Provisioned IOPS, and Provisioned Throughput settings.
    2. Hyperdisk Extreme. You can also change the default disk Size and Provisioned IOPS settings.
    3. Hyperdisk Throughput.You can also change the default disk Size and Provisioned Throughput settings.
  7. Click Save.

  8. In the Edit window for your VM, click Save to apply your changes to the VM and add the new disk.

gcloud

  1. Use the gcloud compute disks create command to create the Hyperdisk volume.

    gcloud compute disks create DISK_NAME \
       --zone=ZONE \
       --size=DISK_SIZE \
       --type=DISK_TYPE \
       --provisioned-iops=IOPS_LIMIT
       --provisioned-throughput=THROUGHPUT_LIMIT
    

    Replace the following:

    • DISK_NAME: the name of the new disk.
    • ZONE: the name of zone where the new disk is being created.
    • DISK_SIZE: Optional: The size of the new disk. The value must be a whole number followed by a size unit of GB for gibibyte, or TB for tebibyte. If no size unit is specified, 100  GB is used as the default value. The accepted values for the disk size are:
      • Hyperdisk Balanced: From 4 GiB to 64 TiB, inclusive, in 1 GiB increments.
      • Hyperdisk Extreme: From 64 GiB to 64 TiB, inclusive, in 1 GiB increments.
      • Hyperdisk Throughput: From 2 TiB to 32 TiB, inclusive, in 1 GiB increments.
    • DISK_TYPE: the type of disk. Use one of the following values: hyperdisk-balanced, hyperdisk-extreme, or hyperdisk-throughput
    • IOPS_LIMIT: Optional: For Hyperdisk Balanced or Hyperdisk Extreme disks, this is the number of I/O operations per second (IOPS) that the disk can handle. The IOPS must be specified within the following limits:

      • Hyperdisk Balanced:
        • Minimum value: The lesser of 500 IOPS per GiB of disk capacity, or 3,000
        • Maximum value: The lesser of 500 IOPS per GiB of capacity, or 160,000 IOPS
      • Hyperdisk Extreme
        • Minimum value: Two IOPS per GiB of disk capacity.
        • Maximum value: The lesser of 1,200 times the capacity measured in GiB, or 350,000.

      If you don't specify a value for IOPS or disk size, then a default value is used:

      • Hyperdisk Balanced: The default IOPS is 3,600. If you specify a size for the disk, then the default value depends on the size:
        • 6 GiB or less: 500 IOPS per GiB of disk size
        • Larger than 6 GiB: The lesser of 3000 + 6 IOPS per GiB of disk size, or 160,000
      • Hyperdisk Extreme: The default value is the lesser of 100 times the disk capacity measured in GiB or the maximum IOPS for the machine type.

      For example, you can provision IOPS for Hyperdisk Extreme on a C3 VM as follows:

      • For a 64 GiB disk, you can provision IOPS in the range of 128 to 64,000. The default IOPS is 6,400.
      • For a 64,000 GiB disk, you can provision IOPS in the range of 128,000 to 350,000. The default IOPS is 350,000.
    • THROUGHPUT_LIMIT: Optional: For Hyperdisk Balanced or Hyperdisk Throughput volumes, this is an integer that represents the throughput, measured in MiB per second, that the disk can handle. The throughput must be specified within the following limits:

      • Hyperdisk Balanced:
        • Minimum value: The greater of IOPS divided by 256, or 140 MiBps
        • Maximum value: The greater of IOPS divided by 256, or 2,400 MiBps
      • Hyperdisk Throughput:
        • Minimum value: 10 MB/s per TiB of capacity.
        • Maximum value: The lesser of 600 MB/s per volume or 90 MB/s per TiB of capacity.

      If you don't specify a value for IOPS, throughput, or disk size, then a default value is used.

      • Hyperdisk Balanced: The default throughput is 140 MiBps. If you specify a size for the disk, then the default value depends on the size:
        • 6 GiB or less: 140 MiBps
        • Larger than 6 GiB: The lesser or ((6 * disk size in GiB) / 4) + 140, or 2,400 MiBps
      • Hyperdisk Throughput: The default throughput is 90 MiBps per TiB of disk capacity, but not more than the maximum supported throughput per disk.
  2. Optional: Use the gcloud compute disks describe DISK_NAME command to see a description of your disk.

  3. After you create the disk, you can attach the disk to a VM.

REST

  1. Construct a POST request to create a zonal Hyperdisk by using the disks.insert method. Include the name, sizeGb, type, provisionedIops, and provisionedThroughput properties. To create this disk as an empty and unformatted non-boot disk, don't specify a source image or a source snapshot.

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

    Replace the following:

    • PROJECT_ID: your project ID
    • ZONE: the zone where your VM and new disk are located
    • DISK_NAME: the name of the new disk
    • DISK_SIZE: Optional: The size of the new disk. The value must be a whole number followed by a size unit of GB for gibibytes or TB for tebibytes. Acceptable sizes for each disk type range, in 1 GiB increments:
      • Hyperdisk Balanced: from 4 GiB to 64 TiB, inclusive.
      • Hyperdisk Extreme: from 64 GiB to 64 TiB, inclusive.
      • Hyperdisk Throughput: from 2 TiB to 32 TiB, inclusive.
    • DISK_TYPE: the type of disk. To create a Hyperdisk volume, use one of the following values: hyperdisk-balanced, hyperdisk-extreme, or hyperdisk-throughput.
    • IOPS_LIMIT: Optional: For Hyperdisk Balanced and Hyperdisk Extreme, this is the number of I/O operations per second that the disk can handle. The IOPS must be specified within the following limits:

      • Minimum value:
        • Hyperdisk Balanced: The lesser of 500 IOPS per GiB of disk capacity or 3,000
        • Hyperdisk Extreme: Two IOPS per GiB of disk capacity
      • Maximum value:
        • Hyperdisk Balanced: The lesser of 500 IOPS per GiB of disk capacity or 160,000 IOPS
        • Hyperdisk Extreme: The lesser of 1,000 IOPS per GiB of disk capacity or the maximum IOPS for the machine type.

      If you don't specify a value for IOPS, a default value is used, which is:

      • Hyperdisk Balanced: 3,600 IOPS if the disk size isn't specified. If you specify a size for the disk, then the default value depends on the size:
        • 6 GiB or less: 500 IOPS per GiB of disk size
        • Larger than 6 GiB: The lesser of 3000 + 6 IOPS per GiB of disk size, or 160,000
      • Hyperdisk Extreme: The lesser of 100 IOPS per GiB of disk capacity or the maximum IOPS for the machine type.

      For example, you can provision IOPS for a Hyperdisk Extreme disk on a C3 VM as follows:

      • For a 64 GiB disk, you can provision IOPS in the range of 128 to 64,000. The default IOPS is 6,400.
      • For a 64 TiB disk, you can provision IOPS in the range of 128,000 to 350,000. The default IOPS is 350,000.
    • THROUGHPUT_LIMIT: Optional: For Hyperdisk Balanced or Hyperdisk Throughput volumes, this is an integer that represents the throughput, measured in MiB per second, that the disk can handle. The throughput must be specified within the following limits:

      • Hyperdisk Balanced:
        • Minimum value: The greater of IOPS divided by 256, or 140 MiBps
        • Maximum value: IOPS divided by 256, but not more than 2,400 MiBps
      • Hyperdisk Throughput:
        • Minimum value: 10 MB/s per TiB of capacity.
        • Maximum value: The lesser of 600 MB/s per volume or 90 MB/s per TiB of capacity.

      If you don't specify a value for IOPS, throughput, or disk size, then a default value is used.

      • Hyperdisk Balanced: The default throughput is 140 MiBps. If you specify a size for the disk, then the default value depends on the size:
        • 6 GiB or less: 140 MiBps
        • Larger than 6 GiB: The lesser of ((6 * disk size in GiB) / 4) + 140, or 2,400 MiBps
      • Hyperdisk Throughput: The default throughput is 90 MiBps per TiB of disk capacity, but not more than the maximum supported throughput per disk.
  2. Optional: Use the compute.disks.get method to see a description of your disk.

  3. After you create the disk, you can attach the disk to any running or stopped VM.

Format and mount the disk

After you create and attach the new disk to a VM, you must format and mount the disk, so that the operating system can use the available storage space.

What's next