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 v1alpha 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.
[[["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\u003e\u003ccode\u003eInstancePolicy\u003c/code\u003e is a class within the Batch v1alpha API that defines the configuration for the instances, including the type and resources, to be created.\u003c/p\u003e\n"],["\u003cp\u003eThis class, \u003ccode\u003eAllocationPolicy.Types.InstancePolicy\u003c/code\u003e, implements multiple interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, allowing for diverse functionalities such as message handling and cloning.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eInstancePolicy\u003c/code\u003e allows configuration of properties like \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, all pertaining to the specifications of each VM instance.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBootDisk\u003c/code\u003e and \u003ccode\u003eDisks\u003c/code\u003e properties enable the specification of boot and non-boot disks for each VM created, and these disks will be automatically deleted when the VM is deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAllowedMachineTypes\u003c/code\u003e property is deprecated and it's recommended to use \u003ccode\u003eMachineType\u003c/code\u003e instead when defining the type of the instance.\u003c/p\u003e\n"]]],[],null,["# Batch v1alpha API - Class AllocationPolicy.Types.InstancePolicy (1.0.0-alpha31)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-alpha31 (latest)](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy.Types.InstancePolicy)\n- [1.0.0-alpha30](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/1.0.0-alpha30/Google.Cloud.Batch.V1Alpha.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 v1alpha 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.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy.Types.InstancePolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AllocationPolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.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.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy)[Types](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.AllocationPolicy.Types)[InstancePolicy](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha.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.V1Alpha](/dotnet/docs/reference/Google.Cloud.Batch.V1Alpha/latest/Google.Cloud.Batch.V1Alpha)\n\nAssembly\n--------\n\nGoogle.Cloud.Batch.V1Alpha.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### AllowedMachineTypes\n\n [Obsolete]\n public RepeatedField\u003cstring\u003e AllowedMachineTypes { get; }\n\nDeprecated: please use machine_type instead.\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 specified, VMs will consume only the specified reservation.\nIf not specified (default), VMs will consume any applicable reservation."]]