public sealed class ReservationAffinity : IMessage<ReservationAffinity>, IEquatable<ReservationAffinity>, IDeepCloneable<ReservationAffinity>, IBufferMessage, IMessage
Reference documentation and code samples for the Compute Engine v1 API class ReservationAffinity.
Specifies the reservations that this instance can consume from.
public string ConsumeReservationType { get; set; }
Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples.
Check the ConsumeReservationType enum for the list of possible values.
Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value.
Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different-project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project.
[[["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-08 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eReservationAffinity\u003c/code\u003e class in the Google.Cloud.Compute.V1 API allows instances to specify which reservations they can consume from, with options for any, specific, or no reservation.\u003c/p\u003e\n"],["\u003cp\u003eVersion 3.6.0 is the latest version available for the \u003ccode\u003eReservationAffinity\u003c/code\u003e class, and there is documentation for numerous previous versions, dating back to version 1.0.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eConsumeReservationType\u003c/code\u003e property of \u003ccode\u003eReservationAffinity\u003c/code\u003e determines the type of reservation that can be consumed, and \u003ccode\u003eKey\u003c/code\u003e and \u003ccode\u003eValues\u003c/code\u003e are used to target specific reservations by name or shared reservations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReservationAffinity\u003c/code\u003e class implements several interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and is inherited from the base \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructors for the \u003ccode\u003eReservationAffinity\u003c/code\u003e class: one default and one that takes another \u003ccode\u003eReservationAffinity\u003c/code\u003e object as a parameter.\u003c/p\u003e\n"]]],[],null,[]]