public sealed class AllocationPolicy.Types.InstancePolicy : IMessage<AllocationPolicy.Types.InstancePolicy>, IEquatable<AllocationPolicy.Types.InstancePolicy>, IDeepCloneable<AllocationPolicy.Types.InstancePolicy>, IBufferMessage, IMessage
Reference documentation and code samples for the Batch v1 API class AllocationPolicy.Types.InstancePolicy.
InstancePolicy describes an instance type and resources attached to each VM
created by this InstancePolicy.
public AllocationPolicy.Types.Disk BootDisk { get; set; }
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.
public RepeatedField<AllocationPolicy.Types.AttachedDisk> Disks { get; }
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eAllocationPolicy.Types.InstancePolicy\u003c/code\u003e class is 2.13.0, as part of the Batch v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThis class, \u003ccode\u003eAllocationPolicy.Types.InstancePolicy\u003c/code\u003e, defines the instance type and resources attached to each virtual machine created, and it inherits from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eInstancePolicy\u003c/code\u003e class include \u003ccode\u003eAccelerators\u003c/code\u003e, \u003ccode\u003eBootDisk\u003c/code\u003e, \u003ccode\u003eDisks\u003c/code\u003e, \u003ccode\u003eMachineType\u003c/code\u003e, \u003ccode\u003eMinCpuPlatform\u003c/code\u003e, \u003ccode\u003eProvisioningModel\u003c/code\u003e, and \u003ccode\u003eReservation\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides constructors that allows the creation of instances and copies of this class, with support for setting parameters like the \u003ccode\u003eAllocationPolicy.Types.InstancePolicy\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Batch v1 API - Class AllocationPolicy.Types.InstancePolicy (2.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.12.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.11.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.10.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.9.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.8.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.7.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.6.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.5.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.4.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.3.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.2.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.1.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.0.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.3.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.2.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.1.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.0.0/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy) \n\n public sealed class AllocationPolicy.Types.InstancePolicy : IMessage\u003cAllocationPolicy.Types.InstancePolicy\u003e, IEquatable\u003cAllocationPolicy.Types.InstancePolicy\u003e, IDeepCloneable\u003cAllocationPolicy.Types.InstancePolicy\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Batch v1 API class AllocationPolicy.Types.InstancePolicy.\n\nInstancePolicy describes an instance type and resources attached to each VM\ncreated by this InstancePolicy. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AllocationPolicy.Types.InstancePolicy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.AllocationPolicy.Types.InstancePolicy), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Batch.V1](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Batch.V1.dll\n\nConstructors\n------------\n\n### InstancePolicy()\n\n public InstancePolicy()\n\n### InstancePolicy(InstancePolicy)\n\n public InstancePolicy(AllocationPolicy.Types.InstancePolicy other)\n\nProperties\n----------\n\n### Accelerators\n\n public RepeatedField\u003cAllocationPolicy.Types.Accelerator\u003e Accelerators { get; }\n\nThe accelerators attached to each VM instance.\n\n### BootDisk\n\n public AllocationPolicy.Types.Disk BootDisk { get; set; }\n\nBoot disk to be created and attached to each VM by this InstancePolicy.\nBoot disk will be deleted when the VM is deleted.\nBatch API now only supports booting from image.\n\n### Disks\n\n public RepeatedField\u003cAllocationPolicy.Types.AttachedDisk\u003e Disks { get; }\n\nNon-boot disks to be attached for each VM created by this InstancePolicy.\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### MachineType\n\n public string MachineType { get; set; }\n\nThe Compute Engine machine type.\n\n### MinCpuPlatform\n\n public string MinCpuPlatform { get; set; }\n\nThe minimum CPU platform.\nSee\n\u003chttps://cloud.google.com/compute/docs/instances/specify-min-cpu-platform\u003e.\n\n### ProvisioningModel\n\n public AllocationPolicy.Types.ProvisioningModel ProvisioningModel { get; set; }\n\nThe provisioning model.\n\n### Reservation\n\n public string Reservation { get; set; }\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."]]