Skip to content

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

Open
MihajloLinic wants to merge 5 commits intoGoogleCloudPlatform:mainfrom
MihajloLinic:main
Open

Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model#16750
MihajloLinic wants to merge 5 commits intoGoogleCloudPlatform:mainfrom
MihajloLinic:main

Conversation

@MihajloLinic
Copy link

@MihajloLinic MihajloLinic commented Mar 18, 2026

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

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 Mar 18, 2026
@google-cla
Copy link

google-cla bot commented Mar 18, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot requested a review from ScottSuarez March 18, 2026 12:33
@github-actions
Copy link

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

@ScottSuarez, 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.

@modular-magician modular-magician added service/compute-instances and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Mar 18, 2026
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 12 files changed, 228 insertions(+), 12 deletions(-))
google-beta provider: Diff ( 12 files changed, 228 insertions(+), 12 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 2 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1389
Passed tests: 1296
Skipped tests: 90
Affected tests: 3

Click here to see the affected service packages
  • compute

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_flexStart
  • TestAccComputeInstance_flexStart
  • TestAccComputeRegionInstanceTemplate_flexStart

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeInstanceTemplate_flexStart [Debug log]
TestAccComputeInstance_flexStart [Debug log]
TestAccComputeRegionInstanceTemplate_flexStart [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

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

Can you test what would happen if a user explicitly sets empty string. I think since w are migrating this from another type to essentially an enum we would need to support empty string in the permuations.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Mar 19, 2026
@github-actions github-actions bot requested a review from ScottSuarez March 19, 2026 16:34
@MihajloLinic MihajloLinic changed the title Compute: Add support for FLEX_START provisioning model Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model Mar 19, 2026
@MihajloLinic
Copy link
Author

I expanded the scope to include RESERVATION_BOUND option too, implemented in same way the FLEX_START was. I needed them to connect to provision VMs through Coder. I will test empty string after I make sure RESERVATION_BOUND works through Coder

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

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/compute-instances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants