Skip to content

Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model (FIXED)#16838

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

Compute: Add support for FLEX_START and RESERVATION_BOUND provisioning model (FIXED)#16838
MihajloLinic wants to merge 10 commits intoGoogleCloudPlatform: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 Mar 26, 2026
@github-actions github-actions bot requested a review from trodge March 26, 2026 11:29
@github-actions
Copy link
Copy Markdown

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

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

@MihajloLinic MihajloLinic marked this pull request as draft March 26, 2026 12:25
@MihajloLinic MihajloLinic marked this pull request as ready for review March 26, 2026 15:40
@MihajloLinic
Copy link
Copy Markdown
Contributor Author

The tests were messed up because of RECORDING mode, do note im not exactly certain about changes in FutureReservations.yaml because I don't know what is planned for it in the end

@github-actions
Copy link
Copy Markdown

@trodge This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

@GoogleCloudPlatform/terraform-team @trodge This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

@MihajloLinic
Copy link
Copy Markdown
Contributor Author

Any updates? Not critical since we are serving our custom terraform provider im just asking

@modular-magician modular-magician added service/compute-instances service/compute-reservation and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Apr 8, 2026
@modular-magician
Copy link
Copy Markdown
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 ( 13 files changed, 468 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 14 files changed, 743 insertions(+), 48 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 12 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field zone changed from optional to required on google_compute_future_reservation - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1414
Passed tests: 1317
Skipped tests: 90
Affected tests: 7

Click here to see the affected service packages
  • compute

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeFutureReservation_futureReservationBasicExample
  • TestAccComputeFutureReservation_update
  • TestAccComputeInstanceTemplate_flexStart
  • TestAccComputeInstanceTemplate_reservationBound
  • TestAccComputeInstance_reservationBound
  • TestAccComputeRegionInstanceTemplate_flexStart
  • TestAccComputeRegionInstanceTemplate_reservationBound

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeFutureReservation_futureReservationBasicExample [Error message] [Debug log]
TestAccComputeFutureReservation_update [Error message] [Debug log]
TestAccComputeInstanceTemplate_reservationBound [Error message] [Debug log]
TestAccComputeInstance_reservationBound [Error message] [Debug log]
TestAccComputeRegionInstanceTemplate_reservationBound [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link
Copy Markdown
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

Tests that are beta only should have provider = google-beta in each resource config.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 11, 2026
@github-actions github-actions bot requested a review from trodge April 11, 2026 20:02
@MihajloLinic
Copy link
Copy Markdown
Contributor Author

Added google-beta to failing tests

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 14, 2026
@modular-magician
Copy link
Copy Markdown
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 ( 13 files changed, 469 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 14 files changed, 744 insertions(+), 48 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 12 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field zone changed from optional to required on google_compute_future_reservation - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 1416
Passed tests: 1321
Skipped tests: 90
Affected tests: 5

Click here to see the affected service packages
  • compute

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeFutureReservation_futureReservationBasicExample
  • TestAccComputeFutureReservation_update
  • TestAccComputeInstanceTemplate_reservationBound
  • TestAccComputeInstance_reservationBound
  • TestAccComputeRegionInstanceTemplate_reservationBound

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeFutureReservation_futureReservationBasicExample [Error message] [Debug log]
TestAccComputeFutureReservation_update [Error message] [Debug log]
TestAccComputeInstanceTemplate_reservationBound [Error message] [Debug log]
TestAccComputeInstance_reservationBound [Error message] [Debug log]
TestAccComputeRegionInstanceTemplate_reservationBound [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

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

@trodge This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@github-actions
Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @trodge This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

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 service/compute-reservation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants