Local SSDs are available through both "SCSI" and "NVMe" interfaces.
If not indicated, "NVMe" will be the default one for local ssds.
We only support "SCSI" for persistent disks now.
Local SSDs are available through both "SCSI" and "NVMe" interfaces.
If not indicated, "NVMe" will be the default one for local ssds.
We only support "SCSI" for persistent disks now.
Name of a public or custom image used as the data source.
For example, the following are all valid URLs:
Specify the image by its family name:
projects/{project}/global/images/family/{image_family}
Specify the image version:
projects/{project}/global/images/{image_version}
You can also use Batch customized image in short names.
The following image values are supported for a boot disk:
"batch-debian": use Batch Debian images.
"batch-centos": use Batch CentOS images.
"batch-cos": use Batch Container-Optimized images.
Name of a public or custom image used as the data source.
For example, the following are all valid URLs:
Specify the image by its family name:
projects/{project}/global/images/family/{image_family}
Specify the image version:
projects/{project}/global/images/{image_version}
You can also use Batch customized image in short names.
The following image values are supported for a boot disk:
"batch-debian": use Batch Debian images.
"batch-centos": use Batch CentOS images.
"batch-cos": use Batch Container-Optimized images.
Disk size in GB.
For persistent disk, this field is ignored if data_source is image or
snapshot.
For local SSD, size_gb should be a multiple of 375GB,
otherwise, the final size will be the next greater multiple of 375 GB.
For boot disk, Batch will calculate the boot disk size based on source
image and task requirements if you do not speicify the size.
If both this field and the boot_disk_mib field in task spec's
compute_resource are defined, Batch will only honor this field.
Disk type as shown in gcloud compute disk-types list.
For example, local SSD uses type "local-ssd".
Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
or "pd-standard".
Disk type as shown in gcloud compute disk-types list.
For example, local SSD uses type "local-ssd".
Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
or "pd-standard".
Name of a public or custom image used as the data source.
For example, the following are all valid URLs:
Specify the image by its family name:
projects/{project}/global/images/family/{image_family}
Specify the image version:
projects/{project}/global/images/{image_version}
You can also use Batch customized image in short names.
The following image values are supported for a boot disk:
"batch-debian": use Batch Debian images.
"batch-centos": use Batch CentOS images.
"batch-cos": use Batch Container-Optimized images.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Interface AllocationPolicy.DiskOrBuilder (0.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.16.0 (latest)](/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder)\n- [0.15.0](/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder)\n- [0.14.1](/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.batch.v1.AllocationPolicy.DiskOrBuilder) \n\n public static interface AllocationPolicy.DiskOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getDataSourceCase()\n\n public abstract AllocationPolicy.Disk.DataSourceCase getDataSourceCase()\n\n### getDiskInterface()\n\n public abstract String getDiskInterface()\n\nLocal SSDs are available through both \"SCSI\" and \"NVMe\" interfaces.\nIf not indicated, \"NVMe\" will be the default one for local ssds.\nWe only support \"SCSI\" for persistent disks now.\n\n`string disk_interface = 6;`\n\n### getDiskInterfaceBytes()\n\n public abstract ByteString getDiskInterfaceBytes()\n\nLocal SSDs are available through both \"SCSI\" and \"NVMe\" interfaces.\nIf not indicated, \"NVMe\" will be the default one for local ssds.\nWe only support \"SCSI\" for persistent disks now.\n\n`string disk_interface = 6;`\n\n### getImage()\n\n public abstract String getImage()\n\nName of a public or custom image used as the data source.\nFor example, the following are all valid URLs:\n\n- Specify the image by its family name: projects/{project}/global/images/family/{image_family}\n- Specify the image version: projects/{project}/global/images/{image_version} You can also use Batch customized image in short names. The following image values are supported for a boot disk:\n- \"batch-debian\": use Batch Debian images.\n- \"batch-centos\": use Batch CentOS images.\n- \"batch-cos\": use Batch Container-Optimized images.\n- \"batch-hpc-centos\": use Batch HPC CentOS images.\n\n`string image = 4;`\n\n### getImageBytes()\n\n public abstract ByteString getImageBytes()\n\nName of a public or custom image used as the data source.\nFor example, the following are all valid URLs:\n\n- Specify the image by its family name: projects/{project}/global/images/family/{image_family}\n- Specify the image version: projects/{project}/global/images/{image_version} You can also use Batch customized image in short names. The following image values are supported for a boot disk:\n- \"batch-debian\": use Batch Debian images.\n- \"batch-centos\": use Batch CentOS images.\n- \"batch-cos\": use Batch Container-Optimized images.\n- \"batch-hpc-centos\": use Batch HPC CentOS images.\n\n`string image = 4;`\n\n### getSizeGb()\n\n public abstract long getSizeGb()\n\nDisk size in GB.\nFor persistent disk, this field is ignored if `data_source` is `image` or\n`snapshot`.\nFor local SSD, size_gb should be a multiple of 375GB,\notherwise, the final size will be the next greater multiple of 375 GB.\nFor boot disk, Batch will calculate the boot disk size based on source\nimage and task requirements if you do not speicify the size.\nIf both this field and the boot_disk_mib field in task spec's\ncompute_resource are defined, Batch will only honor this field.\n\n`int64 size_gb = 2;`\n\n### getSnapshot()\n\n public abstract String getSnapshot()\n\nName of a snapshot used as the data source.\nSnapshot is not supported as boot disk now.\n\n`string snapshot = 5;`\n\n### getSnapshotBytes()\n\n public abstract ByteString getSnapshotBytes()\n\nName of a snapshot used as the data source.\nSnapshot is not supported as boot disk now.\n\n`string snapshot = 5;`\n\n### getType()\n\n public abstract String getType()\n\nDisk type as shown in `gcloud compute disk-types list`.\nFor example, local SSD uses type \"local-ssd\".\nPersistent disks and boot disks use \"pd-balanced\", \"pd-extreme\", \"pd-ssd\"\nor \"pd-standard\".\n\n`string type = 1;`\n\n### getTypeBytes()\n\n public abstract ByteString getTypeBytes()\n\nDisk type as shown in `gcloud compute disk-types list`.\nFor example, local SSD uses type \"local-ssd\".\nPersistent disks and boot disks use \"pd-balanced\", \"pd-extreme\", \"pd-ssd\"\nor \"pd-standard\".\n\n`string type = 1;`\n\n### hasImage()\n\n public abstract boolean hasImage()\n\nName of a public or custom image used as the data source.\nFor example, the following are all valid URLs:\n\n- Specify the image by its family name: projects/{project}/global/images/family/{image_family}\n- Specify the image version: projects/{project}/global/images/{image_version} You can also use Batch customized image in short names. The following image values are supported for a boot disk:\n- \"batch-debian\": use Batch Debian images.\n- \"batch-centos\": use Batch CentOS images.\n- \"batch-cos\": use Batch Container-Optimized images.\n- \"batch-hpc-centos\": use Batch HPC CentOS images.\n\n`string image = 4;`\n\n### hasSnapshot()\n\n public abstract boolean hasSnapshot()\n\nName of a snapshot used as the data source.\nSnapshot is not supported as boot disk now.\n\n`string snapshot = 5;`"]]