Create a new Hyperdisk volume Stay organized with collections Save and categorize content based on your preferences.
You can use a Hyperdisk Balanced, Hyperdisk Extreme or Hyperdisk Throughput volume with yourCompute Engine instance by completing the following tasks:
- Create a blank, non-boot, and zonal Hyperdisk volume and attachit to your instance either during or after instance creation.
- Format and mount the volume to provide access to a data or file system.
For Hyperdisk Balanced volumes, you can also create boot disks as well as data disks.
For general information about Hyperdisk, seeAbout Hyperdisk.
To add a Hyperdisk Balanced High Availability disk to your instance, use the following procedures:
Before you begin
- Review theHyperdisk limitationsbefore adding a Hyperdisk volume to your compute instance.
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
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
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.- Set a default region and zone.
Go
To use the Go samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
Java
To use the Java samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
Node.js
To use the Node.js samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
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.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Required roles and permissions
To get the permissions that you need to add a Hyperdisk volume to your instance, ask your administrator to grant you the following IAM roles on the project:
- Compute Instance Admin (v1) (
roles/compute.instanceAdmin.v1
) - To connect to an instance that can run as a service account:Service Account User (v1) (
roles/iam.serviceAccountUser
)
For more information about granting roles, seeManage access to projects, folders, and organizations.
These predefined roles contain the permissions required to add a Hyperdisk volume to your instance. To see the exact permissions that are required, expand theRequired permissions section:
Required permissions
The following permissions are required to add a Hyperdisk volume to your instance:
- To create and attach a Hyperdisk volume:
compute.disks.create
on the projectcompute.instances.attachDisk
on the instancecompute.disks.use
on the volume that you want to attach to the instance
- To format and mount the attached volume:
compute.instances.setMetadata
on the instance
You might also be able to get these permissions withcustom roles or otherpredefined roles.
Supported values for Hyperdisk volumes
Size limits
The size you specify for a Hyperdisk volume must be within theranges listed in following table.
Hyperdisk type | Minimum size | Maximum size | Default size |
---|---|---|---|
Hyperdisk Balanced | 4 GiB | 64 TiB | 100 GiB |
Hyperdisk Balanced High Availability | 4 GiB | 64 TiB | 100 GiB |
Hyperdisk Extreme | 64 GiB | 64 TiB | 1 TiB |
Hyperdisk ML | 4 GiB | 64 TiB | 100 GiB |
Hyperdisk Throughput | 2 TiB | 32 TiB | 2 TiB |
However, the size of a Hyperdisk volume that's attached to a VMcan't exceed theHyperdisk limits for the VM.
Performance limits
The following table lists the limits for the performance that you can specify foreach Hyperdisk type. However, the IOPS and throughput levels youcan specify also depend on the volume's size. For a detailed summary of each limit,see theSize and performance limits section forHyperdisk Balanced,Hyperdisk Balanced High Availability,Hyperdisk Extreme,Hyperdisk ML, andHyperdisk Throughput.
Hyperdisk type | IOPS limit | Throughput limit (MiB/s) |
---|---|---|
Hyperdisk Balanced | 160,000 | 2,400 |
Hyperdisk Balanced High Availability | 100,000 | 1,200 |
Hyperdisk Extreme | 350,000 | You can't provision a throughput level forHyperdisk Extreme volumes. Each volume gets 250 MiB/s of throughputwith every 1,000 IOPS, up to 5,000 MiB/s. |
Hyperdisk ML | You can't provision an IOPS level,but each MiB/s of provisioned throughput comes with 16 IOPS,up to 19,200,000 IOPS. | 1,200,000 |
Hyperdisk Throughput | You can't provision an IOPSlevel, but each MiB/s of provisioned throughput comes with 4IOPS, up to 9,600 IOPS. | 2,400 |
Hyperdisk type variables
The following table lists the reference values of each Hyperdisktype. When creating a Hyperdisk volume with the Google Cloud CLI,REST, or the Cloud Client Libraries for Compute Engineindicate the Hyperdisk type to create by providing its correspondingvalue from the table.
Disk type | Reference name |
---|---|
Hyperdisk Balanced | hyperdisk-balanced |
Hyperdisk Balanced High Availability | hyperdisk-balanced-high-availability |
Hyperdisk Extreme | hyperdisk-extreme |
Hyperdisk Throughput | hyperdisk-throughput |
Hyperdisk ML | hyperdisk-ml |
Add a Hyperdisk volume to your instance
You can create and attach a Hyperdisk volume by using theGoogle Cloud console, Google Cloud CLI, or REST.
The size, throughput, and IOPS that you specify when creating a Hyperdiskvolume must be in the range ofsupported values.
When you create a Hyperdisk Balanced volume, you can optionally allow multiple instances toaccess the disk concurrently by creating the disk in multi-writer mode.
Console
Go to theVM instances page.
Click the name of the instance where you want to add a disk.
On theVM instance details page, clickEdit.
Under the headingAdditional disks, clickAdd new disk.
Specify a name for the disk, and optionally add a description. SelectBlank disk as theDisk source type.
UnderDisk settings, choose a disk type from the following list. Thevalues that you specify must be in the range ofsupported values.
- Hyperdisk Balanced. You can also change the default diskSize,Provisioned IOPS, andProvisioned Throughput settings.
- Hyperdisk Extreme. You can also change the default diskSize andProvisioned IOPS settings.
- Hyperdisk ML. You can also change thedefault diskSize andProvisioned Throughput settings.
- Hyperdisk Throughput.You can also change thedefault diskSize andProvisioned Throughput settings.
Optional: For Hyperdisk Balanced volumes, you can enable attaching the disk tomultiple instances by creating the disk in multi-writer mode. UnderAccess mode, selectMultiple VMs read write.
ClickSave.
To apply your changes to the instance, clickSave.
gcloud
Use the
gcloud compute disks create
commandto create the Hyperdisk volume.gcloud compute disks createDISK_NAME \ --zone=ZONE \ --size=DISK_SIZE \ --type=DISK_TYPE \ --provisioned-iops=IOPS_LIMIT --provisioned-throughput=THROUGHPUT_LIMIT --access-mode=DISK_ACCESS_MODE
Replace the following:
DISK_NAME
: the name of the new disk.ZONE
: the name of zone where the new diskis being created.DISK_SIZE
: Optional: The size of the newdisk. The value must be a whole number followed by a size unit of GBfor gibibyte, or TB for tebibyte. If no size unit is specified,100 GB is used as the default value. The accepted values for thedisk size are:- Hyperdisk Balanced: From 4 GiB to 64 TiB, inclusive, in 1 GiBincrements.
- Hyperdisk Extreme: From 64 GiB to 64 TiB, inclusive, in 1 GiBincrements.
- Hyperdisk ML: From 4 GiB to 64 TiB, inclusive, in 1 GiBincrements.
- Hyperdisk Throughput: From 2 TiB to 32 TiB, inclusive, in 1 GiBincrements.
DISK_TYPE
: the type of disk. Use one of thefollowing values:hyperdisk-balanced
,hyperdisk-extreme
,hyperdisk-ml
, orhyperdisk-throughput
IOPS_LIMIT
: Optional: For Hyperdisk Balanced or Hyperdisk Extremedisks, this is the number of I/O operations per second (IOPS) that thedisk can handle.THROUGHPUT_LIMIT
: Optional: For Hyperdisk Balanced,Hyperdisk ML, or Hyperdisk Throughput volumes, this is an integer that represents themaximum throughput, measured in MiB per second, that the disk canprovide.DISK_ACCESS_MODE
: Optional: How computeinstances can access the data on the disk. Supported values are:READ_WRITE_SINGLE
, for read-write access from one instance.This is the default.READ_WRITE_MANY
, (Hyperdisk Balanced and Hyperdisk Balanced High Availability only) for concurrentread-write access from multiple instances.READ_ONLY_MANY
, (Hyperdisk ML only) for concurrent read-only accessfrom multiple instances.
To set the access mode for Hyperdisk Balanced High Availability disks, seeCreate a regional disk.
Optional: Use the
gcloud compute disks describeDISK_NAME
commandto see a description of your disk.After you create the disk, you canattach the disk to an instance.
REST
Construct a
POST
request to create a zonal Hyperdiskby using thedisks.insert
method.Include thename
,sizeGb
,type
,provisionedIops
, andprovisionedThroughput
properties. To create this disk as an empty andunformatted non-boot disk, don't specify a source image or a sourcesnapshot.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", "accessMode": "DISK_ACCESS_MODE"}
Replace the following:
PROJECT_ID
: your project IDZONE
: the zone where your instance and newdisk are locatedDISK_NAME
: the name of the new diskDISK_SIZE
: Optional: The size of the newdisk. The value must be a whole number followed by a size unit of GBfor gibibytes or TB for tebibytes.DISK_TYPE
: the type of disk. To create aHyperdisk volume, use one of the following values:hyperdisk-balanced
,hyperdisk-extreme
,hyperdisk-ml
, orhyperdisk-throughput
.IOPS_LIMIT
: Optional: ForHyperdisk Balanced and Hyperdisk Extreme, this is the number of I/Ooperations per second that the disk can handle.THROUGHPUT_LIMIT
: Optional: For Hyperdisk Balanced,Hyperdisk ML, or Hyperdisk Throughput volumes, this is an integer that represents themaximum throughput, measured in MiB per second, that the disk canprovide.DISK_ACCESS_MODE
: Optional: How computeinstances can access the data on the disk. Supported values are:READ_WRITE_SINGLE
, for read-write access from one instance. This is the default.READ_WRITE_MANY
, (Hyperdisk Balanced and Hyperdisk Balanced High Availability only) for concurrent read-write access from multiple instances.READ_ONLY_MANY
, (Hyperdisk ML only) for concurrent read-only access from multiple instances.
To set the access mode for Hyperdisk Balanced High Availability disks, seeCreate a regional disk.
Optional: Use the
compute.disks.get
methodto see a description of your disk.After you create the disk, you canattach the diskto any running or stopped instance.
Go
// createHyperdisk creates a new Hyperdisk in the specified project and zone.funccreateHyperdisk(wio.Writer,projectId,zone,diskNamestring)error{// projectID := "your_project_id"// zone := "europe-central2-b"// diskName := "your_disk_name"ctx:=context.Background()client,err:=compute.NewDisksRESTClient(ctx)iferr!=nil{returnfmt.Errorf("NewDisksRESTClient: %v",err)}deferclient.Close()// use format "zones/{zone}/diskTypes/(hyperdisk-balanced|hyperdisk-throughput)".diskType:=fmt.Sprintf("zones/%s/diskTypes/hyperdisk-balanced",zone)// Create the diskdisk:=&computepb.Disk{Name:proto.String(diskName),Type:proto.String(diskType),SizeGb:proto.Int64(10),Zone:proto.String(zone),}req:=&computepb.InsertDiskRequest{Project:projectId,Zone:zone,DiskResource:disk,}op,err:=client.Insert(ctx,req)iferr!=nil{returnfmt.Errorf("Insert disk request failed: %v",err)}// Wait for the insert disk operation to completeiferr=op.Wait(ctx);err!=nil{returnfmt.Errorf("unable to wait for the operation: %w",err)}fmt.Fprintf(w,"Hyperdisk created: %v\n",diskName)returnnil}
Java
importcom.google.cloud.compute.v1.Disk;importcom.google.cloud.compute.v1.DisksClient;importcom.google.cloud.compute.v1.InsertDiskRequest;importcom.google.cloud.compute.v1.Operation;importjava.io.IOException;importjava.util.concurrent.ExecutionException;importjava.util.concurrent.TimeUnit;importjava.util.concurrent.TimeoutException;publicclassCreateHyperdisk{publicstaticvoidmain(String[]args)throwsIOException,ExecutionException,InterruptedException,TimeoutException{// TODO(developer): Replace these variables before running the sample.// Project ID or project number of the Google Cloud project you want to use.StringprojectId="YOUR_PROJECT_ID";// Name of the zone in which you want to create the disk.Stringzone="europe-central2-b";// Name of the disk you want to create.StringdiskName="YOUR_DISK_NAME";// The type of disk you want to create. This value uses the following format:// "zones/{zone}/diskTypes/(hyperdisk-balanced|hyperdisk-extreme|hyperdisk-throughput)".// For example: "zones/us-west3-b/diskTypes/hyperdisk-balanced"StringdiskType=String.format("zones/%s/diskTypes/hyperdisk-balanced",zone);// Size of the new disk in gigabytes.longdiskSizeGb=10;// Optional: For Hyperdisk Balanced or Hyperdisk Extreme disks,// this is the number of I/O operations per second (IOPS) that the disk can handlelongprovisionedIops=3000;// 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.longprovisionedThroughput=140;createHyperdisk(projectId,zone,diskName,diskType,diskSizeGb,provisionedIops,provisionedThroughput);}// Creates a hyperdisk in a projectpublicstaticDiskcreateHyperdisk(StringprojectId,Stringzone,StringdiskName,StringdiskType,longdiskSizeGb,longprovisionedIops,longprovisionedThroughput)throwsIOException,ExecutionException,InterruptedException,TimeoutException{// Initialize client that will be used to send requests. This client only needs to be created// once, and can be reused for multiple requests.try(DisksClientclient=DisksClient.create()){// Create a disk.Diskdisk=Disk.newBuilder().setZone(zone).setName(diskName).setType(diskType).setSizeGb(diskSizeGb).setProvisionedIops(provisionedIops).setProvisionedThroughput(provisionedThroughput).build();InsertDiskRequestrequest=InsertDiskRequest.newBuilder().setProject(projectId).setZone(zone).setDiskResource(disk).build();// Wait for the insert disk operation to complete.Operationoperation=client.insertAsync(request).get(1,TimeUnit.MINUTES);if(operation.hasError()){System.out.println("Disk creation failed!");thrownewError(operation.getError().toString());}// Wait for server updateTimeUnit.SECONDS.sleep(10);Diskhyperdisk=client.get(projectId,zone,diskName);System.out.printf("Hyperdisk '%s' has been created successfully",hyperdisk.getName());returnhyperdisk;}}}
Node.js
// Import the Compute libraryconstcomputeLib=require('@google-cloud/compute');constcompute=computeLib.protos.google.cloud.compute.v1;// Instantiate a diskClientconstdisksClient=newcomputeLib.DisksClient();// Instantiate a zoneOperationsClientconstzoneOperationsClient=newcomputeLib.ZoneOperationsClient();/** * TODO(developer): Update/uncomment these variables before running the sample. */// Project ID or project number of the Google Cloud project you want to use.constprojectId=awaitdisksClient.getProjectId();// The zone where your VM and new disk are located.// zone = 'europe-central2-b';// The name of the new disk// diskName = 'disk-name';// The type of disk. This value uses the following format:// "zones/{zone}/diskTypes/(hyperdisk-balanced|hyperdisk-extreme|hyperdisk-ml|hyperdisk-throughput)".// For example: "zones/us-west3-b/diskTypes/hyperdisk-balanced"constdiskType=`zones/${zone}/diskTypes/hyperdisk-balanced`;// Size of the new disk in gigabytes.constdiskSizeGb=10;// Optional: For Hyperdisk Balanced or Hyperdisk Extreme disks,// this is the number of I/O operations per second (IOPS) that the disk can handle.constprovisionedIops=3000;// 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.constprovisionedThroughput=140;asyncfunctioncallCreateComputeHyperdisk(){// Create a diskconstdisk=newcompute.Disk({sizeGb:diskSizeGb,name:diskName,zone,type:diskType,provisionedIops,provisionedThroughput,});const[response]=awaitdisksClient.insert({project:projectId,zone,diskResource:disk,});letoperation=response.latestResponse;// Wait for the create disk operation to complete.while(operation.status!=='DONE'){[operation]=awaitzoneOperationsClient.wait({operation:operation.name,project:projectId,zone:operation.zone.split('/').pop(),});}console.log(`Disk:${diskName} created.`);}awaitcallCreateComputeHyperdisk();
After you create the disk, you canattach the diskto any running or stopped instance.
Format and mount the disk
After you create andattach the new disk to an instance, youmust format and mount the disk, so that the operating system can use theavailable storage space.
- Linux: SeeFormatting and mounting a non-boot disk on a Linux compute instance
- Windows: SeeFormatting and mounting a non-boot disk on a Windows compute instance
What's next
- Learn how tocustomize the IOPS and throughput on your Hyperdisk volumes.
- Learn how to regularlyback up your disks using snapshotsto prevent unintended data loss.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-02 UTC.