Skip to content

Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model#17417

Open
MihajloLinic wants to merge 11 commits into
GoogleCloudPlatform:mainfrom
MihajloLinic:main
Open

Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model#17417
MihajloLinic wants to merge 11 commits into
GoogleCloudPlatform:mainfrom
MihajloLinic:main

Conversation

@MihajloLinic
Copy link
Copy Markdown
Contributor

compute: added `FLEX_START` and `RESERVATION_BOUND` support to `google_compute_instance`, `google_compute_instance_template`, and `google_compute_region_instance_template`

Fixed version of PR: #16750
Error was during testing not accounting for recording mode

This PR adds support for the FLEX_START and RESERVATION_BOUND provisioning models to google_compute_instance, google_compute_instance_template, and google_compute_region_instance_template.

FLEX_START is a VM scheduling option in Google Cloud Compute Engine (part of the Dynamic Workload Scheduler) that allows flexible start times for VM instances, enabling cost optimization by letting Google schedule VM creation within a 24-hour time window. It is specifically designed for accelerator-optimized workloads (GPUs/TPUs).

RESERVATION_BOUND is a VM scheduling option that binds an instance to a specific reservation. When set, the instance will only consume capacity from the targeted reservation (configured via reservation_affinity). This is used with Calendar Reservations (Future Reservations) in the Dynamic Workload Scheduler, where GPU/TPU capacity is pre-booked for a specific time window and delivered as a standard reservation that instances can then target.

Changes

  • Schema Updates: Added FLEX_START and RESERVATION_BOUND as valid values for provisioning_model in the scheduling block of instances and instance templates. Updated field descriptions and validation logic.
  • TGC Support: Updated Terraform Google Conversion (TGC) logic to ensure FLEX_START and RESERVATION_BOUND are correctly handled during resource conversion.
  • Documentation: Updated the resource and data source documentation for instances and templates to include FLEX_START (with its required companion fields like instance_termination_action and max_run_duration) and RESERVATION_BOUND (with its companion reservation_affinity block).
  • Tests: Added comprehensive acceptance tests for both provisioning models across all affected resources:
    • TestAccComputeInstance_flexStart, TestAccComputeInstanceTemplate_flexStart, TestAccComputeRegionInstanceTemplate_flexStart
    • TestAccComputeInstance_reservationBound, TestAccComputeInstanceTemplate_reservationBound, TestAccComputeRegionInstanceTemplate_reservationBound

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions Bot requested a review from slevenick May 5, 2026 11:10
URL of the Zone where this future reservation resides.
output: true
The zone where the future reservation is located.
required: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't move a field from output-only to required without a breaking change. Why is this becoming required now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In google cloud API future reservations are zone based, for endpoint you need to sent which zone you are consuming reservation from. Variables that construct the url have to be under parameters: . if zone was left where it was users wouldn't be able to provide it in their .tf config

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 6, 2026
@github-actions
Copy link
Copy Markdown

@MihajloLinic, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants