Boot disk to be created and attached to each VM by this InstancePolicy. Boot disk will be deleted when the VM is deleted. Batch API now only supports booting from image.
Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted. A non-boot disk is a disk that can be of a device with a file system or a raw storage drive that is not ready for data storage and accessing.
↳ reservation
string
Optional. If not specified (default), VMs will consume any applicable reservation. If "NO_RESERVATION" is specified, VMs will not consume any reservation. Otherwise, if specified, VMs will consume only the specified reservation.
Non-boot disks to be attached for each VM created by this InstancePolicy.
New disks will be deleted when the VM is deleted.
A non-boot disk is a disk that can be of a device with a
file system or a raw storage drive that is not ready for data
storage and accessing.
Non-boot disks to be attached for each VM created by this InstancePolicy.
New disks will be deleted when the VM is deleted.
A non-boot disk is a disk that can be of a device with a
file system or a raw storage drive that is not ready for data
storage and accessing.
Optional. If not specified (default), VMs will consume any applicable
reservation. If "NO_RESERVATION" is specified, VMs will not consume any
reservation. Otherwise, if specified, VMs will consume only the specified
reservation.
Returns
Type
Description
string
setReservation
Optional. If not specified (default), VMs will consume any applicable
reservation. If "NO_RESERVATION" is specified, VMs will not consume any
reservation. Otherwise, if specified, VMs will consume only the specified
reservation.
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Batch V1 Client - Class InstancePolicy (1.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.2 (latest)](/php/docs/reference/cloud-batch/latest/V1.AllocationPolicy.InstancePolicy)\n- [1.2.1](/php/docs/reference/cloud-batch/1.2.1/V1.AllocationPolicy.InstancePolicy)\n- [1.1.7](/php/docs/reference/cloud-batch/1.1.7/V1.AllocationPolicy.InstancePolicy)\n- [1.0.3](/php/docs/reference/cloud-batch/1.0.3/V1.AllocationPolicy.InstancePolicy)\n- [0.17.0](/php/docs/reference/cloud-batch/0.17.0/V1.AllocationPolicy.InstancePolicy)\n- [0.16.10](/php/docs/reference/cloud-batch/0.16.10/V1.AllocationPolicy.InstancePolicy)\n- [0.15.0](/php/docs/reference/cloud-batch/0.15.0/V1.AllocationPolicy.InstancePolicy)\n- [0.14.0](/php/docs/reference/cloud-batch/0.14.0/V1.AllocationPolicy.InstancePolicy)\n- [0.13.1](/php/docs/reference/cloud-batch/0.13.1/V1.AllocationPolicy.InstancePolicy)\n- [0.12.1](/php/docs/reference/cloud-batch/0.12.1/V1.AllocationPolicy.InstancePolicy)\n- [0.11.3](/php/docs/reference/cloud-batch/0.11.3/V1.AllocationPolicy.InstancePolicy)\n- [0.10.0](/php/docs/reference/cloud-batch/0.10.0/V1.AllocationPolicy.InstancePolicy)\n- [0.9.0](/php/docs/reference/cloud-batch/0.9.0/V1.AllocationPolicy.InstancePolicy)\n- [0.8.0](/php/docs/reference/cloud-batch/0.8.0/V1.AllocationPolicy.InstancePolicy)\n- [0.7.0](/php/docs/reference/cloud-batch/0.7.0/V1.AllocationPolicy.InstancePolicy)\n- [0.6.0](/php/docs/reference/cloud-batch/0.6.0/V1.AllocationPolicy.InstancePolicy)\n- [0.5.2](/php/docs/reference/cloud-batch/0.5.2/V1.AllocationPolicy.InstancePolicy)\n- [0.4.0](/php/docs/reference/cloud-batch/0.4.0/V1.AllocationPolicy.InstancePolicy)\n- [0.3.0](/php/docs/reference/cloud-batch/0.3.0/V1.AllocationPolicy.InstancePolicy)\n- [0.2.2](/php/docs/reference/cloud-batch/0.2.2/V1.AllocationPolicy.InstancePolicy) \nReference documentation and code samples for the Google Cloud Batch V1 Client class InstancePolicy.\n\nInstancePolicy describes an instance type and resources attached to each VM\ncreated by this InstancePolicy.\n\nGenerated from protobuf message `google.cloud.batch.v1.AllocationPolicy.InstancePolicy`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Batch \\\\ V1 \\\\ AllocationPolicy\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getMachineType\n\nThe Compute Engine machine type.\n\n### setMachineType\n\nThe Compute Engine machine type.\n\n### getMinCpuPlatform\n\nThe minimum CPU platform.\n\nSee\n\u003chttps://cloud.google.com/compute/docs/instances/specify-min-cpu-platform\u003e.\n\n### setMinCpuPlatform\n\nThe minimum CPU platform.\n\nSee\n\u003chttps://cloud.google.com/compute/docs/instances/specify-min-cpu-platform\u003e.\n\n### getProvisioningModel\n\nThe provisioning model.\n\n### setProvisioningModel\n\nThe provisioning model.\n\n### getAccelerators\n\nThe accelerators attached to each VM instance.\n\n### setAccelerators\n\nThe accelerators attached to each VM instance.\n\n### getBootDisk\n\nBoot disk to be created and attached to each VM by this InstancePolicy.\n\nBoot disk will be deleted when the VM is deleted.\nBatch API now only supports booting from image.\n\n### hasBootDisk\n\n### clearBootDisk\n\n### setBootDisk\n\nBoot disk to be created and attached to each VM by this InstancePolicy.\n\nBoot disk will be deleted when the VM is deleted.\nBatch API now only supports booting from image.\n\n### getDisks\n\nNon-boot disks to be attached for each VM created by this InstancePolicy.\n\nNew disks will be deleted when the VM is deleted.\nA non-boot disk is a disk that can be of a device with a\nfile system or a raw storage drive that is not ready for data\nstorage and accessing.\n\n### setDisks\n\nNon-boot disks to be attached for each VM created by this InstancePolicy.\n\nNew disks will be deleted when the VM is deleted.\nA non-boot disk is a disk that can be of a device with a\nfile system or a raw storage drive that is not ready for data\nstorage and accessing.\n\n### getReservation\n\nOptional. If not specified (default), VMs will consume any applicable\nreservation. If \"NO_RESERVATION\" is specified, VMs will not consume any\nreservation. Otherwise, if specified, VMs will consume only the specified\nreservation.\n\n### setReservation\n\nOptional. If not specified (default), VMs will consume any applicable\nreservation. If \"NO_RESERVATION\" is specified, VMs will not consume any\nreservation. Otherwise, if specified, VMs will consume only the specified\nreservation."]]