Add disks from a storage pool to VMs

You can create disks in a Hyperdisk Storage Pool and then attach the disk to a virtualmachine (VM) instance, or you can create disks in the storage pool whencreating a VM.

Before you begin

Required roles and permissions

To get the permissions that you need to create a Hyperdisk Balanced or Hyperdisk Throughput disk in a storage pool, ask your administrator to grant you the following IAM roles on the project:

  • Compute Instance Admin (v1) (roles/compute.instanceAdmin.v1)
  • To connect to a VM instance that can run as a service account: Service Account User (v1) (roles/iam.serviceAccountUser role)

For more information about granting roles, seeManage access to projects, folders, and organizations.

These predefined roles contain the permissions required to create a Hyperdisk Balanced or Hyperdisk Throughput disk in a storage pool. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

The following permissions are required to create a Hyperdisk Balanced or Hyperdisk Throughput disk in a storage pool:

  • To create disks in a storage pool and attach the disks to a VM instance:
    • 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
    • compute.storagePools.use on the storage pool you are creating disks in
  • To format and mount the attached volume: compute.instances.setMetadata on the VM

You might also be able to get these permissions withcustom roles or otherpredefined roles.

For the permissions needed to create an instance, seeRequired permissions.

Limitations

Review the following limitations for creating disks in a Hyperdisk Storage Pool:

  • You can create only Hyperdisk Balanced disks in a Hyperdisk Balanced Storage Pool and you can create only Hyperdisk Throughput disks in a Hyperdisk Throughput Storage Pool.
  • Only new disks in the same project and zone can be created in a storage pool.
  • To create boot disks in a storage pool, you must use a Hyperdisk Balanced Storage Pool.
  • Moving disks in or out of a storage pool is not permitted. To move a disk in or out of a storage pool, you have to recreate the disk from a snapshot. For more information, seeChange the disk type.
  • You can create up to 10,000 disks in a storage pool.
  • Storage pools don't supportregional disks.

Provisioning options

Depending on the provisioning type for the Hyperdisk Storage Pool, you can choose how toprovision both the capacity and the performance of each the disk that youcreate in the storage pool.

Provisioning disk capacity

If you create an Advanced capacity storage pool, you can use thin provisioning.You can create disks in the storage pool with a cumulative size thatexceeds the provisioned capacity of the pool. The used capacity of thestorage pool is defined by the total data in use and not by the amountof disk space that you've provisioned. You can provision disks with an aggregatecapacity of up to 1,000% of the provisioned capacity of an Advanced capacitystorage pool.

If you are creating disks in a Standard capacity storage pool, then youcreate disks in the storage pool until the total size of all disks in thestorage pool reaches the storage pool's provisioned capacity. Thedisks in a storage pool with Standard capacity behave similarly to non-pool disks,where capacity is consumed when you create the disks.

Provisioning performance

If you create an Advanced performance storage pool, you can use thin provisioning.You can create disks in the storage pool with a cumulative amount ofIOPS and throughput that exceeds the provisioned performance of the pool. Theused performance of the storage pool is defined by the total performanceused by disks and not by the amount of performance provisioned to each disk.You can provision disks with an aggregate performance of up to 500%% of theprovisioned performance of an Advanced performance storage pool.

If you are creating disks in a Standard performance storage pool, the IOPS orthroughput that you provision for a disk must be less than the available IOPS orthroughput in the Hyperdisk Storage Pool. The available IOPS or throughput is theprovisioned amount for the storage pool minus the used amount for all thedisks created in the storage pool.

If any of the conditions in the previous paragraph are not true, then therequest to create a disk in the storage pool fails and thedisk is not created.

Example

Assume that you have a Hyperdisk Balanced Storage Pool with 100,000 provisioned IOPS.

With Standard performance provisioning:

  • You can provision up to 100,000 of aggregate IOPS when creating Hyperdisk Balanced disks in the storage pool.
  • You are charged for the 100,000 IOPS of Hyperdisk Balanced Storage Pool provisioned performance.
  • Like disks created outside of a storage pool, Hyperdisk Balanced disks in Standard performance storage pools are automatically provisioned with up to 3,000 baseline IOPS and 140 MiB/s of baseline throughput. This baseline performance isn't counted against the provisioned performance for the storage pool. Only when you add disks to the storage pool with provisioned performance that's above the baseline does it count against the provisioned performance for the storage pool, for example:

    • A disk provisioned with 3,000 IOPS uses 0 pool IOPS and the pool still has 100,000 provisioned IOPS available for other disks.
    • A disk provisioned with 13,000 IOPS uses 10,000 pool IOPS and the pool has 90,000 provisioned IOPS remaining that you can allocate to other disks in the storage pool.

With Advanced performance provisioning:

  • You can provision up to 500,000 IOPS of aggregate Hyperdisk performance when creating disks in the storage pool.
  • You are charged for 100,000 IOPS provisioned by the storage pool.
  • If you create a single disk (Disk1) in the storage pool that has 5,000 IOPS, you don't consume any IOPS from the storage pool provisioned IOPS. However, the amount of IOPS that you can provision to new disks created in the storage pool is now 495,000.
  • IfDisk1 starts to read and write data, and if it uses its maximum of 5,000 IOPS in a given minute, then 5,000 IOPS is consumed from the storage pool provisioned IOPS. Any other disks that you created in the same storage pool can use an aggregated maximum of 95,000 IOPS in that same minute without running into contention.

Create disks in the storage pool

You can use the Google Cloud console, Google Cloud CLI, or REST to create adisk in a storage pool.

Console

Using the Google Cloud console, you can create a new disk in astorage pool either through theStorage pools page or theDisks page.

On theStorage pools page:

  1. In the Google Cloud console, go to theStorage pools page.

    Go to the Storage pools page

  2. Click the name of the storage pool that you would like to create adisk in.

  3. On theManage storage pool page, click+Create New Disk.

  4. In theAdd new disk panel, enter aName for the disk.

  5. Specify or change any values for which you don't want to use thedefault value.

  6. When finished specifying the disk properties, clickSave.

  7. On theManage storage pool page, you should see the new disk listedin theStorage pool disks section.

On theCreate Disk page:

  1. In the Google Cloud console, go toDisks >Create a disk page.

    Go to the Create a disk page

  2. Enter aName for the disk.

  3. Select the zone that contains the storage pool you want to createthe disk in.

  4. For theDisk type, choose the disk type that matches the Hyperdisk Storage Pool,either Hyperdisk Throughput or Hyperdisk Balanced.

  5. Modify the values in theSize,Provisioned IOPS, andProvisioned Throughput fields, as necessary.

  6. In theStorage pool section, selectEnable storage pool, thenchoose the name of the storage pool to create the disk in. Onlystorage pool that exist in the selected zone appear in the list.

  7. When finished specifying the disk information, clickCreate.

gcloud

To create one or more disks in a storage pool, use thegcloud compute disks create command.

gcloud compute disks createDISK_NAME \    --zone=ZONE \    --storage-pool=STORAGE_POOL_NAME \    --size=SIZE \    --type=DISK_TYPE \    --provisioned-iops=PROVISIONED_IOPS \    --provisioned-throughput=PROVISIONED_THROUGHPUT

Replace the following:

  • DISK_NAME: a unique name for the disk. You can provide alist of disk names specified by spaces to create multiple disks withthe same attributes.
  • ZONE: the zone where the storage pool was created. Specifythis value in region-zone format, for exampleus-central1-a.
  • STORAGE_POOL_NAME: the name of the storage pool to createthe disk in
  • SIZE: Optional: the provisioned capacity of the new disk. Thevalue must be a whole number followed by a size unit of GB for gibibyte,or TB for tebibyte. If no size is specified, 100 GB is used as thedefault value.
  • DISK_TYPE: the type of disk to create. This must match the typeof the Hyperdisk Storage Pool, eitherhyperdisk-balanced orhyperdisk-throughput.
  • PROVISIONED_IOPS: Optional: the IOPS to provision for thedisk. You can use this flag only with Hyperdisk Balanced disks.
  • PROVISIONED_THROUGHPUT: Optional: the throughput inmebibyte (MB) per second to provision for the disk.

REST

To create one or more disks in a storage pool, construct aPOSTusing thedisks.insert method.Include thename,sizeGb,type,storagePool,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",    "description": "DESCRIPTION",    "type": "https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/diskTypes/DISK_TYPE",    "sizeGb": "DISK_SIZE",    "storagePool": "STORAGE_POOL_NAME",    "provisionedIops": "IOPS_LIMIT",    "provisionedThroughput": "THROUGHPUT_LIMIT",}

Replace the following:

  • PROJECT_ID: the project ID
  • ZONE: the zone in which the storage pool is located,for example,us-central1-a. This is the zone that the disk willbe created in.
  • DISK_NAME: a unique name for the disk.
  • DESCRIPTION: Optional: a text string that describes thedisk.
  • DISK_TYPE: the type of disk, which must match thestorage pool type. Use eitherhyperdisk-throughput orhyperdisk-balanced.
  • DISK_SIZE: Optional: The size of the new disk. The value mustbe a whole number followed by a size unit of GB for gibibytes or TB fortebibytes. If no size is specified, 100 GB is used as thedefault value.
  • STORAGE_POOL_NAME: the name of the storage pool tocreate the disk in.
  • IOPS_LIMIT: Optional: the IOPS to provision for thedisk. You can use this flag only with Hyperdisk Balanced disks.
  • THROUGHPUT_LIMIT: Optional: The throughput in mebibytes (MB)per second to provision for the disk.

Go

// createDiskInStoragePool creates a new Hyperdisk in the specified storage pool.funccreateDiskInStoragePool(wio.Writer,projectId,zone,diskName,storagePoolName,diskTypestring)error{// Example usage://   projectID := "your_project_id"//   zone := "europe-central2-b"//   diskName := "your_disk_name"//   storagePoolName := "https://www.googleapis.com/compute/v1/projects/your_project_id/zones/europe-central2-b/storagePools/your_storage_pool"//   diskType := "zones/europe-central2-b/diskTypes/hyperdisk-balanced"ctx:=context.Background()client,err:=compute.NewDisksRESTClient(ctx)iferr!=nil{returnfmt.Errorf("NewDisksRESTClient: %v",err)}deferclient.Close()// Create the disk resourcedisk:=&computepb.Disk{Name:proto.String(diskName),Type:proto.String(diskType),SizeGb:proto.Int64(50),Zone:proto.String(zone),StoragePool:proto.String(storagePoolName),ProvisionedIops:proto.Int64(10000),ProvisionedThroughput:proto.Int64(1024),}// Create the insert disk requestreq:=&computepb.InsertDiskRequest{Project:projectId,Zone:zone,DiskResource:disk,}// Send the insert disk requestop,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,"Disk created in storage pool: %v\n",disk.Name)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;publicclassCreateDiskInStoragePool{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";// Link to the storagePool you want to use. Use format :// https://www.googleapis.com/compute/v1/projects/%s/zones/%s/storagePools/%s"StringstoragePoolName="YOUR_STORAGE_POOL_LINK";// The type of disk you want to create. This value uses the following format:// "zones/{zone}/diskTypes/(hyperdisk-balanced|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: the IOPS to provision for the disk.// You can use this flag only with Hyperdisk Balanced disks.longprovisionedIops=3000;// Optional: the throughput in mebibyte (MB) per second to provision for the disk.longprovisionedThroughput=140;createDiskInStoragePool(projectId,zone,diskName,storagePoolName,diskType,diskSizeGb,provisionedIops,provisionedThroughput);}// Creates a hyperdisk in the storage poolpublicstaticDiskcreateDiskInStoragePool(StringprojectId,Stringzone,StringdiskName,StringstoragePoolName,StringdiskType,longdiskSizeGb,longiops,longthroughput)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).setStoragePool(storagePoolName).setProvisionedIops(iops).setProvisionedThroughput(throughput).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 = 'us-central1-a';// The name of the new disk// diskName = 'disk-from-pool-name';// The name of the storage pool// storagePoolName = 'storage-pool-name';// Link to the storagePool you want to use. Use format:// https://www.googleapis.com/compute/v1/projects/{projectId}/zones/{zone}/storagePools/{storagePoolName}conststoragePool=`https://www.googleapis.com/compute/v1/projects/${projectId}/zones/${zone}/storagePools/${storagePoolName}`;// 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;asyncfunctioncallCreateComputeHyperdiskFromPool(){// Create a diskconstdisk=newcompute.Disk({sizeGb:diskSizeGb,name:diskName,type:diskType,zone,storagePool,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.`);}awaitcallCreateComputeHyperdiskFromPool();

Aftering creating the disk, you canattach the disk to a VM.

Create a VM that uses disks in the storage pool

When creating a VM, you configure a boot disk, and you can optionally createadditional data (non-boot) disks, which are automatically attached to the VM.The following sections explain how to create each type of disk in astorage pool as part of the VM creation process.

Create the boot disk for a VM in a storage pool

To create a VM that uses a boot disk in a storage pool, you must firstcreate a Hyperdisk Balanced Storage Pool. You can then create a VM using a machine type that supportsHyperdisk Balanced disks. The machine type, disk type, and storage pool must all beavailable in the zone that you choose.

Console

  1. In the Google Cloud console, go to theVM Instances page.

    Go to VM instances

  2. ClickCreate Instance.

  3. Enter a name for the instance.

  4. Set the zone to the same zone where the storage pool is located.

  5. Choose a machine type that supports Hyperdisk Balanced, for example H3.

  6. In theBoot disk section, clickChange.

  7. In theBoot disk panel, set theBoot disk type to Hyperdisk Balanced.

  8. Configure the properties for the disk.

  9. ExpandShow advanced configuration.

  10. Under the headingStorage pool, selectEnable storage pool.

  11. Choose the storage pool to create the disk in from the list.

  12. When finished with the disk configuration, clickSelect.

  13. Finish configuring the VM properties.

  14. ClickCreate.

    The console creates the VM in the specified zone, and creates the bootdisk in the selected storage pool.

gcloud

You can create the boot disk for a new VM in thestorage pool using thegcloud compute instances create commandand including thestorage-pool property for the boot disk.

gcloud compute instances createVM_NAME \    --zone=ZONE \    --machine-type=MACHINE_TYPE \    --create-disk=boot=yes,type=hyperdisk-balanced,size=DISK_SIZE,provisioned-throughput=THROUGHPUT, \    provisioned-iops=IOPS,image=projects/IMAGE_PROJECT/global/images/IMAGE, \    storage-pool=STORAGE_POOL_NAME

Replace the following:

  • VM_NAME: the name of the VM.
  • ZONE: the region and zone to create the VM in, using the formatus-central1-a.
  • MACHINE_TYPE: the machine type of the VM, for example,m3-ultramem-32.
  • DISK_SIZE: the size, in GiB, of the boot disk
  • THROUGHPUT: the throughput to provision for the disk
  • IOPS: the IOPS to provision for the disk
  • IMAGE_PROJECT: theprojectthat contains the image
  • IMAGE: specify one of the following:
    • A specific version of the OS image—for example,debian-12-bookworm-v20240213.
    • Animage family, which must beformatted asfamily/IMAGE_FAMILY. This createsthe instance from the most recent, non-deprecated OS image. Forexample, if you specifyfamily/debian-12, Compute Engine creates aVM using the latest version of the OS image in thedebian-12 imagefamily. For more information about using image families, seeImage families best practices.
  • STORAGE_POOL_NAME: the name of the storage pool to create thenew disk in.

REST

You can create the boot disk for a new VM in the storage poolby constructing aPOST request for theinstances.insert methodand including thestoragePool property for the boot disk.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances{   "name": "VM_NAME",   "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE",   "disks": [      {         "deviceName": "BOOT_DISK_DEVICE_NAME",         "initializeParams": {            "diskSizeGb": "DISK_SIZE",            "diskType": "DISK_TYPE",            "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"            "boot": true,            "provisionedIops": "IOPS_LIMIT",            "provisionedThroughput": "THROUGHPUT_LIMIT",            "storagePool": "POOL_URL"         }      }   ]}

Replace the following:

  • PROJECT_ID: the project ID
  • ZONE: the zone in which the storage pool is located,for example,us-central1-a. This is the zone that VM and boot disk arecreated in.
  • VM_NAME: the name of the VM.
  • MACHINE_TYPE: the machine type of the VM, for example,m3-ultramem-32.
  • BOOT_DISK_DEVICE_NAME: the device name for the boot disk
  • DISK_SIZE: the size, in GiB, of the boot disk
  • DISK_TYPE: the disk type, specified as a URI
  • IMAGE_PROJECT: theprojectthat contains the image
  • IMAGE: specify one of the following:
    • A specific version of the OS image—for example,debian-12-bookworm-v20240213.
    • Animage family, which must beformatted asfamily/IMAGE_FAMILY. This createsthe instance from the most recent, non-deprecated OS image. Forexample, if you specifyfamily/debian-12, Compute Engine creates aVM using the latest version of the OS image in thedebian-12 imagefamily. For more information about using image families, seeImage families best practices.
  • IOPS_LIMIT: the IOPS to provision for the disk
  • THROUGHPUT_LIMIT: the throughput to provision for the disk
  • POOL_URL: the storage pool in which the new disk is created.You can provide this as a partial or full URL to the resource. Forexample, the following are valid values:
    • https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • zones/ZONE/storagePools/STORAGE_POOL_NAME

Create additional disks in a storage pool during VM creation

When creating disks in a storage pool during VM creation, the machine type,disk type, and storage pool must be available in the zone that you choose.

Console

Use the following steps to use the console to create a new VM withadditional, non-boot disks:

  1. In the Google Cloud console, go to theVM Instances page.

    Go to VM instances

  2. ClickCreate Instance.

  3. Enter a name for the VM.

  4. Set the zone to the same zone where the storage pool is located.

  5. Choose a machine type that supports disk type used by thestorage pool.

  6. Expand theAdvanced options section.

  7. ExpandDisks.

  8. ClickAdd new disk.

  9. In theAdd new disk panel, enter the information for the disk. SettheDisk type to match the storage pool type.

  10. In theStorage Pool section, selectEnable storage pool.

  11. In theSelect a storage pool field, select the storage pool tocreate the disk in.

  12. When finished with the disk configuration, clickSave.

  13. Finish configuring the VM properties.

  14. ClickCreate.

    The console creates the VM in the specified zone, and creates thenon-boot disk in the selected storage pool.

gcloud

You can create new disks in a storage pool during VM creation by usingthegcloud compute instances create commandand including thestorage-pool property for the disk.

gcloud compute instances createVM_NAME \    --zone=ZONE \    --machine-type=MACHINE_TYPE \    --create-disk=auto-delete=yes,boot=yes,device-name=BOOT_DISK_DEVICE_NAME,image=IMAGE_NAME, \    size=BOOT_DISK_SIZE,type=BOOT_DISK_TYPE    --create-disk=auto-delete=yes,boot=no,device-name=DATA_DISK_DEVICE_NAME,size=DATA_DISK_SIZE, \    type=DATA_DISK_TYPE,provisioned-iops=IOPS,provisioned-throughput=THROUGHPUT, \    storage_pool=STORAGE_POOL_NAME

Replace the following:

  • VM_NAME: the name of the VM.
  • ZONE: the region and zone to creat the VM in, using the formatus-central1-a
  • MACHINE_TYPE: the machine type of the VM
  • BOOT_DISK_DEVICE_NAME: the device name for the boot disk
  • IMAGE_NAME: the name of the operating system image to installon the boot disk, for example,debian-12-bookworm-v20240213
  • BOOT_DISK_SIZE: the size, in GiB, of the boot disk
  • BOOT_DISK_TYPE: the disk type
  • DATA_DISK_DEVICE_NAME: the disk device name for the data disk
  • DATA_DISK_SIZE: the size of the data disk, in GiB
  • DATA_DISK_TYPE: the data disk type, eitherhyperdisk-balancedorhyperdisk-throughput
  • IOPS: the IOPS to provision for the disk
  • THROUGHPUT: the throughput to provision for the disk
  • STORAGE_POOL_NAME: the unique name for the storage poolthat you want to create the disk in.

REST

You can create new disks in a storage pool during VM creationby constructing aPOST request for theinstances.insert methodand including thestoragePool property for the additional disks.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances{   "name": "VM_NAME",   "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE",   "disks": [      {        "initializeParams":{            "sourceImage":"projects/IMAGE_PROJECT/global/images/IMAGE"        },        "boot":true      },      {        "deviceName": "DEVICE_NAME",        "boot":false,        "initializeParams": {           "diskSizeGb": "DISK_SIZE",           "diskType": "DISK_TYPE",           "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"           "provisionedIops": "IOPS_LIMIT",           "provisionedThroughput": "THROUGHPUT_LIMIT",           "storagePool": "POOL_URL"        }      }   ]}

Replace the following:

  • PROJECT_ID: the project ID
  • ZONE: the zone in which the storage pool is located,for example,us-central1-a. This is the zone that VM and boot disk arecreated in.
  • VM_NAME: the name of the VM.
  • MACHINE_TYPE: the machine type of the VM, for example,m3-ultramem-32.
  • IMAGE_PROJECT: theprojectthat contains the image
  • IMAGE: specify one of the following:
    • A specific version of the OS image—for example,debian-12-bookworm-v20240213.
    • Animage family, which must beformatted asfamily/IMAGE_FAMILY. This createsthe instance from the most recent, non-deprecated OS image. Forexample, if you specifyfamily/debian-12, Compute Engine creates aVM using the latest version of the OS image in thedebian-12 imagefamily. For more information about using image families, seeImage families best practices.
  • DEVICE_NAME: the device name for the data disk
  • DISK_SIZE: the size, in GiB, of the data disk
  • DISK_TYPE: the disk type, specified as a URI
  • IOPS_LIMIT: the IOPS to provision for the disk
  • THROUGHPUT_LIMIT: the throughput to provision for the disk
  • POOL_URL: the storage pool in which the new disk is created.You can provide this as a partial or full URL to the resource. Forexample, the following are valid values:
    • https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • zones/ZONE/storagePools/STORAGE_POOL_NAME

Use storage pool in an instance template

The instance templates used to create managed instance groups (MIGs) cancontain the storage pool information. The disks created using theinstance template are placed in the specified storage pool.

Console

  1. In the Google Cloud console, go to theInstance templates page.

    Go to Instance templates

  2. ClickCreate Instance Template.

  3. Enter a name for the instance template.

  4. ChooseRegional for the location, and in theRegion field, choosethe region where the storage pool is located.

  5. Choose a machine type that supports Hyperdisk Balanced, for example C3.

  6. In theBoot disk section, clickChange.

  7. In theBoot disk panel, set theBoot disk type to Hyperdisk Balanced.

  8. Configure the properties for the disk.

  9. ExpandShow advanced configuration.

  10. Under the headingStorage pool, selectEnable storage pool.

  11. Choose the storage pool to create the disk in from the list.

  12. When finished with the disk configuration, clickSelect.

  13. Finish configuring the VM properties.

  14. ClickCreate.

    The template creates the VM in the specified zone, and creates the bootdisk in the selected storage pool.

gcloud

You can specify in an instance template that the book disk be created ina storage pool by using thegcloud compute instance-templates create commandand including thestorage-pool property for the boot disk.

gcloud compute instance-templates createTEMPLATE_NAME \    --instance-template-region=REGION \    --machine-type=MACHINE_TYPE \    --create-disk=boot=yes,type=hyperdisk-balanced,size=DISK_SIZE,provisioned-throughput=THROUGHPUT, \    provisioned-iops=IOPS,image=projects/IMAGE_PROJECT/global/images/IMAGE, \    storage-pool=STORAGE_POOL_NAME

Replace the following:

  • TEMPLATE_NAME: the name of the instance template.
  • REGION: the region where you want to create the regionalinstance template. The region must contain the zone where thestorage pool is located.
  • MACHINE_TYPE: the machine type to use when creating the VM,for example,h3-standard-88.
  • DISK_SIZE: the size, in GiB, of the disk
  • THROUGHPUT: the throughput to provision for the disk
  • IOPS: the IOPS to provision for the disk
  • IMAGE_PROJECT: theproject that contains the image
  • IMAGE: specify one of the following:
    • A specific version of the OS image—for example,debian-12-bookworm-v20240213.
    • Animage family, which must beformatted asfamily/IMAGE_FAMILY. This createsthe instance from the most recent, non-deprecated OS image. Forexample, if you specifyfamily/debian-12, Compute Engine creates aVM using the latest version of the OS image in thedebian-12 imagefamily. For more information about using image families, seeImage families best practices.
  • STORAGE_POOL_NAME: the name of the storage pool to create thenew disk in.

REST

You can create the boot disk for a new VM in the storage poolby constructing aPOST request for theinstances.insert methodand including thestoragePool property for the boot disk.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/instanceTemplates{   "name": "VM_NAME",   "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE",   "disks": [      {         "deviceName": "BOOT_DISK_DEVICE_NAME",         "initializeParams": {            "diskSizeGb": "DISK_SIZE",            "diskType": "DISK_TYPE",            "sourceImage": "projects/IMAGE_PROJECT/global/images/IMAGE"            "boot": true,            "provisionedIops": "IOPS_LIMIT",            "provisionedThroughput": "THROUGHPUT_LIMIT",            "storagePool": "POOL_URL"         }      }   ]}

Replace the following:

  • PROJECT_ID: the project ID
  • VM_NAME: the name of the VM.
  • ZONE: the zone in which the storage pool is located,for example,us-central1-a. This is the zone that VM and boot disk arecreated in.
  • MACHINE_TYPE: the machine type of the VM, for example,m3-ultramem-32.
  • BOOT_DISK_DEVICE_NAME: the device name for the boot disk
  • DISK_SIZE: the size, in GiB, of the boot disk
  • DISK_TYPE: the disk type, specified as a URI
  • IMAGE_PROJECT: theproject that contains the image
  • IMAGE: specify one of the following:
    • A specific version of the OS image—for example,debian-12-bookworm-v20240213.
    • Animage family, which must beformatted asfamily/IMAGE_FAMILY. This createsthe instance from the most recent, non-deprecated OS image. Forexample, if you specifyfamily/debian-12, Compute Engine creates aninstance using the latest version of the OS image in thedebian-12image family. For more information about using image families, seeImage families best practices.
  • IOPS_LIMIT: the IOPS to provision for the disk
  • THROUGHPUT_LIMIT: the throughput to provision for the disk
  • POOL_URL: the storage pool in which the new disk is created.You can provide this as a partial or full URL to the resource. Forexample, the following are valid values:
    • https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • projects/PROJECT_ID/zones/ZONE/storagePools/STORAGE_POOL_NAME
    • zones/ZONE/storagePools/STORAGE_POOL_NAME

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-12-15 UTC.