Skip to content

[Feature Request] Support for ReservationAffinity to consume specific, cross-project reservations #315

Description

@lornaluo

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

The googlecompute builder currently lacks a mechanism to configure the reservationAffinity property when creating a build instance. This property is part of the Google Compute Engine API's instance scheduling object and is required to consume a specific reservation.

Use Case(s)

We are building a custom GKE node image on an GPU machine. This machine type requires a reservation. In our organization, these expensive, shared resources are managed in a central project, and the reservation is shared with our developer project where the Packer build runs. We need Packer to be able to consume this specific, shared reservation.

Potential configuration

source "googlecompute" "example-build" {
  project_id = "my-build-project"
  # ... other settings ...

  # New proposed block, mapping directly to the API object
  reservation_affinity {
    consume_reservation_type = "SPECIFIC_RESERVATION"
    key                      = "compute.googleapis.com/reservation-name"
    values                   = ["projects/shared-reservation-project/reservations/my-a3-reservation"]
  }
}

Potential References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions