Skip to content

Add support for dynamic nic to GCE instance/template#16303

Merged
rileykarson merged 4 commits into
GoogleCloudPlatform:mainfrom
rileykarson:instance-dynamic-nic
Feb 5, 2026
Merged

Add support for dynamic nic to GCE instance/template#16303
rileykarson merged 4 commits into
GoogleCloudPlatform:mainfrom
rileykarson:instance-dynamic-nic

Conversation

@rileykarson

@rileykarson rileykarson commented Feb 4, 2026

Copy link
Copy Markdown
Member

Supports https://docs.cloud.google.com/vpc/docs/create-use-multiple-interfaces#example-dynamic but not yet https://docs.cloud.google.com/vpc/docs/add-dynamic-nics as the update code is gonna be fun to work out.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: added support for `network_interface.0.vlan` to `google_compute_instance`, enabling dynamic NIC. Creating and deleting from an existing instance is not yet supported.
compute: added support for `network_interface.0.vlan` to `google_compute_instance_template`, enabling dynamic NIC
compute: added support for `network_interface.0.vlan` to `google_compute_region_instance_template`, enabling dynamic NIC
compute: added support for `network_interface.0.network_attachment` to `google_compute_region_instance_template`
compute: added support for `network_interface.0.network_attachment` to `google_compute_instance_template` (GA)

@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 ( 7 files changed, 291 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 7 files changed, 197 insertions(+), 1 deletion(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

Missing test report

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

Resource: google_compute_instance_from_machine_image (17 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" {
  network_interface {
    vlan = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  network_interface {
    vlan = # 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: [network_interface.parent_nic_name network_interface.vlan]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [network_interface.parent_nic_name network_interface.vlan]

@zli82016

zli82016 commented Feb 5, 2026

Copy link
Copy Markdown
Member

It looks like the unit test failed as the fields need to be added to the meta.yaml files

--- FAIL: TestValidateResourceMetadata (0.52s)
    resource_inventory_test.go:231: Field in provider resource; missing in meta.yaml: google_compute_instance.network_interface.parent_nic_name
    resource_inventory_test.go:231: Field in provider resource; missing in meta.yaml: google_compute_instance.network_interface.vlan
    resource_inventory_test.go:231: Field in provider resource; missing in meta.yaml: 

@modular-magician

Copy link
Copy Markdown
Collaborator

🔴 The provider crashed while running the VCR tests in REPLAYING mode
Please fix it to complete your PR.
View the build log

@rileykarson rileykarson requested review from zli82016 and removed request for c2thorn February 5, 2026 00:38
@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 ( 14 files changed, 491 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 15 files changed, 399 insertions(+), 1 deletion(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

Missing test report

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

Resource: google_compute_instance_from_machine_image (17 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" {
  network_interface {
    vlan = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  network_interface {
    vlan = # value needed
  }
}

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

resource "google_compute_region_instance_template" "primary" {
  network_interface {
    network_attachment = # 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: [network_interface.parent_nic_name network_interface.vlan]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [network_interface.parent_nic_name network_interface.vlan]

@zli82016

zli82016 commented Feb 5, 2026

Copy link
Copy Markdown
Member

Failed tgc integration test is unrelated.

@modular-magician

Copy link
Copy Markdown
Collaborator

Non-exercised tests

🔴 Tests were added that are GA-only additions and require manual runs:

  • TestAccComputeInstanceTemplate_NetworkAttachment

Tests analytics

Total tests: 1334
Passed tests: 1244
Skipped tests: 86
Affected tests: 4

Click here to see the affected service packages
  • compute

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_dynamicNic
  • TestAccComputeInstance_dynamicNic
  • TestAccComputeRegionInstanceTemplate_dynamicNic
  • TestAccComputeRegionInstanceTemplate_networkAttachment

Get to know how VCR tests work

@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 ( 14 files changed, 488 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 15 files changed, 396 insertions(+), 1 deletion(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

Missing test report

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

Resource: google_compute_instance_from_machine_image (17 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" {
  network_interface {
    vlan = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  network_interface {
    vlan = # 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: [network_interface.parent_nic_name network_interface.vlan]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [network_interface.parent_nic_name network_interface.vlan]

@modular-magician

Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeInstanceTemplate_dynamicNic [Debug log]
TestAccComputeInstance_dynamicNic [Debug log]
TestAccComputeRegionInstanceTemplate_dynamicNic [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeRegionInstanceTemplate_networkAttachment [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

@zli82016 zli82016 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM if all of the tests pass.

@modular-magician

Copy link
Copy Markdown
Collaborator

Non-exercised tests

🔴 Tests were added that are GA-only additions and require manual runs:

  • TestAccComputeInstanceTemplate_NetworkAttachment

Tests analytics

Total tests: 1334
Passed tests: 1247
Skipped tests: 86
Affected tests: 1

Click here to see the affected service packages
  • compute

Action taken

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

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeRegionInstanceTemplate_networkAttachment [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

@rileykarson rileykarson disabled auto-merge February 5, 2026 02:58
@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 ( 14 files changed, 481 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 15 files changed, 396 insertions(+), 8 deletions(-))
terraform-google-conversion: Diff ( 2 files changed, 6 insertions(+))

Missing test report

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

Resource: google_compute_instance_from_machine_image (17 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" {
  network_interface {
    vlan = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  network_interface {
    vlan = # 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: [network_interface.parent_nic_name network_interface.vlan]
  • google_compute_instance_from_template
    • Expected Document Path: /website/docs/r/compute_instance_from_template.html.markdown
    • Fields: [network_interface.parent_nic_name network_interface.vlan]

@rileykarson rileykarson enabled auto-merge February 5, 2026 03:18
@rileykarson rileykarson added this pull request to the merge queue Feb 5, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 4352529 Feb 5, 2026
23 of 25 checks passed
@modular-magician

Copy link
Copy Markdown
Collaborator

Non-exercised tests

🔴 Tests were added that are GA-only additions and require manual runs:

  • TestAccComputeInstanceTemplate_NetworkAttachment

Tests analytics

Total tests: 1334
Passed tests: 1248
Skipped tests: 86
Affected tests: 0

Click here to see the affected service packages
  • compute

🟢 All tests passed!

View the build log

NandiniAgrawal15 pushed a commit to NandiniAgrawal15/magic-modules that referenced this pull request Feb 5, 2026
wuchris-g pushed a commit to wuchris-g/magic-modules that referenced this pull request Feb 5, 2026
18811376770 pushed a commit to 18811376770/magic-modules that referenced this pull request Feb 11, 2026
JianweiQ pushed a commit to JianweiQ/magic-modules that referenced this pull request Feb 20, 2026
kefang2 pushed a commit to kefang2/magic-modules that referenced this pull request Feb 28, 2026
aditikumarii-google pushed a commit to aditikumarii-google/magic-modules that referenced this pull request Mar 10, 2026
ChuAmberZhang pushed a commit to ChuAmberZhang/magic-modules that referenced this pull request Apr 29, 2026
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.

3 participants