Skip to content

compute: add expose_host_topology to instance and instance template s… - #18882

Open
tanvinsharma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
tanvinsharma:add-compute-expose-host-topology
Open

compute: add expose_host_topology to instance and instance template s…#18882
tanvinsharma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
tanvinsharma:add-compute-expose-host-topology

Conversation

@tanvinsharma

@tanvinsharma tanvinsharma commented Sep 3, 2026

Copy link
Copy Markdown

Adds expose_host_topology field to scheduling for google_compute_instance, google_compute_instance_template, and google_compute_region_instance_template across GA (v1) and beta.

This field allows exposing host topology / hashed physical host ID to the VM instance.

Tested against GCE API and verified with acceptance tests on google_compute_instance, google_compute_instance_template, and google_compute_region_instance_template.

compute: added `expose_host_topology` field to `google_compute_instance` resource
compute: added `expose_host_topology` field to `google_compute_instance_template` resource
compute: added `expose_host_topology` field to `google_compute_region_instance_template` resource

@github-actions
github-actions Bot requested a review from ScottSuarez September 3, 2026 15:40
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

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.

@tanvinsharma
tanvinsharma force-pushed the add-compute-expose-host-topology branch 2 times, most recently from 658db96 to d5fda65 Compare September 3, 2026 15:50
@modular-magician

modular-magician commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 13 files changed, 239 insertions(+)
google-beta provider View Diff 13 files changed, 236 insertions(+)
terraform-google-conversion View Diff 4 files changed, 31 insertions(+), 5 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance (462 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance" "primary" {
  scheduling {
    maintenance_interval = # value needed
  }
}

Resource: google_compute_instance_from_machine_image (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
  }
}

Resource: google_compute_instance_from_template (31 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    on_host_maintenance  = # value needed
  }
}

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_compute_instance_from_machine_image
    • Expected Document Path: /website/docs/r/compute_instance_from_machine_image.html.markdown
    • Fields: [scheduling.expose_host_topology]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [scheduling.expose_host_topology]

Test report

Analytics

Total Tests Passed Skipped Affected
1562 1425 95 42
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 42 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeBackendService_backendServiceInFlightExample
  • TestAccComputeInstanceConfidentialInstanceConfigMain
  • TestAccComputeInstanceFromMachineImageWithOverride_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromMachineImageWithOverride_partnerMetadata
  • TestAccComputeInstanceFromMachineImage_basic
  • TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeInstanceFromMachineImage_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromMachineImage_maxRunDuration
  • TestAccComputeInstanceFromMachineImage_preemptionNoticeDuration
  • TestAccComputeInstanceFromMachineImage_withSourceMachineImageEncryptionKey
  • TestAccComputeInstanceTemplate_gracefulShutdown
  • TestAccComputeInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeInstance_GracefulShutdownWithResetUpdate
  • TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
  • TestAccComputeInstance_flexStart
  • TestAccComputeInstance_guestAccelerator
  • TestAccComputeInstance_guestAcceleratorSkip
  • TestAccComputeInstance_hostErrorTimeoutSecconds
  • TestAccComputeInstance_localSsdRecoveryTimeout
  • TestAccComputeInstance_localSsdRecoveryTimeout_update
  • TestAccComputeInstance_localSsdVM_maxRunDuration_stopTerminationAction
  • TestAccComputeInstance_maxRunDuration_update
  • TestAccComputeInstance_preemptionNoticeDuration
  • TestAccComputeInstance_provisioningModelEmptyString
  • TestAccComputeInstance_resourcePolicyCollocate
  • TestAccComputeInstance_resourcePolicySpread
  • TestAccComputeInstance_scheduling
  • TestAccComputeInstance_schedulingExposeHostTopology
  • TestAccComputeInstance_schedulingSkipGuestOSShutdown
  • TestAccComputeInstance_soleTenantNodeAffinities
  • TestAccComputeInstance_spotVM
  • TestAccComputeInstance_spotVM_maxRunDuration_deleteTerminationAction
  • TestAccComputeInstance_spotVM_maxRunDuration_update
  • TestAccComputeInstance_spotVM_update
  • TestAccComputeInstance_standardVM_maxRunDuration_deleteTerminationAction
  • TestAccComputeInstance_standardVM_maxRunDuration_stopTerminationAction
  • TestAccComputeRegionInstanceTemplate_gracefulShutdown
  • TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
  • TestAccComputeTargetInstance_withSecurityPolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstanceConfidentialInstanceConfigMain
✅ Log TestAccComputeInstanceFromMachineImageWithOverride_localSsdRecoveryTimeout
✅ Log TestAccComputeInstanceFromMachineImageWithOverride_partnerMetadata
✅ Log TestAccComputeInstanceFromMachineImage_basic
✅ Log TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
✅ Log TestAccComputeInstanceFromMachineImage_localSsdRecoveryTimeout
✅ Log TestAccComputeInstanceFromMachineImage_maxRunDuration
✅ Log TestAccComputeInstanceFromMachineImage_preemptionNoticeDuration
✅ Log TestAccComputeInstanceFromMachineImage_withSourceMachineImageEncryptionKey
✅ Log TestAccComputeInstance_flexStart
✅ Log TestAccComputeInstance_guestAcceleratorSkip
✅ Log TestAccComputeInstance_hostErrorTimeoutSecconds
✅ Log TestAccComputeInstance_localSsdRecoveryTimeout
✅ Log TestAccComputeInstance_localSsdRecoveryTimeout_update
✅ Log TestAccComputeInstance_localSsdVM_maxRunDuration_stopTerminationAction
✅ Log TestAccComputeInstance_maxRunDuration_update
✅ Log TestAccComputeInstance_preemptionNoticeDuration
✅ Log TestAccComputeInstance_provisioningModelEmptyString
✅ Log TestAccComputeInstance_resourcePolicyCollocate
✅ Log TestAccComputeInstance_resourcePolicySpread
✅ Log TestAccComputeInstance_scheduling
✅ Log TestAccComputeInstance_schedulingSkipGuestOSShutdown
✅ Log TestAccComputeInstance_soleTenantNodeAffinities
✅ Log TestAccComputeInstance_spotVM
✅ Log TestAccComputeInstance_spotVM_maxRunDuration_deleteTerminationAction
✅ Log TestAccComputeInstance_spotVM_maxRunDuration_update
✅ Log TestAccComputeInstance_spotVM_update
✅ Log TestAccComputeInstance_standardVM_maxRunDuration_deleteTerminationAction
✅ Log TestAccComputeInstance_standardVM_maxRunDuration_stopTerminationAction
✅ Log TestAccComputeRouterPeer_AddMd5AuthenticationKey
❌ Error · Log - TestAccComputeBackendService_backendServiceInFlightExample
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithResetUpdate
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
❌ Error · Log - TestAccComputeInstance_guestAccelerator
❌ Error · Log - TestAccComputeInstance_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeRegionInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
❌ Error · Log - TestAccComputeTargetInstance_withSecurityPolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@tanvinsharma, @ScottSuarez VCR tests complete for 658db96!

@modular-magician

modular-magician commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 13 files changed, 239 insertions(+)
google-beta provider View Diff 13 files changed, 236 insertions(+)
terraform-google-conversion View Diff 3 files changed, 25 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance (462 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance" "primary" {
  scheduling {
    maintenance_interval = # value needed
  }
}

Resource: google_compute_instance_from_machine_image (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
  }
}

Resource: google_compute_instance_from_template (31 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    on_host_maintenance  = # value needed
  }
}

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_compute_instance_from_machine_image
    • Expected Document Path: /website/docs/r/compute_instance_from_machine_image.html.markdown
    • Fields: [scheduling.expose_host_topology]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [scheduling.expose_host_topology]

Test report

Analytics

Total Tests Passed Skipped Affected
1562 1426 95 41
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 41 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeBackendService_backendServiceInFlightExample
  • TestAccComputeInstanceConfidentialInstanceConfigMain
  • TestAccComputeInstanceFromMachineImageWithOverride_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromMachineImageWithOverride_partnerMetadata
  • TestAccComputeInstanceFromMachineImage_basic
  • TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeInstanceFromMachineImage_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromMachineImage_maxRunDuration
  • TestAccComputeInstanceFromMachineImage_preemptionNoticeDuration
  • TestAccComputeInstanceFromMachineImage_withSourceMachineImageEncryptionKey
  • TestAccComputeInstanceTemplate_gracefulShutdown
  • TestAccComputeInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeInstance_GracefulShutdownWithResetUpdate
  • TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
  • TestAccComputeInstance_flexStart
  • TestAccComputeInstance_guestAccelerator
  • TestAccComputeInstance_guestAcceleratorSkip
  • TestAccComputeInstance_hostErrorTimeoutSecconds
  • TestAccComputeInstance_localSsdRecoveryTimeout
  • TestAccComputeInstance_localSsdRecoveryTimeout_update
  • TestAccComputeInstance_localSsdVM_maxRunDuration_stopTerminationAction
  • TestAccComputeInstance_maxRunDuration_update
  • TestAccComputeInstance_preemptionNoticeDuration
  • TestAccComputeInstance_provisioningModelEmptyString
  • TestAccComputeInstance_resourcePolicyCollocate
  • TestAccComputeInstance_resourcePolicySpread
  • TestAccComputeInstance_scheduling
  • TestAccComputeInstance_schedulingExposeHostTopology
  • TestAccComputeInstance_schedulingSkipGuestOSShutdown
  • TestAccComputeInstance_soleTenantNodeAffinities
  • TestAccComputeInstance_spotVM
  • TestAccComputeInstance_spotVM_maxRunDuration_deleteTerminationAction
  • TestAccComputeInstance_spotVM_maxRunDuration_update
  • TestAccComputeInstance_spotVM_update
  • TestAccComputeInstance_standardVM_maxRunDuration_deleteTerminationAction
  • TestAccComputeInstance_standardVM_maxRunDuration_stopTerminationAction
  • TestAccComputeRegionInstanceTemplate_gracefulShutdown
  • TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
  • TestAccComputeTargetInstance_withSecurityPolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstanceConfidentialInstanceConfigMain
✅ Log TestAccComputeInstanceFromMachineImageWithOverride_localSsdRecoveryTimeout
✅ Log TestAccComputeInstanceFromMachineImageWithOverride_partnerMetadata
✅ Log TestAccComputeInstanceFromMachineImage_basic
✅ Log TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
✅ Log TestAccComputeInstanceFromMachineImage_localSsdRecoveryTimeout
✅ Log TestAccComputeInstanceFromMachineImage_maxRunDuration
✅ Log TestAccComputeInstanceFromMachineImage_preemptionNoticeDuration
✅ Log TestAccComputeInstanceFromMachineImage_withSourceMachineImageEncryptionKey
✅ Log TestAccComputeInstance_flexStart
✅ Log TestAccComputeInstance_guestAcceleratorSkip
✅ Log TestAccComputeInstance_hostErrorTimeoutSecconds
✅ Log TestAccComputeInstance_localSsdRecoveryTimeout
✅ Log TestAccComputeInstance_localSsdRecoveryTimeout_update
✅ Log TestAccComputeInstance_localSsdVM_maxRunDuration_stopTerminationAction
✅ Log TestAccComputeInstance_maxRunDuration_update
✅ Log TestAccComputeInstance_preemptionNoticeDuration
✅ Log TestAccComputeInstance_provisioningModelEmptyString
✅ Log TestAccComputeInstance_resourcePolicyCollocate
✅ Log TestAccComputeInstance_resourcePolicySpread
✅ Log TestAccComputeInstance_scheduling
✅ Log TestAccComputeInstance_schedulingSkipGuestOSShutdown
✅ Log TestAccComputeInstance_soleTenantNodeAffinities
✅ Log TestAccComputeInstance_spotVM
✅ Log TestAccComputeInstance_spotVM_maxRunDuration_deleteTerminationAction
✅ Log TestAccComputeInstance_spotVM_maxRunDuration_update
✅ Log TestAccComputeInstance_spotVM_update
✅ Log TestAccComputeInstance_standardVM_maxRunDuration_deleteTerminationAction
✅ Log TestAccComputeInstance_standardVM_maxRunDuration_stopTerminationAction
❌ Error · Log - TestAccComputeBackendService_backendServiceInFlightExample
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithResetUpdate
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
❌ Error · Log - TestAccComputeInstance_guestAccelerator
❌ Error · Log - TestAccComputeInstance_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeRegionInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
❌ Error · Log - TestAccComputeTargetInstance_withSecurityPolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@tanvinsharma, @ScottSuarez VCR tests complete for d5fda65!

@tanvinsharma
tanvinsharma force-pushed the add-compute-expose-host-topology branch from d5fda65 to b4bd849 Compare September 3, 2026 17:34
@modular-magician

modular-magician commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 14 files changed, 240 insertions(+)
google-beta provider View Diff 15 files changed, 238 insertions(+)
terraform-google-conversion View Diff 3 files changed, 25 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance (462 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance" "primary" {
  scheduling {
    maintenance_interval = # value needed
  }
}

Resource: google_compute_instance_from_machine_image (21 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
  }
}

Resource: google_compute_instance_from_template (31 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  scheduling {
    availability_domain  = # value needed
    expose_host_topology = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    on_host_maintenance  = # value needed
  }
}

Missing doc report (experimental)

The following resources have fields missing in documents.

  • google_compute_instance_from_machine_image
    • Expected Document Path: /website/docs/r/compute_instance_from_machine_image.html.markdown
    • Fields: [scheduling.expose_host_topology]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [scheduling.expose_host_topology]

Test report

Analytics

Total Tests Passed Skipped Affected
1562 1455 95 12
Affected Service Packages
  • compute

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeBackendService_backendServiceInFlightExample
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeInstanceTemplate_gracefulShutdown
  • TestAccComputeInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeInstance_GracefulShutdownWithResetUpdate
  • TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
  • TestAccComputeInstance_guestAccelerator
  • TestAccComputeInstance_schedulingExposeHostTopology
  • TestAccComputeRegionInstanceTemplate_gracefulShutdown
  • TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
  • TestAccComputeTargetInstance_withSecurityPolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccComputeBackendService_backendServiceInFlightExample
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithResetUpdate
❌ Error · Log - TestAccComputeInstance_GracefulShutdownWithoutResetUpdate
❌ Error · Log - TestAccComputeInstance_guestAccelerator
❌ Error · Log - TestAccComputeInstance_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeRegionInstanceTemplate_gracefulShutdown
❌ Error · Log - TestAccComputeRegionInstanceTemplate_schedulingExposeHostTopology
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig
❌ Error · Log - TestAccComputeTargetInstance_withSecurityPolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@tanvinsharma, @ScottSuarez VCR tests complete for b4bd849!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants